Monday, April 21, 2025

Expected Value and Likely Profit II: Different Playbooks

WCMI Expected Value and Likely Profit II: Different Playbooks

'EV' vs. 'EV+LP'

For the Bookmaker, EV adds up. For the Bettor, EV+LP goes forth and multiplies!

In our original post, we introduced Likely Profit (LP) as a complementary metric to Expected Value (EV). To recap clearly:

  • Expected Value (EV) measures the average profit per bet. It is an additive metric, suited to the bookmaker's scenario of multiple parallel bets.
  • Likely Profit (LP) measures the expected geometric (logarithmic) growth rate of our bankroll. It is a multiplicative metric, reflecting the bettor's sequential reality and limited bankroll.

Mathematically, these metrics are defined as follows:

E V = ( W B × P ) + ( L B × ( 1 P ) ) 1 \begin{align} \tag{a} EV = (WB \times P) + (LB \times (1 - P)) - 1 \end{align}

L P = ( W B P × L B ( 1 P ) ) 1 \begin{align} \tag{b} LP = (WB^{P} \times LB^{(1 - P)}) - 1 \end{align}

Where:

  • WB (Win Balance) is the bankroll multiplier if the bet wins (e.g., W B = ( 1 + ( F ( O 1 ) ) ) WB = (1 + (F * (O - 1))) ).
  • LB (Loss Balance) is the bankroll multiplier if the bet loses (e.g., L B = ( 1 F ) LB = (1 - F) ).
  • F is the stake.
  • O is the decimal odds.
  • P is the probability of winning.

Bookmaker's Additive World: Why EV is King

Take a small edge from every bet and let volume do the rest.

Bookmakers handle hundreds or thousands of bets simultaneously, each priced with a built-in margin ("vig"), ensuring each bet has a positive expected value from the bookmaker's perspective. With effectively unlimited bankroll and diversified action, bookmakers invoke the law of large numbers, ensuring actual profits converge closely to the expected profits.

In the bookmaker's additive world, EV is the definitive metric because:

  • Volume smooths out variance, making EV directly translate into predictable profits.
  • Bankroll size is enormous, meaning the bookmaker does not worry about short-term fluctuations from individual outcomes.
  • Profitability is guaranteed over time, given a positive EV across many bets.

Thus, bookmakers focus exclusively on EV, setting odds to guarantee their additive advantage. They care about aggregate profit, not about individual outcomes.

Bettor's Sequential Reality: Why EV Needs LP

Maximize bankroll growth, not just average payout.

Now, switch seats to a bettor's perspective. Unlike bookmakers, bettors cannot make thousands of simultaneous bets. Instead, bettors sequentially place bets over time with limited bankrolls. Each bet outcome directly influences future betting capacity, making their reality multiplicative rather than additive. The multiplicative effect means that the order and size of wins and losses matter a lot.

Here is where Likely Profit (LP) becomes essential:

  • LP measures the expected geometric (logarithmic) growth rate of our bankroll.
  • LP is closely related to the Kelly criterion, well-known in finance and betting for maximizing long-run bankroll growth.
  • LP effectively considers that bankroll growth is multiplicative, and thus, variance and bet sizing matter greatly for survivor bias and long-term wealth accumulation.

While EV alone indicates average profit per bet, LP indicates how our bankroll is expected to compound over time. A bet with positive EV but negative LP could lead to significant bankroll volatility, potentially resulting in ruin before the theoretical EV manifests.

Practical Example: EV vs EV+LP in Action

Scenario: You have a $1,000 bankroll and have decided to stake $100 (10% of our bankroll) on one of two bets. Both bets have the same EV (+$10), but differ significantly in risk and profile:

  • Bet X (High-risk, high-reward bet):

    • Odds: +1000 (decimal 11.0)
    • Our estimated true probability: 10% (implied odds = 9.1%)
    • Crucially, LP is negative, indicating expected bankroll shrinkage over repeated bets of this type at this stake fraction.
  • Bet Y (Lower-risk, moderate-reward bet):

    • Odds: +100 (decimal 2.0)
    • Our estimated true probability: 55% (implied odds = -122)
    • LP is positive, indicating expected bankroll growth over repeated sequential bets of this type.

