Chapter 15 Notes — Pitch Maps and Ball-Tracking
Chapter link: Chapter 15
Overview and learning objectives
Chapter 15 is the chapter most likely to be taught badly, so read this section before anything else. Its subject is ball-tracking: length, line, pitch maps, beehives, variations, clustering, LBW geometry. No real ball-tracking data is public. The chapter therefore works on two layers and keeps them strictly apart:
- Real Cricsheet data gives how wickets fell (the new stumps share = (bowled + LBW) ÷ bowler wickets), dismissal mixes by format, phase and gender, and a genuine DRS natural experiment.
- The simulated tracking layer (
toolkit/tracking_sim.py) attachessim_*columns to real deliveries. Outcomes are real; locations, speeds and variations are simulated, and lengths and lines are drawn conditional on the real outcome.
The hook frames the whole chapter. Malinga's real IPL death record (1,117 balls, 108 wickets, economy 7.86, stumps share 42.6% against Bravo's 16.5%) leads Nusrat to draw a simulated pitch map packed with yorkers. Wendell replies: "So you told it that wickets come from yorkers, and then it showed you that Malinga's wickets came from yorkers." The chapter then runs five audits that measure exactly how much of each "finding" the simulator manufactured. The answer, for the length table, is all of it. The transferable skill is auditing a model's output. The chapter has a Learning check-in. The Crease module is tracking.py.
By the end of the chapter students should be able to:
- Compute and interpret stumps share from real data (Malinga 42.6%, Bravo 16.5%; ρ with economy −0.52 across 25 death specialists).
- State clearly which questions real Cricsheet data, the simulated layer and a real tracking feed can each answer (the Chapter Summary table).
- Run and explain a recovery test (switching the outcome tilt off flattens every length to economy 9.60–9.62 against the real 9.61) and a placebo test (LBW model AUC 0.823 → 0.503 with shuffled labels).
- Explain the name, subset and independence artefacts, and why the house rule is "simulate the whole competition, then filter".
- Compute and interpret a difference-in-differences (DRS: −1.2 pp, 95% CI −5.1 to +2.6).
- Apply the five audit questions to any model output, whether from a vendor, a broadcaster or a colleague.
Framing the simulated layer honestly — required reading for instructors
Students will remember the pictures longer than the caveats. Build the honesty into the teaching:
- Say it first, and say it every time. Before showing any figure from 15.3–15.8, say: "Every outcome here is real. Every location is simulated. No number about where a ball went is a fact about any real bowler." Every slide carries the caption simulated tracking layer — real outcomes, simulated locations. The scripts print
[SIMULATED]because Windows consoles cannot print the 🧪 emoji; tell students what the tag means. - Never let a
sim_number become a player fact. "Malinga's yorker share is 31.8%" is forbidden in class, in assignments and in exams. The acceptable form is "the simulation assigns 31.8% of his death balls to the yorker band, because of how it was built". Mark down any submission that states a simulated value as a fact about a real player. - Teach the method, then the artefact, then the real thing. The order in the chapter is deliberate. Build the length table (method). Audit it (artefact: the tilt explains about 100% of the yorker's 3.89-run advantage, Exercise B3). Then describe what a franchise with the real Hawk-Eye feed would see (§15.9: execution rates, real xW, batter-specific plans, conditions, workload, validation).
- Frame the audits as the payoff, not a disappointment. Students sometimes feel cheated ("so the chapter's charts are fake?"). Turn it round. The same five questions protect them against vendors' "modelled" pitch data (Exercise D2), human-coded leaky features, and any synthetic dataset. Tell them this is the most transferable skill in the book.
- Keep the real findings in view. The chapter is not only artefacts. Stumps share, the women's bowled share, and the DRS natural experiment are real, and they are what students can report.
- Name the specific traps. The layer's line and beehive height ignore batting hand and pace. Bowlers missing from the simulation's frozen styles copy,
player_styles_sim_v1.csv(IK Pathan, Z Khan; both are in the live table), get a hash-guessed type, and Pathan comes out a spinner. Simulated speed v real economy (ρ −0.25) is a hash correlation. Show these as warnings, not jokes. - Model the reply to a coach. Read a good answer to Exercise D8 aloud: offer what is real, label what is simulated, and say what the real feed would add.
Where students struggle
- Bayes in reverse. The simulation draws P(length | outcome); the table reads P(outcome | length). The 🔍 box explains why the tilt is the table. Work a two-length, two-outcome example on the board.
- "Null by construction." The slower ball at the IPL death shows 9.53 against a phase economy of 9.61. Students want to read that as "slower balls don't work". The variation was generated independently of the outcome, so a null result was guaranteed.
- R² that doesn't add. Simulated yorker share: 0.25 from real outcomes, 0.78 from the name hash, 0.84 together (Exercise B4).
- Difference-in-differences. The sign confuses students: India's LBW share fell 2.4 pp after DRS arrived, against 1.2 pp elsewhere. The point estimate runs against the "DRS gave spinners LBWs" story, but the interval includes zero.
- Stumps share as a length proxy. It is a shadow of length and line, blurred by batter behaviour, pitch bounce and dismissal coding (Exercise A2).
Pacing
50-minute session. - 0–8: Hook, including Wendell's "Who told the computer where Malinga's balls landed?" - 8–16: §15.1 what Hawk-Eye measures and who gets to see it; §15.2 real dismissal mixes and stumps share. - 16–22: §15.3 a simulated pitch map, shown with the label. - 22–38: §15.5 the audits: recovery test, name test, subset test. - 38–46: §15.8 the real DRS natural experiment. - 46–50: The five questions; assign Exercise D8.
75-minute session. Add §15.6 variations (null by construction), §15.7 clustering (try k=3 and k=5) and the LBW placebo. Lab: 60 minutes. 07_lbw_and_drs.py takes about 60 seconds and 02_length_line_tables.py about 50.
Lecture outline
- What tracking measures (length, line, pitch map, beehive, speed, deviation); DRS trialled in 2008 and introduced in Tests in 2009; umpire's call; the wicket zone raised to the top of the bails in 2021.
- Real dismissal mixes: men's Tests stumps share 35.0%, IPL 24.8%, women's T20Is 43.3% (bowled 31.6%).
- Death specialists (real): Malinga 42.6%, Bumrah 31.4%, Bravo 16.5%; boundary % v economy 0.95.
- The simulated layer and what it is conditioned on; length and line tables that look like coaching wisdom.
- The five audits: recovery, decomposition, name, subset (filter first and simulate second, and you get different "facts"), handedness/speed.
- Variations and clustering: the null by construction; clusters recover the generator's bands.
- LBW geometry; placebo AUC; real Test LBWs on the simulated beehive (70.2% "hitting", against 23.9% of all balls, by construction).
- The DRS natural experiment (real): India's first home DRS Test at Rajkot on 9 November 2016; DiD −1.2 pp.
- Women's bowled share (real): full member v full member 22.9% against men's 20.0%, gap 2.9 pp (1.6–4.2). The raw 31.6% is mostly associate matches.
- What a franchise with the real feed sees.
Live coding demo
Script: code/03_artefact_audit.py. Open by saying out loud that everything it prints marked [SIMULATED] is a property of the simulation.
- Run it unchanged. Audit 1 prints the three-column-group table for IPL death pace: yorker observed economy 5.72, implied 5.73, tilt-off 9.60; full 12.52 / 12.43 / 9.61; bouncer wicket % 9.93 observed against 7.45 tilt-off. Real overall: economy 9.61, dot % 30.6, wicket % 7.51. Audit 2: R² 0.25 (real outcomes), 0.78 (signature), 0.84 (both). Audit 3: Bumrah renamed, pace → spin, 143.1 → 94.7 km/h, wickets_real unchanged at 190 (that count includes super overs). Audit 4:
{'balls': 17527, 'length_changed_pct': 68.0, 'median_pitch_shift_m': 2.1}. Speed trap: ρ −0.25, p 0.067. - Live change 1: in the
name_sensitivitycall, swap the pair to"SL Malinga", "Lasith Malinga". Ask students to predict the outcome before running. Whatever prints, the lesson is the same: a spelling changed the "data". - Live change 2: change the subset mask from
"2026"to"2025". A similar large share of balls should change band. Ask why this matters if two analysts publish "the same" simulated figure (Exercise B9). - Close by reading the five questions from §15.5.
Alternative: code/01_real_fingerprints.py, which is entirely real. Use it if you want the lab to start from real data before touching the simulation.
In-class activity — "Audit the vendor"
Exercise D2 as a group task. A vendor offers "modelled" pitch locations for every BBL ball, generated from ball-by-ball data by "a proprietary machine-learning model". Each group writes the five questions they would send the vendor, adapted from §15.5, and one test they would run themselves if the vendor sent a sample (a placebo, or a rename). Groups then swap and grade another group's questions on one criterion: would this question have caught the yorker artefact?
Answers and teaching notes for key exercises
- B1. Malinga 46 of 108 hit the stumps; Bravo 19 of 115. Per ball Malinga's strike rate is 10.34 against Bravo's 12.04, and he conceded 1.5 runs an over fewer. Bravo's value lies in volume.
- B2. Correlation size is not importance. Boundary % and economy are nearly the same quantity, and stumps share correlates −0.42 with boundary %. Fit both in one regression and expect a wide interval with n = 25.
- B3. The tilt explains 3.88 of 3.89 runs, effectively 100%.
- B5. 0.823 rests on locations drawn knowing which balls were LBWs; 0.503 is a coin. A franchise should care about the placebo.
- B6. DiD = −2.4 − (−1.2) = −1.2 pp, interval −5.1 to +2.6. No detectable rise.
- B9. About 200 of Bumrah's 294 balls would change band. No simulated number should be published as a fact about a player.
Assessment ideas
- Required written task: Exercise D8, the reply to a coach who wants Hawk-Eye pitch maps. Grade on four things: real offers, honest labelling, no
sim_facts about players, and what the real feed would add. - Code task: Exercise C5 (tilt sensitivity, without editing the toolkit). Students see the table follow whatever tilt they choose.
- Real-data analysis: Exercise C1 (stumps share with a 90% beta-binomial interval) or E2 (find a second natural experiment).
- Exam item: "Explain why a simulated length table can show yorkers conceding 5.72 an over while telling you nothing about yorkers." Look for Bayes' rule or the tilt-off result.
Format, gender and region diversity notes
- Women's cricket is central here. Ecclestone's real women's T20I record (2,517 balls, 154 wickets, economy 6.04, bowled 38.3%, stumped 11.0%) sits beside a simulated beehive. Make students separate the two layers on the same player. Case Study 2 shows that the women's raw bowled share of 31.6% is mostly associate-involved matches. Between full members the gap to men is 2.9 pp. That is an excellent example of composition in a gender comparison. WPL stumps share by phase: 36.8 / 30.3 / 26.6.
- Region: Case Study 1 is India's home Tests and DRS (Ashwin's LBW share in India 29.4% before, 20.9% after). Sri Lanka's Malinga carries the hook; Nusrat works in Dhaka.
- Format: stumps share is 35.0% in men's Tests against 24.8% in the IPL. Exercise D1 warns against transferring IPL fingerprints to Test selection.
Connections
- The simulated-data convention and chart captions: Chapter 7; the noise-and-null lessons: Chapter 6.
- Leakage in the simulated xW model: Chapter 14.
- Bowler type v batter (real), for which this chapter's layer must not be used: Chapter 11, Chapter 18.
- Conditions and the old ball, approached through outcomes: Chapter 16.
- Field placement on simulated shot zones: Chapter 32; the future of ball-tracking AI: Chapter 40.