Case Study 2 — What Predicts an Undercut? A Success Model Across 331 Situations, 2023–2026

Setup

A strategist does not need to explain undercuts after the race. She needs to call them before the stop. The question for this case is practical: on the lap before the first stop, which measurable quantities tell you whether the car behind will end up ahead? And how much better than a base rate can you do?

Chapter 13 has already suggested some candidates. The gap matters a great deal (78.6% success inside 1 s, 19.3% from 2–3 s). The defender's reply matters ($k = 1$: 33.7%; $k = 3$: 71.4%). The two-car tyre model predicts the typical gain but not the individual one. Here we put them all in one framework and score them honestly.

Aisha set the rules for Sector Four before anyone fitted anything:

Aisha: We score every model on races it hasn't seen. Leave one race out, fit on the other 71, predict the held-out race, repeat. Ray: And the benchmark is the base rate. If a model can't beat "the car behind usually loses", it's decoration. Ines: What about $k$? The defender chooses it after the attacker stops. Aisha: Then it can't be in the pre-stop model. We'll fit it separately and label it "given the reply".

The data

The data are the 331 situations from code/03_undercut_study.py (168 undercuts, 163 overcuts, 72 races, OpenF1 2023 to 2026 R21). They use the chapter's definitions: attacker directly behind within 3.0 s on the lap before the first stop, stops 1–3 laps apart, green and dry throughout, outcome two laps after the second car's out-lap. The outcome $y$ is 1 if the attacker ends up ahead. Across both kinds, the base rate is 0.326.

Candidate predictors, all known on the lap before the first stop unless flagged:

predictor meaning
uc 1 for an undercut (the attacker stops first), 0 for an overcut
gap_before gap at the line on the lap before the first stop (s)
def_age the defender's tyre age at that moment (laps)
y26 1 for a 2026 race (new regulations)
tm 1 if the two cars are team-mates
pred the two-car model's predicted gain (predict_pair, using the race's own median deg: a hindsight input)
k laps between the stops: known only after the defender replies

code/case_study_02.py fits logistic regressions with statsmodels and scores them by leave-one-race-out cross-validation. Every situation's probability comes from a model fitted without its own race. The three scores are log loss (punishes confident wrong calls), Brier score (mean squared error of the probability) and accuracy (share of correct calls at a 0.5 threshold). For the first two, lower is better.

Analysis

Scoreboard

Leave-one-race-out scores (lower log loss / Brier is better):
                                               model  log_loss  brier  accuracy
                                      base rate only    0.6350 0.2214    0.6737
                                                kind    0.6144 0.2123    0.6737
                               kind + gap (pre-stop)    0.5348 0.1783    0.7311
kind + gap + tyre age + 2026 + team-mates (pre-stop)    0.5436 0.1823    0.7251
   kind + gap + model gain (pre-stop, hindsight deg)    0.5343 0.1776    0.7281
                    kind + gap + k (given the reply)    0.5292 0.1760    0.7372

Four results stand out.

  1. Kind alone barely helps. Knowing undercut vs overcut lowers the log loss from 0.635 to 0.614, but it does not change a single 0.5-threshold call. Neither kind is above 50% on its own (42.9% and 22.1%), so "predict failure" stays the best call for both.
  2. The gap does almost all the work. Adding the gap (with an interaction, so it can matter differently for undercuts and overcuts) cuts the log loss to 0.535 and the Brier score to 0.178. Accuracy rises to 73.1% against 67.4% for the base rate.
  3. Everything else adds nothing out of sample. Tyre age, the 2026 flag and the team-mate flag make the held-out scores slightly worse (log loss 0.544). The two-car model's predicted gain, even with hindsight degradation rates, improves the log loss by 0.001. Within the noise, that is nothing.
  4. Knowing the reply helps a little. Adding $k$ gives the best scores (log loss 0.529, accuracy 73.7%), but $k$ is not available before the stop.

The fitted pre-stop model

Pre-stop model (kind x gap):
                coef     lo     hi
Intercept      0.199 -0.620  1.017
uc             1.972  0.759  3.186
gap_before    -1.186 -1.848 -0.524
uc:gap_before -0.411 -1.273  0.452
  undercut: gap at which P(success) = 0.5: 1.36 s
  undercut: gap at which P(success) = 0.7: 0.83 s
  overcut: gap at which P(success) = 0.5: 0.17 s
  overcut: gap at which P(success) = 0.7: -0.55 s  (outside the data: no gap > 0 gives it)

Plain-English reading. On the log-odds scale, each extra second of gap cuts an overcut's odds by a factor of $e^{1.186} \approx 3.3$. It cuts an undercut's by $e^{1.186 + 0.411} \approx 4.9$, although the interaction's interval includes zero, so the two slopes are not clearly different. The undercut window, where an undercut becomes more likely than not, is 1.36 s. Inside 0.83 s the model gives the undercut a 70% chance. An overcut reaches 50% only from about 0.17 s, essentially side by side, and no positive gap gives it 70%.

The richer model's coefficients show why its extra terms don't help:

Full-sample fit of the richer pre-stop model:
                coef     lo     hi      p