Both bets have identical EV, yet Bet Y clearly outshines Bet X when evaluated holistically using EV+LP. Bet Y's positive LP means it's better suited for sustainable bankroll growth, lower variance, and greater certainty of survival.

This example starkly highlights that as a bettor, we must consider LP as well as EV to intelligently balance profit potential, risk, and bankroll longevity.

Different Goals, Different Metrics

Bookmakers and bettors have fundamentally different goals and constraints:

  • Bookmakers operate in an additive world with massive diversity and bankroll, making EV sufficient.
  • Bettors face multiplicative outcomes with limited bankrolls, making EV necessary but insufficient. They must also consider LP to ensure survival through inevitable volatility and to maximize bankroll growth.

Thus, the metrics they optimize diverge:

Perspective Metric Goal
Bookmaker EV (additive) Maximize total profit
Bettor EV + LP (multiplicative) Maximize long-term bankroll growth

Playing Correct Perspective

In sum, to succeed as a bettor, we must combine the mathematical rigor of EV identification with the strategic prudence of LP-based bankroll management. Selecting only positive-EV bets is necessary but not sufficient. We must also size our bets to ensure positive LP, aligning our strategy with geometric bankroll growth and survival.

In short:

  • EV answers: "How much do I win on average per bet?"
  • LP answers: "How will my bankroll realistically grow over many sequential bets?"

A savvy bettor understands both and uses them in tandem, ensuring a profitable journey not just theoretically, but practically.

By clearly understanding these dual metrics, we can meaningfully improve our betting strategy, aligning our actions with our real-world constraints and maximizing our probability of success in the long run.

Enjoy!


Note: The final draft of this post was sanity checked by ChatGPT.

Wednesday, March 12, 2025

Cheltenham (2025-03-13) - Selections

WCMI Cheltenham Live-Longshot Selections (Gallop Poll)

Cheltenham (2025-03-13) - Selections


Throwing caution to the wind and letting our private LLM bot loose on the hallowed Cheltenham turf to see how it performs. It made the following selections, and we have not curated its choices or supporting evidence.

Tread carefully!

Gallop Poll Selections and Supporting Evidence


Result:


1. Doddiethegreat, 27.0

2. Jeriko Du Reponet, 8.80

Sunday, February 23, 2025

Neigh Sayers and Gallop Polls

WCMI Neigh Sayers and Gallop Polls

Neigh Sayers


Imagine the scenario: "Two horses abreast heading for the final hurdle in a major handicap race of the Cheltenham Festival and one of those contenders ('Neigh Sayer') has £20 each-way of your hard-earned cash pinned on its success at 20/1. You can already anticipate congratulations from your mates on this successful convex bet..." As Weekend Warriors, we all dream of such improbable successes!

Live Longshot:


Now consider asking a ChatGPT-like private LLM bot to select (and justify) those bets for you. For the upcoming Cheltenham Festival, we are hopeful (though not guaranteeing) that we will provide some recommendations (from our Live-Longshot bot) for a few of the more challenging races!

Taster:


Here is a taster...

Enjoy!

Tuesday, December 24, 2024

Ensemble vs Time: Betting Strategy Simulation

WCMI Ensemble vs Time: Betting Strategy Simulation

Ensemble vs Time: Betting Strategy Simulation


Imagine a lively casino brimming with daydreamers hoping to spin meagre coins into great fortunes one bet at a time. Others position themselves on the sidelines, cheerfully tallying the incoming bets. The daydreamers are the players, and the sideliners are the house.


Volatility Drag

In the bustling arena of sports trading, a hidden force exists called volatility drag: the mathematical difference between geometric and arithmetic averages. This difference resembles a tax due to the mathematics, which imposes a lower compound return when returns vary over time. This difference between the average outcome that a bookmaker tallies (from countless eager bettors) and a single bettor's actual lived experience can become very wide.

To illustrate, we have created a Betting Strategy Simulator that reveals how luck may bolster or batter your bankroll.


Two Sides of the Same Bet

  1. Time Perspective (Median)
    Regard this perspective as the lone trader, placing multiple bets in sequence. Each triumph or tumble weighs heavily on their well-being. Over many tries, their median final bankroll can suffer from volatility drag, meaning a few unlucky tumbles may gouge deeper than occasional victories can heal.
  2. Ensemble Perspective (Mean)
    Consider the bookmaker presiding over a torrent of simultaneous wagers. In that swirling chaos, all results average out. While heartbreak and jubilation strike individuals, the house sees a calm, aggregated mean that, if well-calculated, coasts along in a far more stable fashion than a single bankroll can hope for.

