61 min read

Here are three prices for one driver in one race. All three come from this book's own models, and none of them is a bookmaker's.

Chapter 38 — F1 Betting Analytics: Odds, Markets, Edges, and Where the Bookmakers Get It Wrong

Here are three prices for one driver in one race. All three come from this book's own models, and none of them is a bookmaker's.

The race is the 2024 São Paulo Grand Prix. On the Thursday before it, the Chapter 26 gradient-boosting model, run in its pre-qualifying form (no grid, no qualifying gap), gave Max Verstappen a 36.5% chance of winning. That made him its favourite, ahead of Lando Norris at 26.2%. Then the weekend happened. Saturday's weather pushed qualifying to Sunday. Verstappen qualified 12th and, according to the reference table data/reference/notable_races.md (formula1.com), started 17th after a five-place penalty for an extra internal-combustion engine. Norris took pole.

The full model, now able to see the grid, dropped Verstappen to 6.9% and raised Norris to 75.6%. The grid-slot baseline, which knows only where each car starts, gave Verstappen 0.14%: about one chance in 700.

He won by 19.477 s, on intermediates all race, through a virtual safety car (VSC) on lap 28, two safety cars (laps 30 and 39) and a red flag on lap 32. Norris finished sixth.

So which price was right? The 36.5% that ignored the penalty? The 6.9%? The 0.14%?

Ines: The Thursday one. It had him winning, and he won.

Ray: It also had him winning in plenty of races he didn't win. You can't grade a price on one race. You grade it on the next five hundred.

Aisha: And whether it would have made money depends on a fourth number we haven't got: what the bookmaker was offering.

Ray: That's the whole game. The model's number is half of a bet. The price is the other half.

Ray has placed small, careful bets on Formula One for decades, and that last line is the most important sentence in this chapter. A forecast on its own is not a bet. A bet is a forecast set against a price. The difference between the two, the edge, is the only thing that matters. And this book has no prices.

We have to say that plainly, because it shapes everything that follows. The book's data snapshot contains every lap, stint, flag and result since 2023 (OpenF1) and every result since 1950 (Jolpica-F1). It contains no historical odds, from any bookmaker or exchange. So this chapter does not tell you where the bookmakers got it wrong. Nobody can tell you that without their prices, and anyone who claims to without showing them deserves Ray's raised eyebrow. What we can do is three things, honestly:

  1. Teach the maths that turns a price into a probability and a probability into a stake: implied probability, the bookmaker's margin, removing that margin, expected value and the Kelly criterion. Where an example needs a price, we build a clearly labelled hypothetical price from our models with a stated margin. We never type in a number and call it the market.
  2. Test the folk wisdom behind the usual claimed "edges" against our data, as hypotheses. Does the last race tell you more than the market supposedly thinks? Does rain scramble the order? Are there circuit specialists? Can you price a safety car? Each test runs on real data and reports whatever it finds.
  3. Measure what an edge would have to look like to survive a margin, and how long it would take to prove you have one.

The 2024 São Paulo prices give the first lesson already. The 36.5% was not "right" because Verstappen won. It was a price formed before the five-place penalty and the qualifying result were known, so it carried less information than the 6.9%. Whether 6.9% was too low is a question about calibration over hundreds of races, and we answer it in §38.3.

🏎️ Fan Track: Read §38.1–38.4 for the maths of odds and stakes, then §38.6 (weather) and §38.11 (responsible gambling). The code blocks are optional; the outputs and charts carry the story.

📊 Analytics Track: Everything. §38.3 (calibration), §38.5 (the recency regression) and §38.9 (the hypothetical-market backtest) are the core. This chapter assumes the walk-forward models of Chapter 26 and the Monte Carlo engine of Chapter 27.

🎰 Betting Track: This is your chapter. Read it in order. The prerequisite chapters on your track (12–14, 16, 19–22, 26–27, 36–37) are where the probabilities come from; this chapter is where they meet a price.


38.1 Markets, and What a Bettor Is Really Predicting

An F1 betting market is a set of mutually exclusive outcomes, each with a price. Exactly one outcome (or a fixed number of them) wins. The common ones are:

  • Race winner: about twenty runners, one winner.
  • Podium (or "top 3"): each driver is a yes/no bet, but the market as a whole has three winners.
  • Head-to-head (H2H): driver A against driver B, often teammates. Two outcomes, one winner. Bookmakers have rules for what happens when one or both cars retire; check them, because they change the maths.
  • Qualifying: pole position, or qualifying H2Hs.
  • Fastest lap: one winner.
  • Props: yes/no questions about the race. "Will there be a safety car?" is the classic F1 prop.
  • Constructors' and drivers' championships: long-term markets settled at the end of the season.

Each market is a probability question that this book has already learned to answer, at least approximately:

Market The probability you need Where the book estimates it
Race winner $P(\text{driver } i \text{ wins})$ for every driver Ch 26 walk-forward models; Ch 27 Monte Carlo
Podium $P(\text{driver } i \text{ finishes top 3})$ Ch 26 (p_podium), Ch 27
Teammate H2H $P(A \text{ ahead of } B)$, including retirements §38.10 of this chapter; Ch 21 teammate gaps
Safety car prop $P(\geq 1 \text{ SC})$ at this circuit Ch 14 hazards; §38.7
Fastest lap $P(\text{driver } i \text{ sets FL})$ §38.10
Championship $P(\text{title})$ Ch 26 championship simulation

Before any model, you need a base rate: the answer you would give from history alone. Ray never forgets this step. Over 2014–2026, the driver on pole won 55.7% (49.7–61.5) of races (152 of 273). Over 2023–2026 the figure was 62.6% (52.4–71.9; 57 of 91). The championship leader won 42.7% of the races he started as leader in 2014–2026, and the previous race's winner won the next one 37.3% of the time. Naming the top three on the grid as the podium got 68.6% of the names right (562 of 819), and the pole-sitter finished on the podium 81.0% of the time.

