Chapter 27 Notes — In-Match Forecasting
Chapter link: Chapter 27
Overview and learning objectives
Chapter 27 builds the live layer of Crease and tests one popular claim along the way. The claim is that after the powerplay a good model can predict a T20 total "within ±15 runs, typically". The hook is real. Sunrisers Hyderabad were 105/0 after six overs against Punjab Kings on 11 April 2026. The scoreboard's run-rate projection said 350. The model, fitted only on pre-2023 innings and centred on the match's scoring environment (186.4), said median 257, 80% range 221–298, P(300+) 9.3%. Sunrisers made 219/6, just under the model's 10th percentile. The chapter's point follows: one innings cannot tell a good forecast from a bad one. Thousands of innings, scored out of time, can.
Models are fitted on 5,255 men's T20 first innings before 2023 and tested on 3,662 from 2023–26 (281 IPL). The best projection lands within ±15 in only 41% / 51% / 71% of innings after 6 / 10 / 15 overs; an honest 80% range needs about ±37 / ±29 / ±18. Live context (batters, venue, attack) is worth about half a run of MAE. The tuned chain's 80% ranges cover 73% of all totals, 84% in the IPL and 64.9% in associate T20Is. Milestones (Kaplan–Meier, structural and direct models) and Kavya's broadcast rules follow. The chapter has a 🪞 Learning check-in (§27.8); the Crease module is live.py.
By the end of the chapter students should be able to:
- Compute a run-rate projection and explain its low bias (−10.2 runs after 10 overs) and its volatility (11.2 runs per over against the model median's 5.6).
- Tell an as-of feature from a leaky one, and explain why every model is fitted before 2023 and tested on 2023–26.
- Read an error table, keeping MAE, median absolute error, "within ±15" and the 80% half-width apart, and restate the ±15 claim honestly.
- Judge an interval by its coverage, explain pinball loss, and trace under-coverage to a competition group.
- Turn survival and scoring into a milestone probability, explain why the structural model is too pessimistic, and apply a Platt map.
- Write an honest on-screen line (nearest 5 runs and 5%, range before point, "k in n") and say when the engine should switch to win probability.
- Run
project_checkpoint.pyand interpret its Bangladesh v Zimbabwe output.
Where students struggle
- "The model got SRH wrong." Students judge a forecast by one outcome. Sunrisers' 219 sat just below the 10th percentile (221), which is a one-in-ten event. Reverse the question: how many such misses would you expect in a season, and how would you tell a broken model from an unlucky night? (Answer: calibration over many innings, §27.5.)
- Four error summaries at once. After 6 overs the linear model's MAE is 22.8, its median absolute error 18.5, its "within ±15" 41.0%, and its 80% half-width ±37. Write all four on the board with what each answers. Students regularly confuse "median error 18.5" with "half the innings within ±15".
- "Coverage above 80% is better." It is not. An 80% range that catches 95% is too wide (Check your understanding, §27.1; quiz 12). The IPL's 84% is the safer error, but it is still an error.
- The update that tuned to zero. Many students assume a fast start must raise the projection, and they read τ = 0 as a bug (quiz 7). The fast start does carry information: about 0.32 extra runs to come per run already scored at over 6. But the chain's wickets column already holds most of it. Present this as a useful negative result, not a failure.
- Two spread settings.
tauis updated by the score so far;tau_futureis extra, unrevealed spread for the rest of the innings. Draw them as two separate sources of uncertainty. - Platt maps. A slope below 1 shrinks extremes, yet the corrected hundred forecasts are higher on average (0.085 → 0.132). Work Exercise B6 on the board.
- Format comparisons in runs. "±15" is an 83% statement after 15 overs of a women's T20 innings and a 37% statement after 30 overs of a men's ODI. Push students to compare error as a share of the total.
- Run times.
02,05and08take 80–100 seconds each. SetPYTHONIOENCODING=utf-8on Windows. Scripts save figures intoimages/, so make live edits on a copy of the chapter folder.
Pacing
50-minute session. - 0–7: The hook. Show only the over-6 row (105/0) and have students write their own projected total before you reveal 350, 257 and 219. - 7–20: §27.2–27.3: five methods, the error table and the ±15 claim, restated honestly. - 20–28: §27.4: live context worth half a run; read the 🔍 box aloud. - 28–40: §27.5: coverage tables and the associate shortfall. - 40–48: §27.9: Kavya's rules and the Anchor A broadcast lines. - 48–50: Assign Exercise D4 (the sponsor memo).
75-minute session. As above, plus a 15-minute live coding demo after §27.3 and 12 minutes on §27.7–27.8 (Kaplan–Meier, the four 2026 innings, and the "Devine choked" Settle-this-debate). Give the 🪞 Learning check-in as homework. Lab: 60–90 minutes. Run the scripts in numeric order, or assign 02, 04 and 08 to different groups, since they are the slow ones.
Lecture outline
- Accurate, honest, sayable; as-of features. KL Rahul's 1 run in 2 innings on the morning of 8 April (Chapter 37) is the leakage warning.
- Five methods: run rate × 20; the ER table (pre-2023 par 158.6); the table ×
env_par / par; a linear model; the Monte Carlo chain. - Errors at 6/10/15: run rate 27.6/20.9/13.6, linear 22.8/17.6/11.5; pre-match environment alone 31.9.
- The era problem: the IPL era-blind table was 20.1 runs low after 6 overs; environment scaling cut the bias to −3.0 and MAE from 26.8 to 20.6.
- Live context: crease strike rate +3.5 runs per sd at over 6; momentum +0.0; no gain in the IPL.
- Intervals: pinball loss, τ = 0, τ_f = 0.07; unwidened chain 64–68% coverage, tuned 73% (IPL 83–84%).
- Formats: error as a share of the total is nearly the same in men's and women's T20 and ODIs.
- Survival and milestones: median innings 13 balls; structural v direct models; Platt maps; direct Brier 0.1284 (fifty), 0.0922 (hundred).
- Four 2026 innings: Rahul 152, Suryavanshi 97, Sciver-Brunt 100, Devine 95.
- Broadcast calibration: IPL "20%" came true 20.0%, "50%" 56.1%. After 6 overs, run-rate 220+ calls made it 53.0% (66); chain ≥50% calls 80.8% (26).
- Hand over to win probability at the innings break; Tests via Chapter 10's ladder (0.562 × 0.608 ≈ 34%).
Live coding demo
Script: code/01_hook_srh_pbks.py (about 15 seconds).
- Run it unchanged. Expected: env_par 186.4; final 219/6. Over 6: 105/0, run rate 350.000, 221/257/298, P(250+) 0.592, P(300+) 0.093; over 9: 123/2 → 235 (205–268); over 15: 176/3 → 237 (219–256). The last line reads "IPL first innings with 100+ after 6 overs: 2 of 1199; their finals: 125/0->266, 105/0->219".
- Point at overs 8 → 9. Two wickets fall, and the median drops 22 runs (257 → 235) while the run-rate line drops 27. Ask which movement is "information".
- Live change 1: change
thresholds=(200, 250, 300)to(220, 240, 260). Before running, ask students to predict P(220+) at over 6. Do not promise numbers; the lesson is how fast threshold probabilities move near the median. - Live change 2: set
MATCH = "936157"(Anchor A). The figure title will still say SRH v PBKS; ignore it. Ask why the numbers will not match §27.9 exactly. Anchor A is a 2017 match, so it sits inside this script's pre-2023 training data, while §27.9 left it out. This is leakage, demonstrated live. - Close with
project_checkpoint.py. After 10 overs: 84/0 → median 201, 80% 173–232, run-rate projection 168. The final was 186/5.
In-class activity — "Be the graphics producer"
Groups of three get the Anchor A table from §27.9. Task: (a) write on-screen lines for overs 6, 10 and 15 using Kavya's rules, then compare them with broadcast_line's output. (b) Reply in two sentences to a producer who wants "Projected 158" after over 10 (79 × 120 / 60). (c) At 148/5 the model gave 170+ only 2.8%; South Africa took 21 off the last over to reach 169. Draft the post-match explanation. Extension: quiz question 20.
Answers and teaching notes for key exercises
- B1. "After the powerplay a good projection is typically about 20 runs out. It lands within ±15 only about four times in ten, and you need about ±37 to be right four times in five." For nine in ten, about ±47.
- B2. 105 × 120 / 36 = 350. Errors: run rate +131, model +38. The model removed about 71% of the error, yet its own miss was still more than double the ±15 band.
- B3. The bias moved 17.1 runs while the MAE fell 6.2, about a third. Removing a bias helps only the innings on the wrong side of the centre; with a spread this wide, the rest get worse.
- B5. IPL: SE ≈ 0.022, interval about 79.7–88.3%, so 80% is just inside. Associates: SE ≈ 0.012, interval about 62.5–67.3%, so the shortfall is real. Use this to stop students over-reading the IPL's 84%.
- B6. p = 0.10 → about 0.20; p = 0.60 → about 0.57. Low forecasts are raised a lot and high ones are pulled in slightly.
- B7. 0.562 × 0.608 ≈ 0.342, which matches Chapter 10's 33.7%. T20 conversion is lower because of the clock: at most 72 balls remain after 8 overs, and dismissal risk is 2.58× average in the 20th over.
Assessment ideas
- Written memo: Exercise D4, the sponsor who wants one "Projected Score" number. Grade on four things: the run-rate projection's bias and volatility, a range offered with the point, back-testing by competition, and a no-number fallback for the first overs.
- Code task: Exercise C1 (check values 37 and 18).
- Team-season analysis: Exercise C2, which must include a binomial interval on coverage. Mark down any conclusion about the model drawn from 7–16 innings without one.
- Exam item: "A broadcaster's 80% ranges caught 95% of totals last season. Write two sentences to the producer." Look for "under-confident" and "too wide to be informative".
- Timed write: quiz 20.
Format, gender and region diversity notes
- Women's cricket. §27.6 and Case Study 2 show that women's T20 ranges built with the men's spread setting covered only 65.7/66.5/70.9%. A women-tuned τ_f of 0.11 lifted them to 72.1/71.7/74.9%: full-member T20Is 73.9 → 80.6%, WPL 72.7 → 80.3%. In the Lord's final England's 150/4 sat inside the range at all 19 over-ends. Two of the four live milestone innings are WPL innings (Sciver-Brunt 100*, Devine 95). Teach these as central examples, not add-ons.
- Associate cricket. Associates are 42% of the test sample and the main source of under-coverage. Do not let students conclude that associate cricket is "random". The environment knows the average level, not tonight's mismatch. Exercise C4 adds team strength.
- Region. The checkpoint is Bangladesh v Zimbabwe in Bulawayo (Nusrat's choice); Anchor A is South Africa v Sri Lanka at Newlands. Case Study 1 is the 2026 men's T20 World Cup final in Ahmedabad. India's 255/5 was inside the 80% range at 14 of 19 over-ends, and Samson was given 70% for a hundred at 88 off 44, then dismissed on 89.
- Format. ODIs appear in §27.6; Tests only through milestone survival.
Connections
- ER table and chain: Chapter 19; environment, calibration, chase WP: Chapter 20.
- Shrinkage: Chapter 6; Kaplan–Meier and the Test ladder: Chapter 10; strike share: Chapter 12.
- Next: Chapter 28; Tests: Chapter 29; batting order on
simulate_innings: Chapter 30. - In-play markets: Chapter 35; broadcast leakage: Chapter 37; live tab: Chapter 39.