Key Parameters

  • Probability of Winning: A Percentage.
  • Odds: For example, odds of 2.30 yield the stake plus 130% more if we win.
  • Stake: The size of each bet (percentage).
  • Number of Bets: Length of the trader's journey or the repeated steps over which the bookmaker aggregates.
  • Number of Simulations: Number of scenario replications.

Running Simulation

  1. Inputs
    • Enter probability, odds, stake, and so on.
  2. Process
    • Click on Run Simulation to launch the simulation.
  3. Outputs
    • Monte Carlo (Time) Results: The Median Final Bankroll for the solitary trader forging through a sequence of wagers. The geometric rise (or descent!) becomes evident here.
    • Monte Carlo (Ensemble) Results: The Mean Final Bankroll from the vantage of the house. With each bet in parallel, the chaos yields a predictable average - an expected value.

Under the Hood

  • Time: We line up (N)(N) traders, each living out (M)(M) consecutive bets. Their final bankrolls vary widely, but the median is the honest sentinel of their fortunes.
  • Ensemble: We replicate (N)(N) parallel bets for each of (M)(M) rounds, calculate the mean outcome each time, and watch the bankroll grow in that aggregated manner.
  • Volatility Drag: If there is one lesson to learn, it is that a 50% dip requires a 100% surge to climb out of the pit. The bigger the stake, the more each stumble stings and volatility seldom shows mercy.


Reading Results

  1. Single Bettor's Plight
    The median bankroll can unravel if luck sends you through a rough patch. Even with a favourable win probability, sustained drawdowns hurt more than fleeting upticks help.

  2. Parallel Paradise
    The bookmaker's many concurrent bets form a serene environment where the mean bankroll (averaged across countless outcomes) marches forward in lockstep with the basic mathematics of expected value.

  3. Practical Wisdom

    • As a punter, carefully consider the violent power of sequential losses. Bankroll management becomes your shield, lest a string of flops knock you out.
    • As the house or aggregator of bets, relax behind a wide net of players, diluting the wilder swings of misfortune.

Looking Forward

Volatility drag is a subtle and cunning opponent that shrinks big dreams. The simulator reminds us that mean vs. median can diverge drastically. The sports trader sees the ephemeral illusions of large short-term gains, recognising the risk that a run of losses can carve away capital faster than big wins can restore it. Meanwhile, the bookmaker basks in the calm assurance of ensembles: a stable accumulation of profits gleaned from the grand churn of wagers.

If nothing else, remember that early wins are crucial in the time dimension but not so in the Ensemble dimension!

Enjoy!


Note: An LLM generated the first draft of this post based on our simulator code listing.

Wednesday, November 27, 2024

Up-Down Votes To In-The-Money Finishes

WCMI Up-Down Votes To In-The-Money Finishes

Up-Down Votes

In data analysis applied to horse racing (Equus Analytics), we frequently draw inspiration and fresh insights from other disciplines. Today, we are focusing on an adaptation of Evan Miller's Bayesian method for handling up-down vote scenarios in online content ranking. To that end, we have two primary goals:

  • Work with minimal data, and
  • Identify convex bets (live longshots).

It is always intriguing to determine what insights we can infer when working with minimal data (e.g. horse lifetime record):

Horse Runs Win Place Show
Zulu 23 7 5 2

This situation frequently arises when trading foreign (e.g. international) racing circuits (e.g. Hong Kong, Japan), which have exceptional racing industries but for which we do not have detailed past performance records for most horses.

Bayesian Foundation

At its core, the Bayesian average rating system provides a statistically valid way to rank items based on positive and negative feedback, accounting for uncertainties due to limited data. In the context of up-down votes, it is straightforward: items receive up-votes (successes) and down-votes (failures), and we wish to rank them to balance their average rating with our confidence in that rating.

Translating this to horse racing, we consider:

  • Events Placed: Number of times a horse has finished "in the money" (e.g., first, second, or third).
  • Events Unplaced: Number of times a horse has raced but did not finish "in the money".
  • Time Since Placed/Unplaced: Time elapsed since the horse's last placed or unplaced finish, allowing us to weigh recent performances more heavily than older ones.