Intercept      0.325 -0.625  1.274  0.503
uc             1.998  0.776  3.220  0.001
gap_before    -1.160 -1.827 -0.492  0.001
uc:gap_before -0.426 -1.294  0.442  0.336
def_age       -0.007 -0.039  0.025  0.678
y26           -0.538 -1.423  0.348  0.234
tm             0.055 -0.741  0.851  0.892

The defender's tyre age has a coefficient of −0.007 per lap, with an interval from −0.039 to +0.025. It is indistinguishable from zero. This matches the chapter's finding that the fresh-tyre step does not grow with tyre age. The 2026 coefficient is negative (−0.538: lower success in 2026), but its interval spans zero, and on 40 situations that is all we can say. Team-mate pairs behave like everyone else.

Given the reply

Given the reply (k as a category), undercut P(success) at gap 1.0 s:
  k = 1: 0.569
  k = 2: 0.692
  k = 3: 0.780

From exactly 1.0 s behind, an undercut answered on the next lap has a 57% chance. If the defender waits two laps it is 69%, and three laps 78%. For the defending strategist this is the cost of hesitation, in probability: each lap of delay hands the attacker about ten points.

Are the probabilities honest?

A model with good scores can still be miscalibrated: right on average, but over- or under-confident in places. We sort the held-out predictions into fifths and compare each fifth's average prediction with what happened:

Calibration of the pre-stop model (leave-one-race-out):
                  n  predicted  observed     lo     hi
bin
(0.0352, 0.131]  67      0.086     0.104  0.052  0.200
(0.131, 0.224]   66      0.178     0.136  0.073  0.239
(0.224, 0.337]   66      0.275     0.348  0.245  0.469
(0.337, 0.508]   66      0.413     0.379  0.271  0.499
(0.508, 0.881]   66      0.684     0.667  0.547  0.768

Calibration of the pre-stop success model on held-out races

📊 Figure (described): Each point is one fifth of the 331 held-out predictions, plotted at its mean predicted probability (horizontal) against the observed success share (vertical), with Wilson 95% intervals. All five points lie close to the diagonal, and every interval contains it. When the model says 68%, the attacker ended up ahead 67% of the time.

Every fifth's interval contains the diagonal. When the model says "about 9%", the observed rate is 10.4%. When it says "about 68%", it is 66.7%. For a two-variable model that is a good result. It means a pit wall or a bettor could use these probabilities as probabilities, not just as rankings.

What it means (and doesn't)

What it means.

  • A simple, honest pre-stop rule exists. Undercut or overcut, and how far back? Those two facts give calibrated probabilities that beat the base rate on races the model has never seen. The undercut window is about 1.4 s, and the 70% line is about 0.8 s.
  • The tyre model's contribution to calling an undercut is close to zero once you know the gap. That is not because tyres don't matter: the fresh-tyre component is the largest positive term in most undercuts. It is because that term is roughly the same size in most situations (about 1.2–1.4 s per lap of offset), while what varies from case to case is the gap and the pit-lap execution.
  • The defender's reply is worth about ten percentage points per lap of delay. That is the case for covering by default.

What it doesn't mean.

  • It is not causal. Small gaps go with success partly because close attackers tend to be faster cars being held up (Chapter 13, section 13.5). Shrinking the gap by pushing harder does not buy you that pace advantage.
  • It is a model of situations that happened. Strategists choose when to try undercuts. Hopeless ones were never attempted, so they are missing from the data. The probabilities describe the undercuts teams chose to make, not every undercut that could have been tried.
  • The sample is modest. 331 situations is enough to fit two or three parameters, not a dozen. Circuit effects (Bahrain's 62.5%), running position (23.1% at the front against 51.7% behind) and season effects all deserve a place, but each costs parameters this sample cannot support without shrinkage. Chapter 26's predictive-modelling tools are the right next step.

Discussion questions

  1. The model that adds tyre age, season and team-mates fits the full sample at least as well as the two-variable model, yet scores worse when races are held out. Explain why, in terms of overfitting.
  2. Why must $k$ be left out of a model meant for the lap before the stop? Construct a scenario where including it would give a strategist a misleadingly optimistic number.
  3. The calibration plot looks good. Name a kind of race where you would expect it to fail (think about circuit, weather and the front of the field), and how you would test that.
  4. A bettor sees a live price of 2.50 (decimal odds, an implied probability of 40%) on "the car behind leads after the stops". The car behind has just pitted from 0.9 s back, and the defender has not yet replied. Using the pre-stop model's curve, is there a case for the bet? What would you need to know about the bookmaker's margin (Chapter 38)?
  5. The two-car model's predicted gain adds almost nothing once the gap is known. Suggest one change to the model's inputs (see Case Study 1) that might change that.

Your turn

Add running position to the pre-stop model. Create front = (B_pos <= 6) and fit y ~ uc * gap_before + front with the same leave-one-race-out loop.

  • Report the held-out log loss, Brier score and accuracy beside the scoreboard above.
  • Report the front coefficient with its 95% interval, and translate it into "the undercut window for a top-six attacker" (the gap at which P = 0.5 when uc = 1, front = 1).
  • Then try uc * front (does the front effect differ between undercuts and overcuts?) and say whether the extra interaction earns its place out of sample.
  • Whatever you find, finish with one sentence a race strategist could act on, and one sentence on what the model still cannot see.