These numbers (from the book's prediction-baseline tables) set the bar. A forecast that cannot beat "the pole-sitter wins" is not a betting model. And as Chapter 26 found, beating it is hard. Walk-forward over 2014–2026, the models picked the winner 54–58% of the time, against 55.7% for "pole wins". No model's advantage in picking the winner had a confidence interval that excluded zero. The gradient-boosting model (GBM, a model built from many small decision trees added one after another) did improve log loss, the average of $-\ln p$ for the outcome that happened: 1.304 against 1.439 for the grid baseline.

That combination, no better at picking the favourite but better calibrated across the whole field, is exactly what a betting model needs. A bettor is not paid for naming the winner. The bettor is paid for knowing when the price is wrong. The price can be wrong on the third-favourite as easily as on the first.

📐 Definition: Edge. The edge of a bet is its expected value (EV) per unit staked, at the price actually offered: $\text{EV} = p \cdot o - 1$, where $p$ is your probability and $o$ is the decimal price. A positive edge means that, if your $p$ is right, the bet makes money on average.

🧩 Productive struggle. Before reading on: a bookmaker offers Norris at decimal odds of 1.90 to finish ahead of Piastri, and Piastri at 1.90 to finish ahead of Norris. You think it is a true 50/50. Write down your expected profit on a 10-unit bet on Norris. Then work out what the bookmaker expects to make if it takes 10 units on each side. Hold on to your answers; §38.2 gives the general formula.


38.2 From Odds to Probability

Prices come in three formats. They all say the same thing, so convert everything to decimal odds first. Decimal odds $o$ are the total return of a winning one-unit stake, including the stake. A winning 10-unit bet at 3.50 returns 35 units: 25 profit and the 10 back.

  • Fractional (UK): "5/2" means a profit of 5 for every 2 staked, so $o = 5/2 + 1 = 3.50$. "Evens" is 2.00.
  • American (moneyline): +250 means a profit of 250 on a 100 stake ($o = 3.50$). −150 means you stake 150 to win 100 ($o = 1 + 100/150 = 1.667$).

The implied probability of a price is its reciprocal:

$$\pi = \frac{1}{o}$$

In words: the implied probability is the win rate at which a bet at this price exactly breaks even. At 3.50, you need to win 1 time in 3.5, which is 28.6% of the time, to get your stakes back.

Our module boxbox/betting.py handles the conversions. The first block of code/01_odds_math.py runs them:

from boxbox import betting

for frac in ["evens", "5/2", "1/3", "33/1"]:
    d = betting.decimal_from_fractional(frac)       # "5/2" -> 3.5
    print(f"fractional {frac:>6} -> decimal {d:7.3f} -> implied {100*betting.implied_prob(d):5.1f}%")
for am in [250, -150]:
    d = betting.decimal_from_american(am)           # +250 -> 3.5, -150 -> 1.667
    print(f"American  {am:+6d} -> decimal {d:7.3f} -> implied {100*betting.implied_prob(d):5.1f}%")
two_way = np.array([1.91, 1.91])
print(f"overround {100*betting.overround(two_way):.2f}% ; break-even {100/1.91:.1f}%")
1. Price formats (arithmetic only)
  fractional  evens -> decimal   2.000 -> implied  50.0%
  fractional    5/2 -> decimal   3.500 -> implied  28.6%
  fractional    1/3 -> decimal   1.333 -> implied  75.0%
  fractional   33/1 -> decimal  34.000 -> implied   2.9%
  American    +250 -> decimal   3.500 -> implied  28.6%
  American    -150 -> decimal   1.667 -> implied  60.0%
  two-way market at 1.91 / 1.91: overround 4.71% ; break-even win rate 52.4%

The last line answers the productive struggle in its general form. Take a hypothetical two-way H2H priced at 1.91 on each side. The implied probabilities are 52.4% and 52.4%, which sum to 104.7%. A market's implied probabilities always add to more than the number of winners. That excess is the bookmaker's margin.

📐 Definition: Overround (the margin, the "vig", the "juice"). For a market with $N$ runners and $W$ winners, $$B = \sum_{i=1}^{N} \frac{1}{o_i}, \qquad \text{overround} = B - W.$$ $B$ is the booksum. A fair book has $B = W$.

In words: add up the implied probabilities; whatever is above 100% (or above 300% for a three-winner podium market) is the price of playing. For the 1.91/1.91 market, the overround is 4.71%. If a bookmaker took equal money on both sides, every 2 units staked would bring back 1.91 to the winners, and the bookmaker would keep 0.09 units, or 4.5% of the money taken, whoever won. In the struggle above, at 1.90 a side, your expected profit on 10 units at a true 50% is $10 \times (0.5 \times 1.90 - 1) = -0.50$, and the book's take on 20 units is 1.00. That is how the margin works: the book does not need to know who wins.

The break-even line follows directly. At 1.91 you must win 52.4% of your bets just to stand still. "Better than a coin flip" is not good enough; you need to be better than 52.4%, and you need to be better on the bets you actually choose.

⚠️ Common pitfall: reading implied probability as the bookmaker's opinion. The implied probability of a price is not the bookmaker's forecast. It is the forecast plus the margin, plus whatever shading the book applies to balance its liabilities. Two drivers both priced at 1.91 are not "52.4% each" in anyone's view; together they would be 104.7%. Always remove the margin before you compare a price with a model, and then compare against the price you can actually get, margin included (§38.3).

🔄 Check your understanding 1. Convert 7/2 and +400 to decimal odds and implied probabilities. 2. A three-runner market is priced 2.10, 3.40 and 4.50. What is its overround?

Answer 1. 7/2 → 4.50 → 22.2%. +400 → 5.00 → 20.0%. 2. 1/2.10 + 1/3.40 + 1/4.50 = 0.476 + 0.294 + 0.222 = 0.992. The booksum is below 1, so the overround is −0.8%. A book like that pays out more than it takes if it is balanced; real books are almost never priced like this, and if you see it across two bookmakers it is called an arbitrage.


38.3 Removing the Margin, and the Question of Calibration

To compare a price with a model, you need the fair probability: the price's implied probability with the margin taken out. In a two-way market at equal prices the answer is obvious (50/50). In a twenty-runner winner market it is not, because the bookmaker does not have to spread the margin evenly. There are four standard ways to undo it, and they disagree in an instructive way.

  • Multiplicative (proportional): divide each implied probability by the booksum, $p_i = \pi_i / B$. Every runner loses the same share of its implied probability.
  • Additive: take the same amount off each runner, $p_i = \pi_i - (B - 1)/N$. Long shots can go negative, so in practice they are clipped.
  • Power: find the exponent $k > 1$ for which $\sum_i \pi_i^{k} = 1$, and set $p_i = \pi_i^{k}$. Raising a small number to a power above 1 shrinks it proportionally more than a big one, so this method takes relatively more margin off the long shots.
  • Shin: a model, named after the economist who proposed it, in which some of the money comes from bettors with inside information and the book protects itself by shading every price. Solving it also takes relatively more off the long shots.

The pattern that the power and Shin methods assume, long shots being priced proportionally worse than favourites, is often described as the favourite–longshot bias. Whether, and how strongly, any F1 market shows it is exactly the kind of thing our data cannot tell us. So instead we build a market where we know the truth, and see which method recovers it.

A hypothetical book for the 2026 United States Grand Prix

code/01_odds_math.py takes the three Chapter 26 walk-forward models for the 2026 United States GP (round 18): the grid-slot baseline, the logit and the GBM. Each was trained on 2006–2025 only. It averages them into a "consensus" probability, and then betting.hypothetical_book() turns the consensus into prices with an 18% margin loaded by the power method. Prices are rounded down to a typical price ladder, because a book never rounds in the bettor's favour. The resulting prices are illustrative, built by a rule we state, and are not anyone's real odds.

piv["consensus"] = piv[["grid", "logit", "gbm"]].mean(axis=1)
piv["consensus"] /= piv.consensus.sum()
odds = pd.Series(betting.hypothetical_book(piv.consensus.to_numpy(), MARGIN, "power"), index=piv.index)
for m in betting.METHODS:                     # multiplicative, additive, power, shin
    tab[m] = betting.remove_overround(odds, m)
2. HYPOTHETICAL book, 2026 United States GP (R18), built from the 3-model consensus with a 18% margin (power method), prices rounded down to a ladder
  booksum after rounding: 118.7%  (overround 18.7%)

3. Fair probabilities by removal method (top 12 by implied probability)
              grid  finish   odds  implied  multiplicative  additive  power   shin  consensus    gbm
abbreviation
ANT            1.0     1.0    1.9    52.63           44.36     47.73  48.48  47.75      48.57  52.32
VER            2.0     3.0    2.9    34.48           29.06     31.00  30.09  30.91      30.09  30.10
HAD            3.0     6.0    9.6    10.42            8.78      8.82   7.80   8.61       7.82   5.76
LEC            4.0     2.0   11.5     8.70            7.33      7.23   6.36   7.03       6.30   7.64
RUS            6.0     8.0   30.0     3.33            2.81      2.29   2.16   2.17       2.16   1.33
HAM            5.0     4.0   32.0     3.12            2.63      2.10   2.01   1.99       2.01   1.28
PIA            7.0     7.0   75.0     1.33            1.12      0.45   0.77   0.55       0.73   0.68
NOR            8.0     5.0   80.0     1.25            1.05      0.37   0.71   0.49       0.68   0.55
GAS           10.0    10.0  130.0     0.77            0.65      0.00   0.41   0.21       0.41   0.08
...
  long shots (consensus < 5%, n = 18): summed fair prob  multiplicative 10.47%, additive 5.21%, power 7.27%, shin 5.70%, consensus truth 7.22%
  multiplicative: total |fair - consensus| = 10.49 points
        additive: total |fair - consensus| = 6.13 points
           power: total |fair - consensus| = 0.26 points
            shin: total |fair - consensus| = 4.70 points

Grouped bars of implied and fair win probability for the ten shortest-priced drivers at the 2026 United States GP, by removal method, on a log scale

📊 Figure (described): For the hypothetical 2026 US GP book, each driver has five bars: the implied probability (hatched grey) and the fair probability by the multiplicative, additive, power and Shin methods. For Antonelli and Verstappen at the front, all four methods land within about four points of each other. For the long shots on the right, the log scale shows them diverging by factors of two or more, and the additive method drives Gasly and Lindblad to about zero. The takeaway: the removal method is a modelling choice that matters most exactly where a "value" bet usually hides, among the long shots.

Because we loaded the margin by the power method, the power method recovers the truth almost exactly (0.26 points of total error). That is circular by design and proves nothing about real books. The useful lesson is the size of the disagreement. The 18 long shots' fair probabilities sum to anything from 5.2% to 10.5% depending on the method. If the true figure is 7.2% and you use the multiplicative method, you will think every long shot is worth about 45% more than it is. That alone is enough to manufacture "value" on half the grid.

⚠️ Common pitfall: comparing your model with the fair price instead of the real one. Removing the margin tells you what the market believes. It does not tell you what you can win. You are paid at the offered price, margin included. A model probability above the fair probability but below the implied probability is a losing bet.

The edge report makes that concrete. Here is the GBM's probability for each driver against the hypothetical prices, with a rule we will use all chapter: bet only if EV exceeds +5%, stake a quarter of the Kelly fraction (§38.4), and never more than 5% of the bankroll on one bet.

4. Edge report: GBM probability vs the HYPOTHETICAL prices (bet if EV > +5%, quarter Kelly, cap 5%)
              grid   pos   odds  implied   fair  p_model    ev  kelly_full  stake    bet
abbreviation
ANT            1.0   1.0    1.9    52.63  48.48    52.32  -0.6         0.0    0.0  False
VER            2.0   3.0    2.9    34.48  30.09    30.10 -12.7         0.0    0.0  False
LEC            4.0   2.0   11.5     8.70   6.36     7.64 -12.2         0.0    0.0  False
HAD            3.0   6.0    9.6    10.42   7.80     5.76 -44.7         0.0    0.0  False
...

Look at Antonelli. The GBM gave him 52.3%. The fair probability from this book is 48.5%, so the GBM is nearly four points more bullish than the market. And yet the bet loses 0.6% per unit, because the price of 1.90 implies 52.6%. Leclerc tells the same story: 7.6% against a fair 6.4%, a fifth more than the market thinks, and still −12.2% EV. The model disagreed with the market and still had no bet. With an 18% margin, the GBM finds nothing worth backing in this race. Antonelli won.

Calibration: is the model's 6.9% really 6.9%?

Everything above assumes the model's probabilities are trustworthy. That is a claim we can test, because we do have 13 seasons of walk-forward forecasts and results. A model is calibrated if, among all the drivers it gives 10%, about 10% win.

📐 Definition: Reliability (calibration) table. Group forecasts into probability bins. For each bin, compare the mean forecast with the observed win rate, with a Wilson interval on the observed rate.

5. Reliability of walk-forward win probabilities, 2014-2026 (273 GPs)
model            bin    n   pred    obs     lo     hi  exp_wins  wins
  gbm (-0.001, 0.01] 4195 0.0010 0.0026 0.0015 0.0047    4.3344    11
  gbm   (0.01, 0.03]  388 0.0184 0.0232 0.0123 0.0435    7.1260     9
  gbm    (0.03, 0.1]  325 0.0582 0.0646 0.0426 0.0968   18.9052    21
  gbm     (0.1, 0.2]  200 0.1455 0.1250 0.0861 0.1780   29.0995    25
  gbm    (0.2, 0.35]  141 0.2769 0.2837 0.2158 0.3631   39.0492    40
  gbm    (0.35, 0.5]  127 0.4255 0.4173 0.3352 0.5043   54.0341    53
  gbm    (0.5, 0.65]  123 0.5682 0.5203 0.4328 0.6067   69.8907    64
  gbm    (0.65, 0.8]   55 0.7176 0.7273 0.5977 0.8272   39.4663    40
  gbm     (0.8, 1.0]   13 0.8534 0.7692 0.4974 0.9182   11.0945    10
  ...
  gbm: forecasts < 10%: n 4908, expected wins 30.4, actual 41;  race favourite: mean p 0.572, won 150/273
  grid: forecasts < 10%: n 5021, expected wins 66.9, actual 59;  race favourite: mean p 0.502, won 150/273

Reliability diagram on log axes for the GBM and grid-slot baseline, 2014–2026, with Wilson intervals

📊 Figure (described): Observed win rate against forecast probability, both on log axes, for the GBM (blue circles) and the grid-slot baseline (orange squares), with 95% Wilson intervals. Both track the diagonal from about 2% to 70%. The GBM's lowest bin sits above the diagonal: drivers it rated below 1% won 11 times when it expected 4.3. The takeaway: the models are good enough to reason with, and their worst errors are at the extremes, where long-shot "value" lives.

The GBM is close to calibrated across the middle of the range. Its two systematic errors are at the ends. First, it is too sure about outsiders. Drivers it rated below 10% won 41 races where it expected 30.4, and drivers it rated below 1% won 11 where it expected 4.3. Second, its favourites lean the other way. Drivers in the 0.5–0.65 bin won 52.0% against a forecast 56.8%, and the 13 forecasts above 0.8 produced 10 wins where it expected 11.1. These are small samples, and the intervals overlap the diagonal, but the direction is consistent: the GBM is a little over-confident at both ends, too sure that outsiders lose and too sure that favourites win.

For a bettor that direction matters. A model whose tiny probabilities are too tiny will tell you every outsider is overpriced. If you used it to lay outsiders (to bet against them, on an exchange), you would be wrong in exactly the races that pay the most: the 2024 São Paulo GP, where it said 6.9%, and the 2026 Italian GP, where Chapter 26 found it gave Antonelli 2.9% from 19th on the grid.

🔍 Why this works: calibration is the whole edge. An edge is $p \cdot o - 1$. If your $p$ is 10% too high on the bets you select, your real EV is 10% lower than you think. Your edge cannot be more accurate than your calibration on the subset of bets you actually make, and that subset is biased: you only bet when your model disagrees with the price, which is exactly when your model is most likely to be wrong. Reliability over all forecasts is necessary, but not sufficient.

🔄 Check your understanding 1. A model says 12%. The price is 7.50 and the fair probability by the multiplicative method is 11%. Is there a bet? 2. Why does the choice of margin-removal method matter more for a 40/1 shot than for the favourite?

Answer 1. Implied probability is 1/7.50 = 13.3%. EV = 0.12 × 7.50 − 1 = −0.10. No bet: being above the fair probability is not enough. 2. The methods differ in how much of the margin they assign to each runner. In proportional terms the favourite's share hardly changes between methods, but a long shot's fair probability can halve or double (fig. 38.1), so its apparent EV swings from strongly negative to strongly positive.


38.4 Expected Value, Kelly, and Why Fractional Kelly

Suppose you do have an edge. How much should you bet? "As much as possible" goes broke. "A fixed amount" ignores how big the edge is. The answer that maximises the long-run growth rate of a bankroll was published by J. L. Kelly Jr. in the Bell System Technical Journal in 1956, in a paper about the information rate of a communication channel. It has been the bettor's standard ever since.

The derivation

Stake a fraction $f$ of your bankroll on a binary bet at decimal odds $o$ with win probability $p$. Write $b = o - 1$ for the net odds. If you win, the bankroll is multiplied by $1 + fb$; if you lose, by $1 - f$. Over many bets, what compounds is the logarithm of the bankroll, so the quantity to maximise is the expected log growth per bet:

$$g(f) = p \ln(1 + f b) + (1 - p) \ln(1 - f)$$

Set the derivative to zero:

$$\frac{dg}{df} = \frac{p\,b}{1 + f b} - \frac{1 - p}{1 - f} = 0 \quad\Longrightarrow\quad f^{*} = \frac{p\,b - (1 - p)}{b} = \frac{p\,o - 1}{o - 1}$$

In words: the Kelly stake is your edge divided by the net odds. Bet more when the edge is bigger and less when the payout is longer. The numerator is the EV. If the EV is zero or negative, $f^* \le 0$ and you do not bet.

Worked number. Take a hypothetical bet: you are sure the true probability is 0.30, and the price is 4.0. EV $= 0.30 \times 4.0 - 1 = +0.20$, a 20% edge, which is enormous. Kelly says $f^* = 0.20/3 = 0.0667$: stake 6.7% of the bankroll. Even with a 20% edge, Kelly bets less than a fifteenth of your money.

code/02_kelly.py evaluates $g(f)$ around that optimum:

1. One hypothetical bet: p = 0.30, decimal odds 4.0
  EV per unit = +0.200; full Kelly f* = 0.0667
  quarter Kelly f = 0.0167: expected log growth +0.00287 per bet (45% of full); per-bet SD of log return 0.0301
     half Kelly f = 0.0333: expected log growth +0.00486 per bet (76% of full); per-bet SD of log return 0.0592
     full Kelly f = 0.0667: expected log growth +0.00640 per bet (100% of full); per-bet SD of log return 0.1152
   double Kelly f = 0.1333: expected log growth +0.00077 per bet (12% of full); per-bet SD of log return 0.2198
  growth returns to zero at f = 0.138 (2.07 x f*)
  if the true p is 0.25 (EV +0.00), staking f* = 0.0667 gives -0.00616 per bet

Expected log growth per bet against stake size for a hypothetical bet at 4.0, with true p of 0.30 and 0.25

📊 Figure (described): Expected log growth (×1000) against the stake as a share of bankroll. For a true p of 0.30 (solid blue), the curve peaks at full Kelly (6.7%). Half Kelly keeps 76% of the peak growth, and double Kelly keeps only 12%. If the true p is 0.25 (dashed red, zero EV), every stake loses, and full Kelly loses as fast as it would have gained. The takeaway: the growth curve is flat near the top and falls steeply beyond it, so under-betting is cheap and over-betting is expensive.

Three facts in that output shape real practice.

  1. The curve is asymmetric. Half Kelly gives up only a quarter of the growth while halving the swings (the SD of the log return falls from 0.115 to 0.059). Double Kelly keeps almost none of the growth for twice the swings. Beyond $2f^*$, growth turns negative even though every single bet is +20% EV. For small edges, the fraction $c$ of full Kelly keeps about $2c - c^2$ of the maximum growth: $c = 0.5$ gives 0.75.
  2. You never know $p$. The second curve is the same bet when the true probability is 0.25 and your 0.30 is an overestimate. Staking your "Kelly" 6.7% now loses 0.0062 per bet: a mirror image of what you thought you were gaining.
  3. So bettors use fractional Kelly. Staking a quarter or a half of $f^*$ is insurance against your own model error. It costs little if you are right and saves you if you are wrong.

🧪 Illustrative model: the next simulation uses real model output for the probabilities, but the prices and the bettor's errors are assumptions chosen to make the point, not anyone's real odds or record.

Two worlds, 273 races

To see this over a realistic horizon, the second half of 02_kelly.py replays one bet per Grand Prix, 2014–2026, on the GBM's favourite. The "true" win probability of each bet is the GBM's own walk-forward probability for that driver, which averaged 0.572 and ranged from 0.299 to 0.909. Then the prices are set by rule:

  • World A, a real edge: price $= 1.05 / p_{\text{true}}$, so every bet is +5% EV, and the bettor knows $p_{\text{true}}$ exactly.
  • World B, an imagined edge: price $= 0.95 / p_{\text{true}}$, so every bet is −5% EV, but the bettor believes $p = 1.12 \times p_{\text{true}}$ and therefore sees about +6% EV.

There are 1,000 paths of the 273 bets in each world (seed 42), at full, half and quarter Kelly.

                                    world  kelly  mean_stake  median_final   p10   p90  p_loss  p_halved  p_dd50  median_maxdd
                         A: real +5% edge   1.00       0.071         1.634 0.459 5.516   0.318     0.114   0.739         0.594
                         A: real +5% edge   0.50       0.035         1.444 0.774 2.626   0.230     0.017   0.123         0.338
                         A: real +5% edge   0.25       0.018         1.239 0.908 1.666   0.188     0.000   0.001         0.179
B: imagined edge (true -5%, belief x1.12)   1.00       0.129         0.036 0.003 0.333   0.978     0.934   1.000         0.981
B: imagined edge (true -5%, belief x1.12)   0.50       0.065         0.296 0.098 0.820   0.940     0.729   0.940         0.799
B: imagined edge (true -5%, belief x1.12)   0.25       0.032         0.599 0.349 0.971   0.911     0.333   0.540         0.516

Two panels of simulated bankroll paths over 273 bets: median and 10–90% band for full, half and quarter Kelly, in a world with a real edge and a world with an imagined one

📊 Figure (described): Left, World A (a real +5% edge): all three Kelly fractions grow at the median, but full Kelly's band runs from 0.46 to 5.5 times the starting bankroll, and 74% of full-Kelly paths suffer a drawdown of at least 50% along the way. Quarter Kelly grows more slowly (median 1.24) but almost never halves. Right, World B (an imagined edge): every fraction loses, and full Kelly turns the median bankroll into 3.6% of its start. The takeaway: Kelly sizing multiplies whatever your edge really is, including when it is negative.

Read World A first. Even with a genuine +5% edge on every one of 273 bets, full Kelly lost money over the whole thirteen seasons in 31.8% of paths. Nearly three quarters of the paths (73.9%) halved from a peak at some point. The median full-Kelly bettor ends up 63% ahead, but the median journey includes a 59% drawdown. Quarter Kelly ends a more modest 24% ahead with a median worst drawdown of 18%, and it still loses over the period in 18.8% of paths. That is what a real 5% edge feels like at one bet a race: a long, noisy grind in which you can be right and still lose for years.

World B is the one that should worry you, because it is the more likely world for a bettor with a model and no record. The edge is not small; it is negative, and the bettor's overconfidence makes it look positive. Full Kelly is destroyed: 93.4% of paths lose more than half the bankroll. Quarter Kelly still loses in 91.1% of paths, but its median bettor ends with 60% of the bankroll, not 4%. Fractional Kelly does not rescue a bad model. It buys you the time to find out that the model is bad.

📋 Try it: Predict the race. Before you run it, predict: in World A with quarter Kelly, what share of paths end below the starting bankroll if you double the edge to +10% (price $= 1.10 / p$)? Then edit EDGE_A in code/02_kelly.py and run it.

Reveal (what to look for) Doubling the edge roughly quadruples the expected log growth at a fixed fraction, while the noise stays about the same, so the share of losing paths falls sharply. The exact value is your run's output. The lesson for the next section: the edges a public model can plausibly find are nearer +5% than +10%, if they exist at all.

🔄 Check your understanding 1. Compute the Kelly fraction for $p = 0.55$ at 2.00. 2. A friend says, "I have a 30% edge on this long shot at 21.0, so I'm putting a quarter of my bankroll on it." What does Kelly say?

Answer 1. $f^* = (0.55 \times 2 - 1)/(2 - 1) = 0.10$: stake 10%. 2. A 30% edge at 21.0 means $p \cdot 21 - 1 = 0.30$, so $p = 0.0619$. Then $f^* = 0.30/20 = 0.015$: 1.5% of the bankroll at full Kelly. A quarter of the bankroll is about 17 times full Kelly, far beyond the $2f^*$ point where growth turns negative even if the 30% edge is real.


38.5 Edge Hypothesis 1: "The Market Overreacts to the Last Race"

The first claimed edge is the most popular one: bettors, and therefore prices, overweight the most recent race. A driver who won last Sunday at a circuit that suited his car gets backed down to a short price at a circuit that will not. Fade the hype, the theory goes, and collect.

We cannot see whether prices overreact. We can test the premise underneath: how much does the last race actually tell you about the next one? If the last race is genuinely more informative than older races, a price that leans on it is not overreacting. If it is not, the hypothesis has room to work.

Analysis 1: how much is each past race worth?

code/03_recency.py regresses a driver's finishing position (finishers only, 2014–2026) on his finishing positions in each of the previous five Grands Prix. It also requires that the "last race" was the previous round on the calendar, so a missed race does not masquerade as recent form. Standard errors are clustered by race. We fit two versions: one with no qualifying information (a market before Saturday), and one that adds the grid slot and the qualifying gap to pole (a market after qualifying).

m = smf.ols("pos ~ grid + quali_gap_pct + lag1 + lag2 + lag3 + lag4 + lag5", data=d).fit(
        cov_type="cluster", cov_kwds={"groups": d.race_seq})
t = m.t_test("lag1 - 0.25*lag2 - 0.25*lag3 - 0.25*lag4 - 0.25*lag5 = 0")   # is the last race special?
Sample: finishers 2014-2026 with five previous GP results, last GP = the previous round on the calendar: n = 4460 driver-races, 273 GPs

1. before qualifying: R^2 0.484, n 4395
            Coef.  Std.Err.  [0.025  0.975]
lag1       0.2165    0.0125  0.1919  0.2411
lag2       0.1508    0.0134  0.1245  0.1771
lag3       0.1493    0.0135  0.1230  0.1757
lag4       0.1535    0.0137  0.1267  0.1803
lag5       0.1485    0.0133  0.1223  0.1746
  lag-1 weight / mean of lags 2-5 = 1.44
  test lag1 = mean(lag2..5): diff +0.0660, 95% CI [+0.0351, +0.0968], p = 2.79e-05

1. after qualifying: R^2 0.622, n 4395
grid           0.3932    0.0219  0.3502  0.4361
quali_gap_pct  0.3064    0.0871  0.1356  0.4771
lag1           0.1119    0.0110  0.0904  0.1335
lag2           0.0756    0.0120  0.0520  0.0991
...
  lag-1 weight / mean of lags 2-5 = 1.54
  test lag1 = mean(lag2..5): diff +0.0393, 95% CI [+0.0143, +0.0643], p = 0.00208
      form5 only: R^2 0.4830
       lag1 only: R^2 0.2936
   lags 1-5 free: R^2 0.4856

Coefficients on the finishing positions of the previous five GPs, before and after qualifying, with 95% CIs

📊 Figure (described): The weight on each of the previous five races' finishing positions, from the two regressions. Before qualifying (blue), the last race carries 0.22 places per place, against about 0.15 for each of the four before it. After qualifying (orange), every weight roughly halves, and the last race is still about one and a half times the others. The takeaway: recent form genuinely matters more, but by a modest factor, and qualifying absorbs most of what form was telling you.

The data say three things.

  1. The last race really is more informative. It deserves about 1.4–1.5 times the weight of each of the four races before it, and the difference is well outside noise (before qualifying: +0.066 places per place, 95% CI +0.035 to +0.097). Some of this is real change, such as upgrades, setup learning and confidence, which older results cannot reflect. A price that leans on the last race is partly right to.
  2. But not by much. An equal-weight five-race average explains almost exactly as much as the five free weights ($R^2$ 0.483 against 0.486). The last race alone explains far less (0.294). A forecaster who uses only last Sunday is throwing information away; one who uses a five-race average with a little extra weight on the latest is nearly optimal.
  3. Qualifying dominates. Once the grid is known, all five past races together carry about half their pre-qualifying weight. For markets that are still open after qualifying, recency arguments are mostly about information that Saturday has already replaced.

Analysis 2: is a "different kind of circuit" less informative?

The sharper form of the hypothesis is about unrepresentative circuits: a win at Monza says little about Monaco. Using the circuit types from Chapter 24 (high-speed, medium-speed and low-speed), we let the last-race weight differ depending on whether the last race was the same type of circuit as this one.

2. Circuit type of the last race (n 3746; same type 40.3% of rows)
                 Coef.  Std.Err.  [0.025  0.975]   P>|z|
lag1            0.1188    0.0137  0.0918  0.1457  0.0000
lag1:same_type -0.0272    0.0190 -0.0644  0.0101  0.1528
same_type       0.2712    0.1872 -0.0958  0.6381  0.1475

If an unrepresentative circuit made the last race less useful, the interaction would be positive: more weight when the type matches. It comes out slightly negative (−0.027, 95% CI −0.064 to +0.010), indistinguishable from zero. With three broad circuit types, the data find no sign that a "different kind of track" weakens the last race's signal. The intuition is plausible, and a finer classification might find it, but this test does not.

Analysis 3: does a model that already sees form misprice the last race?

The most betting-relevant test is a calibration check. The GBM already uses a five-race form average and the qualifying data. If last-race information were mispriced by the model, its forecasts would be off for drivers coming off a win, a big gain or a retirement.

3. GBM walk-forward 2014-2026: expected vs actual, by what happened last GP
                     group    n  exp_wins  wins wins_band  exp_podiums  podiums pod_band
               won last GP  272      93.5   102    81-106        180.4      188  168-193
gained >= 5 places last GP  818      22.7    26     16-30         72.8       80    62-84
               DNF last GP  878      20.1    16     13-27         73.3       66    62-85
             everyone else 3526     141.3   137   124-161        495.8      493  466-525

The "band" columns are 95% ranges for the number of wins (or podiums) that the GBM's own probabilities would produce by chance (a Poisson-binomial simulation, 4,000 draws). Every actual count falls inside its band. If anything, last-race winners won more than the model expected (102 against 93.5), which is the opposite of a "faded hype" edge: a model that already shrinks recency appears to slightly under-rate the hot hand. The difference is within noise.

Verdict on hypothesis 1. The premise is half true. The last race deserves somewhat more weight than older races, about 1.5 times, so a market that leans on it is not automatically overreacting. A disciplined five-race view with a little extra weight on the latest race is what the data support. Whether real prices lean more than that is a question only price data can answer. If you have a source of historical odds, the test is now precise: regress the market's implied probabilities on the same lags and compare its weights with these.

📺 On the broadcast: When the commentators say a driver "has the momentum" after a win, the data's reply is "a little." Last Sunday's finishing position is worth about 0.22 places per place before qualifying and 0.11 after it. That is real, but it is roughly one and a half times what the race three weeks ago is worth, not ten times.

🔄 Check your understanding 1. Why does the last race's weight roughly halve once grid position is in the regression? 2. The interaction for "same circuit type" was −0.027 with a CI spanning zero. What can you conclude about the "unrepresentative circuit" edge?

Answer 1. Grid position already contains most of what recent form predicts: a driver in form tends to qualify well. Once the grid is known, past results add only what qualifying missed (race pace, tyre management, starts, reliability). 2. Only that this test, with three coarse circuit types, does not detect it. It does not prove the effect is absent. Absence of evidence with an interval this wide (−0.064 to +0.010) still rules out a large positive effect.


38.6 Edge Hypothesis 2: Weather

The second claimed edge is that markets are slow to absorb weather. A forecast of rain is said to make a race far less predictable than a dry one, and a price set on dry form will undervalue the drivers who gain in the wet.

There are two separate claims inside that. One is about predictability: does rain scramble the order? The other is about information: can you know it will rain before the price does? Our data speak to both, but with a severe sample-size limit.

Does rain scramble the order?

code/04_weather_sc.py labels each 2023–2026 Grand Prix as wet if any car ran intermediates or full wets (11 of 91 races, matching the book's weather tables), and as an SC race if race control deployed at least one full safety car (44 of 91). It then scores the races with the Chapter 26 GBM's walk-forward probabilities.

         group  n pole_won  pole_p  pole_lo  pole_hi fav_won  fav_p  fav_lo  fav_hi  median_p_winner  mean_logloss  median_rho
           dry 80    52/80   0.650    0.541    0.745   52/80  0.650   0.541   0.745            0.500         1.052       0.823
           wet 11     5/11   0.455    0.213    0.720    5/11  0.455   0.213   0.720            0.273         1.289       0.709
         no SC 47    28/47   0.596    0.453    0.724   27/47  0.574   0.433   0.705            0.458         1.125       0.853
       >= 1 SC 44    29/44   0.659    0.511    0.781   30/44  0.682   0.534   0.800            0.543         1.034       0.721
  mean log loss wet - dry: +0.236 [-0.272, +0.780]
  mean log loss >= 1 SC - no SC: -0.091 [-0.445, +0.288]

Bar charts of the share of GPs won by the pole-sitter and by the GBM favourite, in dry vs wet races and in races with and without a full safety car, 2023–2026

📊 Figure (described): Two panels, with 95% Wilson intervals. Pole-sitters and GBM favourites won 65% of the 80 dry races and 45% of the 11 wet ones, but the wet interval runs from 21% to 72%. In races with a full safety car, the favourite won slightly more often (68%) than in races without (57%). The takeaway: wet races may be less predictable, but 11 races cannot pin down by how much. A full safety car on its own did not stop favourites winning.

Everything points the way the hypothesis says. In the wet, the pole-sitter won five of eleven, the winner's median pre-race probability was 27% rather than 50%, the grid-to-finish rank correlation fell from 0.82 to 0.71, and the log loss rose by 0.24. But the 95% interval on that log-loss difference runs from −0.27 to +0.78. With eleven wet races in four seasons, we cannot distinguish "rain scrambles the order a lot" from "rain makes no difference." The direction is plausible; the size is unknown.

The eleven wet races themselves show why:

 year  round                    gp winner  winner_grid  p_winner    sc   rho
 2023      6     Monaco Grand Prix    VER          1.0     0.609 False 0.893
 2023     13      Dutch Grand Prix    VER          1.0     0.720  True 0.518
 2024      9   Canadian Grand Prix    VER          2.0     0.502  True 0.850
 2024     12    British Grand Prix    HAM          2.0     0.161 False 0.928
 2024     21  São Paulo Grand Prix    VER         17.0     0.069  True 0.361
 2025      1 Australian Grand Prix    NOR          1.0     0.613  True 0.560
 2025     12    British Grand Prix    NOR          3.0     0.078  True 0.354
 2025     13    Belgian Grand Prix    PIA          2.0     0.187 False 0.717
 2026      5   Canadian Grand Prix    ANT          2.0     0.173 False 0.785
 2026     16    Bahrain Grand Prix    VER          1.0     0.677  True 0.709
 2026     20  São Paulo Grand Prix    NOR          1.0     0.273 False 0.376

Five of the eleven were won from the front row by a driver the model already rated at least 50%. Two were long shots under 10%: São Paulo 2024 (this chapter's hook) and the 2025 British GP. One famous wet race can dominate how people remember the weather edge. Eleven races cannot tell you much more than "sometimes."

Can you know before the market does?

The second claim is about information, and there the book's data are more useful. Chapter 36 measured how well the weekend predicts the race. In 2023–2026, if an earlier session that weekend had rain, the race had rain 35.1% of the time (13 of 37), against 14.8% (8 of 54) otherwise. A wet qualifying session was followed by a wet race 50% of the time (9 of 18), against 16.4% (12 of 73). And laps run in the wet started an SC, VSC or red-flag incident at 2.38 times the dry rate (95% CI 1.30–4.34).

None of that is secret. Any market that reprices on the weekend's weather already has it. The theoretical edge is not in knowing that rain matters. It is in being faster, or in pricing the second-order effects (more neutralisations, more retirements, more strategy variance) more carefully than a quick adjustment would. Those are exactly the effects the Chapter 36 weather scenario generator and the Chapter 27 Monte Carlo engine can simulate. The honest verdict is that the data support the mechanism and cannot yet size the edge.

⚠️ Common pitfall: the memorable-race fallacy. "Rain is where the value is" usually means "I remember São Paulo 2024." Count the wet races you don't remember: in five of the eleven above, the pole-sitter won, and so did the model's favourite. A betting rule built on the races you remember has been tested only on its winners.


38.7 Edge Hypothesis 4: Safety Cars and the "Safety Car: Yes/No" Prop

Safety cars matter to betting in two ways. They change who wins, and they are themselves a market.

Do safety cars scramble the winner?

The previous table already answered the first question, and the answer is surprising: in 2023–2026, the favourite won more often in races with at least one full safety car (30 of 44) than without (27 of 47). The log loss was slightly lower in SC races (difference −0.09, CI −0.45 to +0.29). A full safety car compresses the field, but the leader usually keeps the lead at the restart.

Where neutralisations do matter is in the tail. Of the ten 2023–2026 races won by a driver the GBM gave less than 10%, eight had at least one SC, VSC or red flag, and six had a full safety car:

  Winners the GBM gave < 10%: 10 races; of them wet 2, >=1 SC 6, any neutralisation 8
 year  round                       gp winner  winner_grid  p_winner   wet    sc  neutralised
 2023      4    Azerbaijan Grand Prix    PER          3.0     0.083 False  True         True
 2024      6         Miami Grand Prix    NOR          5.0     0.049 False  True         True
 2024     11      Austrian Grand Prix    RUS          3.0     0.071 False False         True
 2024     14       Belgian Grand Prix    HAM          3.0     0.055 False False        False
 2024     16       Italian Grand Prix    LEC          4.0     0.058 False False        False
 2024     19 United States Grand Prix    LEC          4.0     0.027 False  True         True
 2024     21     São Paulo Grand Prix    VER         17.0     0.069  True  True         True
 2025      6         Miami Grand Prix    PIA          4.0     0.027 False False         True
 2025     12       British Grand Prix    NOR          3.0     0.078  True  True         True
 2026     13       Italian Grand Prix    ANT         19.0     0.029 False  True         True

But 66 of all 91 races had a neutralisation, so "eight of ten upsets were neutralised" is only somewhat above the base rate. Chapter 26 made the same comparison (8 of 10 against 58 of 81 for the rest) and found the intervals overlap. The safety car is a plausible ingredient of upsets, which is why a Monte Carlo engine that samples SC timing (Chapter 27) spreads probability more widely than a regression does. It is not a filter that turns long shots into value.

Pricing the prop

The "will there be a safety car?" market looks tailor-made for analytics. Chapter 14 measured the base rates: 48.4% of 2023–2026 races had at least one full safety car, and 72.5% had an SC, VSC or red flag. Surely circuits differ. Jeddah and Losail had a safety car in all three of their races; Hungaroring had none in four.

The trouble is that four races per circuit is almost no data. A raw rate of 3/3 has a 95% Wilson interval of 44% to 100%. The standard fix is shrinkage: estimate how much circuits really vary, and pull each circuit's raw rate towards the pooled rate in proportion to how little data it has.

📐 Definition: Beta-binomial (empirical-Bayes) shrinkage. Fit a Beta($a$, $b$) distribution to the circuit rates by maximising the likelihood of all circuits' counts $k_c$ of $n_c$. Each circuit's shrunk rate is $$\hat p_c = \frac{k_c + a}{n_c + a + b}.$$ $a + b$ is the prior's weight, measured in races: how many races of evidence the pooled rate is worth.

In words: a circuit's estimate is its own record plus $a + b$ imaginary races at the pooled rate. If the data show circuits differ a lot, $a + b$ is small and the raw rates stand. If they do not, $a + b$ is large and every circuit is pulled to the pool.

betting.shrink_rates() implements it. Applied to all 2023–2026 races and the "at least one full SC" question, the fitted prior weight is about 8,000 races: the likelihood is maximised by a prior that says circuits do not differ at all. Every circuit's shrunk rate is the pooled 48.4%.

Per-circuit share of 2023–2026 races with at least one full safety car: raw rate with Wilson interval, and the shrunk estimate

📊 Figure (described): One row per circuit, with the raw rate (orange dot), its 95% Wilson interval (grey bar) and the shrunk rate (blue diamond), against the pooled 48.4% (dashed). Raw rates run from 0% (Hungaroring, Yas Marina) to 100% (Jeddah, Losail), but every interval crosses the pooled line, and the fitted shrinkage puts every circuit on it. The takeaway: with four races per circuit, 2023–2026 race control cannot tell circuits' full-SC rates apart.

That is a statement about the data's resolving power, not about the circuits. Street circuits with walls close to the track may well have more safety cars. But four seasons cannot show it. The out-of-sample test makes the cost of ignoring this concrete. Using 2023–2024 to forecast the 2025–2026 races:

2a. 'At least one full safety car' by circuit: 2023-24 rates as forecasts for 2025-26 races
  pooled 2023-24 rate 0.457 (21/46); prior Beta(a=5.02, b=5.97), weight a+b = 11.0 races
           pooled: Brier 0.2529  (n 45 races 2025-26, SC in 23)
      raw circuit: Brier 0.3445  (n 45 races 2025-26, SC in 23)
   shrunk circuit: Brier 0.2495  (n 45 races 2025-26, SC in 23)
         coin 0.5: Brier 0.2500  (n 45 races 2025-26, SC in 23)
  any SC/VSC/red: pooled 0.609, prior weight 6.3; Brier pooled 0.1869, raw 0.3179, shrunk 0.1910 (2025-26 rate 0.844)

The Brier score is the mean squared error of a probability forecast; lower is better, and a constant 0.5 scores 0.25. Raw circuit rates from two seasons scored 0.3445, far worse than a coin. Shrunk rates (0.2495) and the pooled rate (0.2529) were no better than a coin. For "any SC, VSC or red flag", the bigger problem was drift: the rate jumped from 60.9% in 2023–2024 to 84.4% in 2025–2026, driven by 2026, when 20 of 21 races were neutralised.

A longer history helps a little. The toolkit's lap-time detector finds neutralisations back to 2008, though it cannot tell an SC from a VSC (and the VSC only exists from 2015). Using 2008–2022 circuit rates to forecast 2023–2026 "any neutralisation":

2b. Detector 2008-2022: 294 races, any neutralisation 0.646; prior weight 22.0 races
  2023-26 races at circuits with history: 86 of 91
       detector pooled 2008-22: Brier 0.2068
          detector raw circuit: Brier 0.2004
       detector shrunk circuit: Brier 0.1993
   2023-26 pooled (in-sample!): Brier 0.2012
  Spearman(circuit detector share, 2023-26 outcome) = 0.245

With roughly a decade of history per circuit, the circuit rates do carry a weak signal (Spearman 0.245), and the shrunk history (0.1993) slightly beats even the in-sample 2023–2026 pooled rate (0.2012). The gain is about 0.002 in Brier score. As a pricing edge, that is tiny.

Verdict on hypothesis 4. Safety cars feed upsets, but they did not make favourites lose more often. For the prop market, circuit-level rates from a few seasons are worse than useless, shrunk long histories add a sliver, and the largest risk is not the circuit at all: it is the season-to-season drift in the overall rate. The 2026 rules produced far more neutralisations than 2023–2025, and any price built on the earlier years would have been wrong in the same direction every race.

📋 Try it: Analyze this session. Take the 2026 Singapore GP (round 17). Using betting.shrink_rates on 2023–2025 race control only, compute the shrunk "any SC/VSC/red" rate for marina_bay, and the fair decimal price it implies. Then check f1data.track_periods for the 2026 race. Did it have a neutralisation?

Reveal Your number depends on the prior weight your fit finds; expect it to sit close to the 2023–2025 pooled rate rather than Singapore's own 1/3 or 2/3, whichever you count. The 2026 race had VSC periods on laps 8–9 and 38–39 (Chapter 27, Case Study 1). One race is one outcome; the useful question is whether your method's prices would have been well calibrated over all 21 races of 2026, where the rate drifted up.

🔄 Check your understanding 1. Why did raw two-season circuit rates score worse than a coin flip? 2. What does a fitted prior weight of 8,000 races mean?

Answer 1. Two seasons give each circuit one or two races, so raw rates are 0, 0.5 or 1. Forecasts of 0 or 1 that turn out wrong cost the maximum squared error of 1, which wrecks the average. 2. The likelihood is maximised when circuits share one rate, so the fitted prior overwhelms each circuit's few races. The data are consistent with no real differences between circuits. That does not prove there are none; it means the differences are too small to see in 91 races.


38.8 Edge Hypothesis 3: Circuit Specialists

The third claimed edge is the most physical one, and the one this book is best equipped to believe. Cars have characters. A low-drag car with a strong power unit is quick at Monza and Baku; a car with strong low-speed downforce is quick at Monaco and Singapore (Chapter 10). If the market prices each race from overall form, it should misprice the car-circuit fit.

The test is persistence. A specialist effect is real only if it repeats: a team that beats its own season level at a circuit one year should do so again the next. Noise does not repeat.

code/05_specialists.py measures this in qualifying, where the car's pace is cleanest. For each team lineage (so that renamed teams stay one entry), it takes the team's best qualifying gap to pole at each circuit and subtracts that team's median gap for the season. The team circuit residual is negative when the team was better than usual there. Then it pairs each team-circuit residual with the same team at the same circuit the following year.

1. Team circuit residuals (best quali gap to pole minus season median), 2014-2026: 2734 team-circuit-years, 2174 consecutive-year pairs
                         all pairs: r = +0.115 [+0.067, +0.163], slope +0.109, n = 2174
                      stable rules: r = +0.115 [+0.061, +0.171], slope +0.106, n = 1624
   across a reset (2017/2022/2026): r = +0.113 [+0.029, +0.201], slope +0.123, n = 550
  SD of team residual: 0.676 % of lap
  stable pairs with |residual| >= 0.30 % in year Y: 855; same sign next year 55.7%; mean |Y+1| / |Y| = 0.59

2. Driver circuit residuals (teammate gap at circuit minus season median), pairs n = 3430: r = +0.040 [+0.007, +0.071], slope +0.037
  SD of driver residual: 0.717 % of lap

Two scatter plots: team circuit residual in year Y against year Y+1, and driver-vs-teammate circuit residual in year Y against year Y+1, 2014–2026

📊 Figure (described): Left: each point is a team at a circuit, with its residual one year against the next. The fitted line (slope about 0.11) is shallow but clearly positive, and pairs that cross a rule reset (orange) behave like stable-rules pairs (blue). Right: the same for a driver's gap to his teammate at a circuit, relative to his season median. The cloud is almost round (r = 0.04). The takeaway: car-circuit fit is real but small, and the driver "specialist" effect beyond the car is close to nothing.

The team effect is real and clearly distinguishable from zero: r = +0.115 (95% CI +0.067 to +0.163) over 2,174 pairs. But read the slope. A team that was 1% of a lap better than its season level at a circuit last year should be expected to be about 0.11% better this year. Nine tenths of last year's specialist performance was noise, or circumstances that did not recur: a wet session, a red flag at the wrong moment, a setup gamble. Among the 855 stable-rules cases with a residual of at least 0.30% of a lap, the next year's residual had the same sign only 55.7% of the time. That is barely better than a coin.

Two further details are interesting. The effect survives rule resets (r = +0.113 across 2017, 2022 and 2026), which suggests it reflects a team's design philosophy rather than one specific car. And the driver effect, the classic "he always goes well here," barely exists once you compare a driver with his own teammate: r = +0.040 (+0.007 to +0.071). A driver's circuit-specific gap to his teammate carries over at about 4%.

That matches what Chapter 26 found from the other direction. Its GBM had a circuit_form feature (the driver's past average finish at the circuit), and its permutation importance was −0.001 ± 0.006: removing it made no difference.

Verdict on hypothesis 3. Circuit fit exists for cars, at about a tenth of its apparent size, and hardly at all for drivers. A pricing model should include a heavily shrunk team-circuit term. A bettor who backs "specialists" at face value is mostly backing last year's noise.

⚠️ Common pitfall: the specialist list. Sort any table of driver-circuit results and you will find "specialists". Among driver-circuit combinations with at least four consecutive-year comparisons, this run's most extreme include Vettel at Mexico City (averaging −1.28% of a lap against his teammate in the first year of each pair, then −0.15% the year after) and Hülkenberg at Silverstone (−0.70%, then −0.11%). A few hold up: Albon at Interlagos went −0.82% then −1.53%. But with thousands of driver-circuit pairs, some will look extreme, and a few will even repeat, by chance alone. The follow-up year is the test, and on average it regresses about 96% of the way to zero.


38.9 A Backtest Against Hypothetical Markets

We have tested the premises behind four edges. Now we ask the question every bettor with a model eventually asks: could this model make money? Without real prices, the honest form of that question is narrower: against what kind of market, and with how much margin, would the model's advantage survive?

code/06_backtest.py builds a hypothetical market for every Grand Prix in 2014–2026 by taking a rival model's walk-forward probabilities and pricing them with a margin $m$ (power method). The bettor is the Chapter 26 GBM. The rule is the one from §38.3: back every runner whose EV at the hypothetical price exceeds +5%, one unit each, and never at prices longer than 51.0. That last rule needs a word. Without it, the backtest's result hangs on a handful of 300/1 winners: against the grid-baseline market, uncapped flat-stake ROI is +378%, from bets at an average decimal price of 145. That is a lottery, not evidence. Capping the price is an analyst's choice, and we state it. Intervals come from resampling whole races (2,000 bootstraps).

Three rival markets bracket the possibilities:

  • The grid-slot baseline: a crude market that knows the starting grid and nothing else.
  • The walk-forward logit: a good market. Its log loss on 2014–2026 (1.292) is slightly better than the GBM's (1.304).
  • The GBM itself: a control. A bettor whose beliefs equal the market's should never bet.
Part 1. 273 GPs 2014-2026; bettor = GBM; rule: back every runner with EV > +5% at the hypothetical price and price <= 51, 1 unit each
market  margin  n_bets  wins  mean_odds   roi     lo    hi  kelly_logg_race
  grid     0.0     559   153     15.166 0.506  0.118 0.973            0.030
  grid     0.1     471   140     12.137 0.459  0.099 0.905            0.023
  grid     0.2     405   127     10.292 0.496  0.084 1.004            0.022
  grid     0.3     357   113     10.686 0.390  0.003 0.866            0.017
 logit     0.0     425   143      8.879 0.076 -0.158 0.411            0.013
 logit     0.1     349   131      8.215 0.188 -0.128 0.588            0.014
 logit     0.2     285   105      8.711 0.096 -0.202 0.475            0.010
 logit     0.3     227    92      7.321 0.145 -0.157 0.540            0.008
   gbm     0.0       0     0        NaN 0.000  0.000 0.000            0.000
   gbm     0.1       0     0        NaN 0.000  0.000 0.000            0.000
   gbm     0.2       0     0        NaN 0.000  0.000 0.000            0.000
   gbm     0.3       0     0        NaN 0.000  0.000 0.000            0.000

  mean log loss of the winner: GBM 1.304 vs grid 1.439 (gap +0.135 nats)
  mean log loss of the winner: GBM 1.304 vs logit 1.292 (gap -0.013 nats)

(The full table, with 5% and 15% margins and the uncapped variant, is in code/06_output.txt and code/backtest_margins.csv.)

Flat-stake return per unit bet against hypothetical market margin, for the GBM betting against grid-baseline, logit and GBM markets, with race-bootstrap intervals

📊 Figure (described): Flat-stake ROI with 95% race-bootstrap intervals against the hypothetical margin, 0–30%. Against the grid-baseline market (blue), ROI stays around +40% to +50%, and its interval stays above zero even at a 30% margin, if only just. Against the logit market (orange), ROI point estimates sit between +8% and +23%, but every interval includes zero. Against itself (grey), the GBM places no bets. The takeaway: what decides whether a model makes money is how good the market is, not how good the model is.

Read the result in the right order.

  1. The control behaves. Against a market identical to itself, the GBM finds nothing at any margin. That rules out a bug that manufactures "edges."
  2. Against a crude market, a real information advantage survives a large margin. The GBM's log loss is 0.135 nats per race better than the grid baseline's. That is enough to produce +44% flat-stake ROI (CI +9% to +88%) at a 15% margin. Its bets came mostly from the front: 113 bets on grid-1 cars at an average of 1.87 (ROI +26%), 182 on cars from grid 2–3 at 5.61 (+22%), and 138 from grid 4–6 at 25.1 (+92%). The grid-slot market does not know who is in the car, and the GBM does.
  3. Against a good market, there is nothing to see. The GBM and the logit are about equally good (log loss 1.304 against 1.292), and they disagree mainly on long shots. The ROI estimates are positive, but every interval spans zero. That is what disagreement between two similar models looks like: noise that a margin slowly erodes.

Which world does a real F1 market resemble? Our data cannot say, and that is the point. Real markets combine prices from people who see everything our models see, plus news our data do not contain: penalties announced on Friday, upgrades, team statements, the weather radar. A grid-slot market is a straw man, used here only to show that the backtest can detect an edge when one exists. The realistic expectation is that a market is at least as good as our logit, and against that market our best model has no demonstrable edge.

🔍 Why this works: the log-loss gap is the edge. If the market's fair probabilities are $m_i$, your model's are $q_i$, and reality's are $p_i$, the expected log growth of a bettor who stakes in proportion to $q$ (the Kelly limit for a winner market without margin) is $\sum_i p_i \ln(q_i/m_i)$. Averaged over races, that is the market's log loss minus yours. The 0.135-nat gap against the grid baseline is a large edge. A −0.013-nat gap against the logit is a negative one; any profit in that backtest comes from the betting rule's selectivity and luck, not from the model being better.

The phantom edges of a biased model

The same tool exposes a quieter danger: a model with a systematic bias will find "value" everywhere its bias points. The validation runs in Chapter 27 showed that its Monte Carlo engine underrates pole-sitters. Over fifteen dry 2026 races it gave the grid-1 starter a mean win probability of 0.39, when the 2014–2025 history says 0.536 and those fifteen pole-sitters actually won 10 of 15.

Now trust the engine and price the races fairly (no margin at all) from the grid-slot baseline:

Part 2. Chapter 27 Monte Carlo, 2026 dry races R3-R21: 15 races, 329 cars
  grid-1 starter: mean MC p_win 0.390, mean grid-baseline p 0.536, won 10/15
  without the price cap: 119 bets, 5 winners, max fair price 10000
  bets the MC 'finds' (EV > +5% vs a fair grid-baseline price, price <= 51): 39 in 15 races; grid-1 cars among them 1
  claimed mean EV +1.139; realised flat ROI -0.734 (3 winners, mean odds 22.8)
  expected wins under the MC: 4.84; under the baseline: 2.96; actual 3
       n  wins  claimed_ev    roi
grid
1      1     1       0.172  0.869
2-3   12     2       0.293 -0.290
4-6   26     0       1.566 -1.000

Pre-race win probability of the grid-1 starter in fifteen 2026 races, Monte Carlo against grid-slot baseline, with each race's outcome

📊 Figure (described): For each of fifteen dry 2026 races, the grid-1 starter's pre-race win probability from the grid-slot baseline (orange, 53.6% every race) and from the Chapter 27 Monte Carlo (blue, from 22% to 64%), with WON or lost above. The Monte Carlo sits below the baseline in 14 of 15 races, yet 10 of the 15 won. The takeaway: an engine that spreads probability too evenly will keep "finding value" behind the pole-sitter.

The engine "found" 39 bets with a claimed average EV of +114%. Only one was on a pole-sitter; 38 were on the cars behind. Three won. The flat-stake result was −73%. The engine expected 4.84 winners from those bets, the baseline expected 2.96, and reality produced 3: the baseline was right. This is the bias Chapter 27 diagnosed, now seen in money. The engine uses one field-wide pace-uncertainty parameter, which is too wide for the fastest car, so it hands the front-runner's probability to the cars behind.

🔄 Check your understanding 1. Why is "the GBM against a market equal to itself" an essential row in the backtest? 2. The Monte Carlo's claimed EV was +114% and its realised ROI was −73%. Name the mechanism in one sentence.

Answer 1. It is a negative control. If the pipeline (pricing, margin, EV rule) produced bets when the bettor and market agree, the "edges" elsewhere could be artefacts of the code. Zero bets at every margin shows they are not. 2. The engine's probabilities were systematically too low for pole-sitters and too high for the cars behind them, so every disagreement with a fair price pointed the wrong way, and EV computed from a biased probability is biased by the same proportion.


38.10 The Other Markets: Head-to-Heads, Fastest Lap, Qualifying, Championships

Teammate head-to-heads

The H2H market looks like the analyst's natural home. Teammates share a car, so the comparison isolates exactly what Chapter 21 measured: the driver. code/07_markets.py builds every race H2H between teammates who both started, 2014–2026.

1. Teammate race H2Hs 2014-2026 (both started): n = 2738
  better grid slot finishes ahead: 65.5% (63.7-67.2), 1793/2738
  ... when both finish: 70.3% (68.2-72.3), 1368/1946
  H2Hs where exactly one retired: 25.1% (23.5-26.8), 688/2738; both retired: 3.8% (3.1-4.6), 104/2738
  ... in those one-DNF H2Hs the better qualifier still finished ahead: 53.3% (49.6-57.0), 367/688
  2014-2021: better qualifier ahead 63.4% (61.0-65.7), 1025/1617
  2022-2026: better qualifier ahead 68.5% (65.7-71.2), 768/1121

The headline is one number: a quarter of teammate H2Hs (25.1%) were decided by exactly one car retiring. In those races the better qualifier came out ahead only 53.3% of the time, close to a coin. When both cars finished, the better qualifier was ahead 70.3% of the time. The retirement rules of the market you bet on (whether both must finish, or whether a retirement counts as a loss) change the probability you are pricing by about five points. Read them before you compute anything.

A small logistic model combines three inputs: who is ahead on the grid, the teammate qualifying gap in percent (Chapter 21's standard measure), and the pair's season-to-date H2H record (shrunk towards 50% with two imaginary wins each side, a 🧪 labelled assumption). Trained on 2014–2021 and tested on 2022–2026:

  H2H logistic (train 2014-21, n 1617): coef grid-ahead +0.322, quali gap -0.434 per %, prior share logit +0.326
  test 2022-26 (n 1121): accuracy 0.699 vs 'back the better qualifier' 0.685; Brier 0.2078 vs 0.25 for a coin
   model confidence >= 0.60: n 761 (67.9%), hit rate 0.748, mean confidence 0.679; flat ROI at a hypothetical 1.91: +0.428
   model confidence >= 0.70: n 214 (19.1%), hit rate 0.799, mean confidence 0.760; flat ROI at a hypothetical 1.91: +0.526
   coin-flip zone (confidence < 0.60): n 360, hit rate 0.597

Calibration of the teammate H2H model on 2022–2026: model probability against observed share, with the break-even band of a hypothetical 1.91/1.91 price

📊 Figure (described): The H2H model's forecast probability against the observed share of H2Hs won, 2022–2026, with Wilson intervals and bin sizes. Below 0.5 the points sit on the diagonal. Above it they sit above the diagonal: pairs the model rated 0.59 went 0.67, and pairs rated 0.70 went 0.83. The narrow shaded band marks 47.6–52.4%, the zone a hypothetical 1.91/1.91 price could not beat. The takeaway: the model ranks H2Hs well but is under-confident in the newer era, which was more predictable than its training years.

Do not be seduced by the "+52.6% ROI at 1.91" lines. They answer a question no market asks: what if every H2H were priced as a coin flip? No bookmaker prices Verstappen against a teammate he out-qualifies by half a second at evens. A price for a pair the model rates at 0.76 would itself be around 1.3, and the bettor's question is whether 0.76 beats the price, not whether it beats 50%. The genuine finding is subtler. The 2022–2026 ground-effect seasons were more predictable than 2014–2021 (the better qualifier finished ahead 68.5% of the time against 63.4%), so a model trained on the older era was under-confident by up to thirteen points in its upper bins. A market that adapted slowly to the new era would have made the same error. Whether any did is, again, a question for price data.

📋 Try it: Compare these drivers. Pick the 2025 McLaren pair. Using code/h2h_2014_2026.csv (written by 07_markets.py), compute Norris's race H2H share against Piastri for 2025 with and without races where one of them retired, and the model's mean predicted probability for the same races. Which definition of the market would the model have priced better?

What to look for The two shares differ by the retirement-decided races. In this table, a is the alphabetically first driver, so check who a is before you read a_ahead. Compare the mean of p (refit the model or reuse it from the script) with each observed share. A model trained on all H2Hs prices the "retirement counts" market; a "both must finish" market needs the both-finish subset.

Fastest lap

Fastest lap is a market whose probabilities are set by the rules. From 2019 to 2024, a driver who finished in the top ten and set the fastest lap scored a bonus point. That gave teams with a spare pit-stop gap near the end a reason to stop for fresh tyres and attack the fastest lap. The point was dropped for 2025. The Jolpica data show exactly what that did:

2. Fastest lap (Jolpica fastest_lap_rank == 1), 2014-2026: 272 of 273 GPs have a recorded FL
  2014-18 (no point): n 100; winner 28/100 = 28.0% (20.1-37.5); grid 1 23/100 = 23.0% (15.8-32.2); finished outside top 10 7/100 = 7.0% (3.4-13.7); pitted in last 10 laps 15/100 = 15.0% (9.3-23.3); set in last 5 laps 36/100 = 36.0% (27.3-45.8)
  2019-24 (point, top 10): n 127; winner 37/127 = 29.1% (21.9-37.6); grid 1 34/127 = 26.8% (19.8-35.1); finished outside top 10 14/127 = 11.0% (6.7-17.7); pitted in last 10 laps 48/127 = 37.8% (29.8-46.5); set in last 5 laps 73/127 = 57.5% (48.8-65.7)
  2025-26 (no point): n 45; winner 17/45 = 37.8% (25.1-52.4); grid 1 15/45 = 33.3% (21.4-47.9); finished outside top 10 5/45 = 11.1% (4.8-23.5); pitted in last 10 laps 6/45 = 13.3% (6.3-26.2); set in last 5 laps 16/45 = 35.6% (23.2-50.2)

Share of fastest laps set by the race winner, the grid-1 starter, a driver outside the top 10, a driver who pitted in the last 10 laps, and in the last 5 laps, by bonus-point era

📊 Figure (described): Five groups of bars, one per fastest-lap characteristic, for the three eras. The two right-hand groups show the bonus-point years standing out: 37.8% of fastest laps came after a pit stop in the last ten laps (15.0% in 2014–2018, 13.3% in 2025–2026), and 57.5% were set in the last five laps (36.0% and 35.6%). The takeaway: a one-point incentive changed when and how the fastest lap was set, and removing it changed it back.

This is the cleanest "edge" story in the chapter, because it is a rule change, not a hypothesis. In the bonus-point era, the fastest-lap market was partly a market on which team would make a late stop. That depends on the gap behind, the tyre allocation left and whether the stop cost a position (Chapter 12), all of which an analyst can compute lap by lap. Since 2025, with the late-stop share back to about 13%, the fastest lap has reverted to a by-product of race pace and tyre age, and the winner sets it more often (37.8%, though on only 45 races). A pricing model fitted across the rule change would carry the wrong mixture.

📺 On the broadcast: In 2019–2024, when the graphics showed a car diving into the pits from a big gap with a few laps left, the commentators would say "he's going for the fastest lap." In the data, 37.8% of fastest laps in those six seasons came from a stop in the last ten laps. Since 2025, with no point for it, you rarely see that call, and 13.3% of fastest laps come from a late stop.

Qualifying and championships

For pole position, Chapter 26's pre-weekend qualifying forecast picked the pole-sitter 43.4% of the time (GBM, 272 rounds 2014–2026). Simply taking the fastest driver in the last practice or sprint-qualifying session before qualifying picked 36 of 89 poles in 2023–2026, and an equal blend of the model and the last session picked 39 of 90. Qualifying markets move with every practice session, and the last session is information any price will have seen.

Championship markets in 2026 are a lesson in themselves: both titles are settled. Antonelli clinched the drivers' title in Mexico City (round 19), and after round 21 Mercedes lead the constructors by 149 points with 86 still available. What remains are place markets. Chapter 26's simulation of the last two rounds, labelled as model output at the snapshot after round 21, put Verstappen second in the drivers' standings with 99.1% probability, made third place a near coin flip between Hamilton (39.0%) and Norris (38.7%), and gave Red Bull 75.0% to finish third in the constructors'.

🔄 Check your understanding 1. Why do the retirement rules of an H2H market matter so much in F1? 2. What did the removal of the fastest-lap point in 2025 do to the probability that the fastest lap follows a late pit stop?

Answer 1. A quarter of teammate H2Hs (25.1%, 2014–2026) were decided by exactly one car retiring, and in those the better qualifier won only 53.3%. Whether retirements count moves the true probability by about five points, as much as most claimed edges. 2. It fell from 37.8% (2019–2024) to 13.3% (2025–2026), back to about the 2014–2018 level of 15.0%.


38.11 Responsible Gambling

This is the most important section of the chapter, so it gets plain words.

Betting is designed so that the average bettor loses. The margin we removed in §38.3 is not a technicality; it is the business model. A bettor with no edge, betting into an 18% winner market, loses on average about 15% of every unit staked (1 − 1/1.18), and the loss grows with every bet. Even a two-way market at 1.91 costs 4.5% of every stake. To break even, you must be more accurate than the market by more than the margin, consistently, on the bets you choose. This chapter's honest result is that our best model shows no demonstrable edge against a market as good as our own logit. Most people who bet, including most who build models, lose money over time.

Variance hides the truth for a long time. Case Study 2 computes how long it takes to show that an edge is real. At decimal odds of 4.0, a true +5% edge needs about 7,700 bets before a standard statistical test can tell it from zero; at one bet per race, that is more than three centuries of Grands Prix. A good or bad season says almost nothing about whether you are skilled. That is why Kelly sizing and fractional Kelly matter: they are about surviving while you find out. A bankroll you cannot afford to lose is not a bankroll.

Gambling problems are common and can affect anyone, including careful, numerate people who start out treating it as a hobby. Signs that betting is becoming a problem include:

  • betting more than you planned, or more often;
  • chasing losses, betting again to win back what you lost;
  • borrowing money, using money meant for bills, or hiding betting from people close to you;
  • feeling restless, anxious or irritable when you try to cut down;
  • betting affecting your sleep, work, study or relationships.

Tools and help exist. Licensed bookmakers in many countries are required to offer deposit limits, loss limits, time-outs and self-exclusion. Some countries also run national self-exclusion schemes that cover all licensed operators at once. Banks in some countries let you block gambling transactions. Most countries have free, confidential support services for gambling problems, including helplines and counselling, and many have charities dedicated to them. Look up the official service for where you live, or speak to a doctor. If you are worried about someone else, those services can help you too.

Know the law where you are. Gambling is restricted or illegal in some jurisdictions, and every jurisdiction that permits it has a minimum age. The analytical methods in this chapter are legal to learn anywhere. Using them to bet is not.

Ray: Forty years, small stakes, a notebook. You want to know my record? I'm roughly where I'd be if I'd never bet, minus a few nice dinners I'd have bought anyway. The notebook was the useful part. It taught me that the price is usually right, and that the times I was sure it was wrong were mostly the times I'd fallen for a story.

Ines: So why bother?

Ray: For me it was a way of keeping score on my own judgement. If it ever stops being that and starts being about the money, you stop. That's the rule.

The analytical habits this chapter teaches (convert prices to probabilities, remove the margin, check calibration, size with humility, and measure the sample you would need) are valuable whether or not you ever bet. They are how to read any forecast that comes with a price attached.


Spaced Review

Three ideas from earlier chapters carry this one. Try each question before you read the answer.

From Chapter 26: why must every probability in this chapter be walk-forward? Because a backtest that lets the model see the future cannot be traded. Chapter 26 found that leaky features (a centred team-pace average and the final championship rank) faked about half of a naive model's gain over the grid baseline: 0.062 of 0.135 nats of log loss. In §38.9, that would have turned into fake ROI. Every model here was trained only on seasons before the one it predicts.

From Chapter 27: why does the Monte Carlo engine underrate pole-sitters, and why does that matter for betting? The engine draws each car's race pace with one field-wide uncertainty, which is too wide for the fastest car, so probability leaks from the front-runner to the cars behind. In §38.9 that leak became 39 "value" bets with a claimed EV of +114% and a realised ROI of −73%. A model's errors become a bettor's losses with exactly the model's bias.

From Chapter 14: what was the per-lap full-SC hazard in 2023–2026, and how much riskier is lap 1? 0.0115 per lap, and lap 1 is 8.8 times riskier than later laps. Those rates price the SC prop far better than any one circuit's four-race record (§38.7), and they move with the regulations: 2026 had a neutralisation in 20 of 21 races.


Project Checkpoint: betting.py

Aisha's Box Box now has a pricing layer. project/boxbox/betting.py turns prices into probabilities and probabilities into stakes. It is deliberately independent of the race models: it takes any probability vector from predict.py, montecarlo.py or a base rate.

Function What it does
decimal_from_fractional(text), decimal_from_american(a), implied_prob(odds) price formats → decimal → implied probability
overround(odds, n_winners=1) booksum minus winners
remove_overround(odds, method, n_winners=1) fair probabilities: "multiplicative", "additive", "power", "shin"
hypothetical_book(p, margin, method="power") illustrative prices from probabilities and a stated margin
expected_value(p, odds) $p \cdot o - 1$
kelly(p, odds, fraction=1.0, cap=None) Kelly stake for a binary bet, fractional and capped
kelly_exclusive(p, odds) Kelly stakes across several runners in one winner market
log_growth(f, p, odds), simulate_bankroll(...) growth curve and bankroll paths
edge_report(p_model, odds, method, min_edge, kelly_fraction) one table: price, implied, fair, model, EV, stake, bet?
shrink_rates(k, n) beta-binomial shrinkage for small-sample props

The heart of it is three lines:

def kelly(p, odds, fraction=1.0, cap=None):
    f = np.clip((p * o - 1.0) / (o - 1.0), 0.0, None) * fraction      # edge / net odds, never negative
    return np.minimum(f, cap) if cap is not None else f

code/project_checkpoint.py runs the module on the 2026 Las Vegas GP, with a hypothetical book built from the grid-slot baseline at a 15% margin and the GBM as the bettor:

2. 2026 Las Vegas GP: HYPOTHETICAL book from the grid baseline, overround 0.162
               odds  implied    fair  p_model      ev  kelly_full   stake    bet
abbreviation
VER            1.83   0.5464  0.5135   0.6594  0.2068      0.2491  0.0500   True
ANT           30.00   0.0333  0.0235   0.1364  3.0905      0.1066  0.0266   True
NOR            8.20   0.1220  0.0982   0.0951 -0.2203      0.0000  0.0000  False
RUS            3.60   0.2778  0.2435   0.0731 -0.7368      0.0000  0.0000  False
  exclusive full-Kelly stakes (all runners at once): {'ANT': 0.1253, 'HAM': 0.002, 'LEC': 0.0032, 'NOR': 0.0547, 'PIA': 0.0053, 'VER': 0.4786}
  result: winner VER

4. Any SC/VSC/red by circuit, 2023-2026: pooled 0.725, prior weight 64.2 races
             k  n   raw  shrunk
marina_bay   2  4  0.50   0.712
...
  Singapore 'neutralisation: yes' fair decimal price from the shrunk rate: 1.40

Three things are worth noticing. The grid-slot book sees only that Antonelli starts sixth, not that he qualified on pole, so it offers 30.0; the GBM thinks 13.6% and wants 2.7% of the bankroll at quarter Kelly. Verstappen's stake hits the 5% cap. The exclusive Kelly stakes spread money across six drivers, including a small Norris stake even though Norris alone is −22% EV: when you already back Verstappen and Antonelli, a small stake on a third runner can raise the growth rate by paying out in the races where your main bets lose. And for the Singapore prop, shrinkage puts the fair "yes" price at 1.40, far from the 2.00 that Singapore's own 2-in-4 record suggests.

In Chapter 40, report.py can pass any simulated finishing distribution to edge_report(), so the capstone simulator can show a race's probabilities in the same terms a price is quoted in.


Chapter Summary

Formulas and metrics

Quantity Formula Reading
Implied probability $\pi = 1/o$ break-even win rate at decimal odds $o$
Booksum, overround $B = \sum 1/o_i$; $B - W$ $W$ = number of winners (1 winner market, 3 podium)
Fair probability (multiplicative) $p_i = \pi_i / B$ spreads the margin evenly
Fair probability (power) $p_i = \pi_i^{k}$, $\sum p_i = 1$ loads more margin on long shots
Expected value (edge) $p\,o - 1$ at the price you can get, margin included
Kelly stake $f^* = (p\,o - 1)/(o - 1)$ edge ÷ net odds
Fractional Kelly growth $\approx (2c - c^2)\,g^*$ half Kelly keeps ~75% of growth
Shrunk rate $(k + a)/(n + a + b)$ $a + b$ = prior weight in races
Bets to detect edge $e$ $n = \big((z_\alpha + z_\beta)\,\sigma/e\big)^2$ thousands at typical F1 odds

What the data say about the claimed edges (2014–2026; 2023–2026 for weather and SC)

  • Recency: the last race deserves about 1.4–1.5× the weight of each older race (CI excludes equal weight). A five-race average with a little extra on the latest is nearly optimal. No sign that a different circuit type weakens it. A model that already uses form is calibrated for last-race winners.
  • Weather: favourites and pole-sitters won 5 of 11 wet races against 52 of 80 dry. The direction is plausible; the size is not measurable from 11 races.
  • Safety cars: favourites won more often in full-SC races (30/44 against 27/47). Eight of ten long-shot winners came in neutralised races, against a 66/91 base rate. Per-circuit full-SC rates from 2023–2026 cannot be told apart.
  • Circuit specialists: team-circuit fit carries over at about a tenth (r = 0.115); driver-vs-teammate circuit effects at about 4% (r = 0.040).
  • Backtest: the GBM beats a crude hypothetical market even at a 30% margin, and shows no demonstrable edge against a hypothetical market as good as its own logit. A biased model (the Monte Carlo on pole-sitters) generates phantom edges that lose.

Decision checklist before any bet

  1. Where does my probability come from, and was it walk-forward?
  2. Is the model calibrated in this region (long shots, favourites, wet races)?
  3. What is the implied probability at the price I can actually get?
  4. Is EV positive after the margin, by more than my model's plausible error?
  5. What fraction of Kelly, and what is the cap?
  6. What would have to happen for me to conclude I have no edge, and how many bets would that take?
  7. Am I within the limits I set before I started?

What's Next

Chapter 39 leaves Formula One. MotoGP, IndyCar, endurance racing, NASCAR and Formula E share F1's physics and its strategy problems, but each changes a rule that this book has treated as fixed: refuelling, driver changes, energy limits, stages. We re-run Box Box with those rule profiles to see which of the book's conclusions travel and which were F1 all along.