Adaptation

The Bayesian model requires a prior belief and adjusts this belief based on new evidence. Here's how we adapt the model:

  1. Prior Beliefs (Pseudo-Events): Assign each horse a baseline level of performance. This prevents horses with very few races from being unfairly ranked at the extremes due to insufficient data.
  2. Updating with New Data: Each horse's actual race outcomes are added to the prior beliefs, giving us the total "events placed" and "events unplaced".
  3. Exponential Decay of Events: To ensure that recent performances have more impact, we apply an exponential decay to the events based on the time since they occurred. This approach mirrors how specific online platforms weigh newer votes more heavily than older ones.
  4. Computing the Bayesian Rating: We calculate the Bayesian average rating (the "sorting criterion") using the beta distribution, which balances the observed data and the uncertainty inherent in limited or decayed data.

Code Walkthrough

Below is an excerpt of the Python implementation. For brevity, we'll focus on the key components.

import numpy as np
import pandas as pd
from scipy.special import betaincinv
import time

def initialize_ratings(state):
    new_state = state.copy()
    ratings_df = pd.DataFrame(new_state['new_ratings'])
    ratings_df.rename(columns={'name': 'entry_id'}, inplace=True)
    # Add prior beliefs (pseudo-events)
    ratings_df['events_placed'] += new_state['pseudo_events_placed']
    ratings_df['events_unplaced'] += new_state['pseudo_events_unplaced']
    # Convert time since last events to absolute times
    current_time = time.time()
    ratings_df['last_placed_time'] = current_time - ratings_df['time_since_placed']
    ratings_df['last_unplaced_time'] = current_time - ratings_df['time_since_unplaced']
    new_state['ratings'] = ratings_df
    return new_state

In 'initialize_ratings', we set up our DataFrame with the horse entries, adjust for prior beliefs, and calculate the timestamps.

def decay_events(state):
    new_state = state.copy()
    current_time = time.time()
    half_life = new_state['half_life']
    ratings_df = new_state['ratings']
    # Calculate decay factors
    ratings_df['decay_factor_placed'] = 2 ** (-(current_time - ratings_df['last_placed_time']) / half_life)
    ratings_df['decay_factor_unplaced'] = 2 ** (-(current_time - ratings_df['last_unplaced_time']) / half_life)
    # Apply decay
    ratings_df['events_placed'] *= ratings_df['decay_factor_placed']
    ratings_df['events_unplaced'] *= ratings_df['decay_factor_unplaced']
    new_state['ratings'] = ratings_df
    return new_state

The 'decay_events' function applies exponential decay to the events. While we lack individual timestamps for all events, using the time since the last events (i.e. placed and unplaced) provides a pragmatic approximation under current data limitations.

def construct_sorting_criterion(state):
    new_state = state.copy()
    loss_multiple = new_state['loss_multiple']
    new_state['ratings']['sorting_criterion'] = new_state['ratings'].apply(
        lambda row: betaincinv(
            row['events_placed'] + 1,
            row['events_unplaced'] + 1,
            1 / (1 + loss_multiple)
        ), axis=1
    )
    return new_state

Here, 'construct_sorting_criterion' computes the Bayesian rating using the inverse incomplete beta function, factoring in our desired level of caution via the 'loss_multiple'.

Worked Example

Let us consider a race with several horses and their performance data:

initial_state = {
    'pseudo_events_placed': 5.0,  # Prior belief of 5 placed events
    'pseudo_events_unplaced': 5.0,  # Prior belief of 5 unplaced events
    'half_life': 3600 * 24 * 7,  # One week in seconds
    'new_ratings': [
        {'name': '1. Alpha', 'events_placed': 13, 'events_unplaced': 36, 'time_since_placed': 5, 'time_since_unplaced': 24},
        {'name': '2. Bravo', 'events_placed': 6, 'events_unplaced': 22, 'time_since_placed': 432, 'time_since_unplaced': 14},
        # Additional horse data...
    ],
    'loss_multiple': 5
}

After running the code, we obtain the following rankings:

Entry Placed Unplaced Ratings S/P F/P
5. Echo 12.00 16.00 0.35 20/1 3/11
8. Hotel 8.00 11.00 0.32 5/1 1/11
11. Kilo 5.00 8.00 0.28
3. Charlie 11.00 22.00 0.27 9/2 2/11
1. Alpha 18.00 41.00 0.25 11/8 4/11
... ... ... ... ... ...
  • Ratings: The Bayesian rating computed for each horse.
  • S/P (Starting Price): The odds offered at the start of the race.
  • F/P (Finishing Position): The horse's finishing position in the race.

Results

Notably, four of the top five horses in our rankings secured the first four positions in the race (as indicated in the 'F/P' column). Interestingly, Echo, with a starting price of 20/1, was ranked highest by our model and finished third. This suggests that the Bayesian approach might help identify "live longshots" horses with higher odds that have a reasonable chance of performing well.

Limitations

An astute observer might point out that applying decay to the total event count based solely on the time since the last event is not entirely accurate. Ideally, we would decay each event individually based on when it occurred. However, lacking detailed timestamps, our current method provides a reasonable approximation, especially if:

  • Event Timing is Similar Across Entries: If most horses have events spaced similarly over time, the relative decay applied will be consistent.
  • Recent Performance is Indicative: If a horse's most recent performance strongly indicates its current form, weighting events based on the last event may be defensible.

While this is not a perfect solution, the model's success in our worked example suggests it holds practical value.

Power of Bayesian Analysis

This adaptation of the Bayesian average rating system demonstrates that we can extract meaningful insights even from minimal data with some mathematical ingenuity and a pragmatic approach to data limitations. The model doesn't guarantee winners but offers a statistically sound method to rank horses beyond surface-level metrics.

By highlighting horses like Echo, the model can point out potential value bets with favourable odds that may have slipped under the radar of the casual punter.

Moving Forward

For those interested in refining this approach:

  • Gather More Data: To improve the decay function, collect timestamps for individual events.
  • Experiment with Parameters: Adjust the 'half_life' and 'loss_multiple' to see how sensitive the model is to these parameters.
  • Re-Define Priors: Adjust 'pseudo_events_placed' and 'pseudo_events_unplaced' to see how sensitive the model is to these priors.

Conclusion

While we must remain mindful of the model's limitations, this Bayesian approach provides a solid starting point for horse racing analysis with minimal data. It blends statistical rigour with practical application.

As with all forms of betting and analysis, there are no certainties; there are only probabilities. This model helps us navigate those probabilities with more confidence, perhaps shining a light on those "live longshots".

Enjoy!


Note: The first draft of this post was generated by an LLM from our Python code listing and Evan Miller's original article.

Thursday, October 03, 2024

Expected Value (EV) and Likely Profit (LP)

WCMI Expected Value (EV) and Likely Profit (LP)

In betting analysis, there is a strong emphasis on only selecting Value Bets. To this end, we are advised to calculate the Expected Value (EV) of a proposed bet and, if the result is positive, then we have a potential value bet. However, this approach is very short-sighted as outlined below. This will lead us to add an additional metric - Likely Profit (LP) - and the Dual-Metric Decision Algorithm (DMDA).

We will focus on this canonical betting example:

Parameter Value
Initial Bankroll (B) $10000
Markets (M) 1
Decimal Odds (O) 1.9091
Win Probability (P) 55.00%
Stake Fraction (F) 1.00%

First, let us calculate the Win Balance (WB) and the Loss Balance (LB) in percentage terms. WB is the state of the bankroll after a winning bet and LB is the state of the bankroll after a losing bet. WB and LB are calculated as follows:

WB=(1+(F*(O-1)))LB=(1-F)\begin{align} \tag{1} \mathit{WB} = (1 + (F * (O - 1))) \\ \tag{2} LB = (1 - F) \end{align}

The EVper-unit-stakedEV_{per-unit-staked} is equal to:

EV=(WB*P)+(LB*(1-P))-1\begin{align} \tag{3} EV = (\mathit{WB} * P) + (LB * (1 - P)) - 1 \end{align}

EV represents the average profit or loss per unit staked over a large number of bets, assuming the same odds and probability hold true.

But, to evaluate the bet in terms of our specific circumstances, we need an additional metric - Likely Profit (LP).

The LPper-unit-stakedLP_{per-unit-staked} is equal to:

LP=(WBP*LB(1-P))-1\begin{align} \tag{4} LP = (\mathit{WB}^{P} * LB^{(1 - P)}) - 1 \end{align}

LP represents the expected growth rate of the bankroll over a series of bets, assuming the same odds and probability hold true. It takes into account the compounding effect of wins and losses.

Also, the BankrollEVBankroll_{EV} and the BankrollLPBankroll_{LP} are equivalently:

BEV=(1+EV)M*BBLP=(1+LP)M*B\begin{align} \tag{5} B_{EV} = (1 + EV)^{M} * B \\ \tag{6} B_{LP} = (1 + LP)^{M} * B \end{align}

Note: Likely Profit (LP) is equivalent to expected bankroll growth!

This leads naturally to our Dual Metric Decision Algorithm (DMDA), which is best exemplified with the following Python snippet:

if ev_per_unit > 0 and lp_per_unit > 0:
    decision = 'Favorable bet; consider proceeding.'
elif ev_per_unit > 0 and lp_per_unit <= 0:
    decision = 'Positive EV but negative LP; reconsider stake size.'
else:
    decision = 'Negative EV; generally avoid this bet.'

Returning to our example above, we can calculate the various metrics as follows:

  • WB

WB=(1+(F*(O-1)))WB=(1.00+(0.01*(1.9091-1.00)))WB=1.009091\begin{align} \tag{7a} \mathit{WB} = (1 + (F * (O - 1))) \\ \tag{7b} \mathit{WB} = (1.00 + (0.01 * (1.9091 - 1.00))) \\ \tag{7c} \mathit{WB} = 1.009091 \\ \end{align}

  • LB

LB=(1-F)LB=(1.00-0.01)LB=0.99\begin{align} \tag{8a} LB = (1 - F) \\ \tag{8b} LB = (1.00 - 0.01) \\ \tag{8c} LB = 0.99 \\ \end{align}

  • EV

EV=(WB*P)+(LB*(1-P))-1EV=(1.009091*0.55)+(0.99*(1.00-0.55))-1.00EV=0.0004995\begin{align} \tag{9a} EV = (\mathit{WB} * P) + (LB * (1 - P)) - 1 \\ \tag{9b} EV = (1.009091 * 0.55) + (0.99 * (1.00 - 0.55)) - 1.00 \\ \tag{9c} EV = 0.0004995 \\ \end{align}

  • LP

LP=(WBP*LB(1-P))-1LP=(1.0090910.55*0.99(1.00-0.55))-1.00LP=0.0004524\begin{align} \tag{10a} LP = (\mathit{WB}^{P} * LB^{(1 - p)}) - 1 \\ \tag{10b} LP = (1.009091^{0.55} * 0.99^{(1.00 - 0.55)}) - 1.00 \\ \tag{10c} LP = 0.0004524 \\ \end{align}

  • B_EV

BEV=(1+EV)M*BBEV=(1.00+0.0004995)1*10000BEV=10004.995\begin{align} \tag{11a} B_{EV} = (1 + EV)^{M} * B \\ \tag{11b} B_{EV} = (1.00 + 0.0004995)^{1} * 10000 \\ \tag{11c} B_{EV} = 10004.995 \\ \end{align}

  • B_LP

BLP=(1+LP)M*BBLP=(1.00+0.0004524)1*10000BLP=10004.524\begin{align} \tag{12a} B_{LP} = (1 + LP)^{M} * B \\ \tag{12b} B_{LP} = (1.00 + 0.0004524)^{1} * 10000 \\ \tag{12c} B_{LP} = 10004.524 \\ \end{align}

Decision: Since both EV and LP per unit are positive, this is a favorable bet.

While the traditional EV approach can be useful for identifying potential value bets, it fails to capture the full picture when considering the long-term impact of betting decisions. By introducing Likely Profit (LP) as a complementary metric, we can gain a more comprehensive understanding of the expected bankroll growth over a series of bets. This dual-metric approach allows for a more nuanced decision-making process, enabling bettors to make informed choices that align with their individual risk profiles and long-term goals. However, the DMDA is a simplified approach and should be further refined. What is presented here is a starting point for this approach, and further research and development are needed to refine and optimize this framework for practical application in real-world betting scenarios.