58 min read

On 8 April 2023, Chennai Super Kings chased at the Wankhede Stadium in Mumbai, and Ajinkya Rahane, a

Chapter 6 — Statistical Thinking for Cricket: Probability, Bayesian Reasoning, Sample Size, and Not Being Fooled by Randomness

On 8 April 2023, Chennai Super Kings chased at the Wankhede Stadium in Mumbai, and Ajinkya Rahane, a batter many fans thought of as a Test-match technician, made 61 off 27 balls against Mumbai Indians. Four days later he made 31 off 19 in Chennai. Then 37 off 20 in Bengaluru, a quiet 9 off 10, and on 23 April at Eden Gardens, 71 not out off 29.

Add them up. In his first five innings of IPL 2023, Rahane scored 209 runs off 105 balls — a strike rate of 199.0. Before that season he had batted in 148 IPL matches stretching back to 2008, and his career IPL strike rate going into 2023 was 120.7. The difference is not a rounding error. It is the difference between an anchor and one of the most destructive batters in the league.

So what did you believe on the morning of 24 April 2023?

One camp said: he has reinvented himself. Look at the numbers — 199 is 199. Another camp said: it is five innings; wait. Both camps were looking at the same 105 balls. They disagreed about something the numbers on their own cannot settle: how much should five innings move your belief about a batter you have watched for more than a decade?

Here is what happened next. In the rest of the 2023 season Rahane scored 117 runs off 84 balls — a strike rate of 139.3. Faster than his old self (120.7), much slower than his April self (199.0). Neither camp was right. The truth landed in between, and closer to the old number than the April hype suggested.

That pattern — the hot start that cools, the new level that is real but smaller than it looked — is not a story about Rahane. It is a story about every batter, every bowler and every team. When we ran the same split on every IPL batter-season from 2009 to 2026 with enough balls to measure, the batters with the hottest first five innings (the top fifth) scored at a pooled strike rate of 176.1 in those innings and 153.4 for the rest of the season — against a pre-season record of 138.8. The batters with the coldest starts went the other way: 106.2 in the first five, 125.6 afterwards, 129.5 before. Hot starts cool. Cold starts warm. Everything drifts back toward what we knew.

Statisticians call this regression to the mean, and it is the single most important idea in this chapter. It is also the idea cricket's commentary boxes, selection meetings and auction rooms most often forget.

This chapter is about the statistical habits you need before you build any of the models in the rest of this book: how big a sample has to be before a strike rate means something, how to put an honest interval around a number, how to blend what you knew with what you just saw, why "he averages 58 in wins" is a trap, and how much of an IPL points table is simply luck. Every demonstration uses real data from the book's snapshot. No coin-flipping thought experiments where a real over will do.

🏏 Fan Track: Read the hook, §6.1–6.4, §6.7 (Simpson's paradox) and §6.8 (the "averages in wins" trap). You can skip the code blocks; every result is explained in prose. You will never read a "he's in the form of his life" graphic the same way again.

📊 Analyst Track: Everything, especially §6.3 (the stabilisation constant k), §6.6 (shrinkage) and §6.10 (Bayesian updating). These are the tools every later chapter assumes, and crease/uncertainty.py packages them.

🧑‍💼 Franchise Track: §6.4 (hot starts), §6.6 (shrinkage pays — measured), §6.9 (how much of a table is luck) and Case Study 1. If you have ever wanted to sign a player off one good month, start here.


6.1 One Ball Is Mostly Noise

The cricket question: if a batter is genuinely better than another, why doesn't it show up every innings?

Start with the smallest unit of cricket: one ball faced. What can happen? The batter can score nothing, a single, two, three, a four, a six — or get out. A probability is the long-run share of times something happens. If we watch thousands of balls, the share that go for six settles down to a stable number. That stable number is the probability of a six on one ball, for that kind of batter in that kind of match.

Here is what one ball looks like in each format, computed from every ball faced (wides excluded) in 2023–2026.

for code, label in [("ipl", "IPL"), ("t20s_male", "Men's T20I"), ("t20s_female", "Women's T20I"),
                    ("odis_male", "Men's ODI"), ("tests_male", "Men's Test")]:
    d = load_deliveries(code)
    d = d[(d["start_date"].dt.year >= 2023) & (d["wides"] == 0) & ~d["super_over"]]
    r = d["runs_batter"]
    out = batter_dismissed(d)
    rows.append([label, len(d)] + [100 * (r == v).mean() for v in (0, 1, 2, 4, 6)] +
                [r.mean(), r.std(), 100 * out.mean()])

Two pandas idioms are new here. (r == v).mean() turns a column of runs into True/False ("was this ball a six?") and averages it — the mean of a True/False column is the share of Trues, so this is a probability estimate in one line. r.std() is the standard deviation, which we define in a moment.

0. Runs off the bat on one ball faced, 2023-2026 (wides excluded)
      format  balls    %0    %1   %2    %4   %6  mean   SD  %out
         IPL  66914 34.56 38.20 6.01 13.36 7.64  1.50 1.81  5.15
  Men's T20I 431809 43.98 34.34 6.96  9.61 4.70  1.16 1.59  5.89
Women's T20I 301770 51.98 31.26 7.10  8.53 0.72  0.85 1.24  5.33
   Men's ODI 256408 54.25 30.56 4.85  7.82 2.04  0.85 1.34  2.89
  Men's Test 249252 71.27 17.32 3.63  6.31 0.66  0.56 1.15  1.95

Full script: code/01_reliability.py (part 0).

📐 Definition — expected value and standard deviation of one ball. For a ball with possible outcomes x (0, 1, 2, 3, 4, 6 runs) occurring with probabilities p(x), the expected value is E[X] = Σ x p(x) — the long-run runs per ball (multiply by 100 and you have a strike rate). The variance is Var(X) = Σ (x − E[X])² p(x), and the standard deviation SD = √Var — the typical size of a ball's departure from its average. For a group of n independent balls, the SD of their average shrinks to SD/√n.

Read the IPL row. The average ball in the impact-player era yields 1.50 runs (a strike rate of 150), but a single ball's standard deviation is 1.81 runs — bigger than the average itself. One ball is a dot more than a third of the time, a single 38% of the time, and a boundary about one time in five. The spread of outcomes swamps the level.

Now set that against how different batters really are. In §6.6 we will measure the spread in true strike-rate ability between IPL batters: roughly 13 to 19 strike-rate points in a season. Convert the per-ball SD to the same scale and it is about 180 strike-rate points. On any single ball, the difference between a great batter and an ordinary one is about a tenth of the noise. Squared — which is how variances combine — skill explains well under 1% of what happens on one ball.

This is the root of everything in this chapter. Cricket is a game of many balls, each mostly noise, and skill reveals itself only as the noise averages out. The SD of an average shrinks with √n: over 100 balls, the noise on a strike rate is about 180/√100 = 18 points; over 400 balls, about 9 points. That is why a 30-ball innings can tell you almost nothing, and a full season can tell you something.

Look down the rows and the formats differ in instructive ways. A Test ball is a dot 71% of the time and a dismissal 1.95% of the time — about one dismissal every 51 balls. An IPL ball is a dismissal 5.15% of the time — one every 19 or so. So in a Test you collect fewer dismissals per ball faced, which matters enormously for batting averages (a ratio with dismissals on the bottom). The women's T20I six rate is 0.72% against 4.70% for men's T20Is; the scoring shape differs, so a noise budget computed in one competition does not transfer blindly to another. This is Theme 2 (three different sports) showing up at the level of a single delivery — the same lesson Chapter 5 drew from innings totals.

⚠️ Common pitfall: treating a strike rate as precise because it has two decimal places. "SR 187.50" off 16 balls looks exact. It is 30 runs off 16 balls, and the noise on a 16-ball strike rate is roughly 180/√16 = 45 points either way. Report the balls alongside every rate, always. Crease does.

🔄 Check your understanding 1. In the IPL (2023–26), the per-ball SD of runs is 1.81. Roughly how big is the noise on a strike rate built on 64 balls? On 400 balls? 2. Why does a Test batter collect dismissals more slowly per ball faced than an IPL batter?

Answer

  1. About 181/√64 ≈ 23 strike-rate points for 64 balls; about 181/√400 ≈ 9 points for 400 balls.
  2. Only 1.95% of Test balls faced end in a striker dismissal, against 5.15% in the IPL — Test batters are not forced to take risks to score, so far fewer balls carry a wicket-taking outcome.

6.2 Signal and Noise: Does This Season Predict Next Season?

The cricket question: if a batter tops the strike-rate charts this IPL season, how much of that will still be there next year?

The cleanest test of whether a statistic measures a player — rather than his luck — is whether it repeats. If strike rate were pure skill, a batter's strike rate this season would predict next season's perfectly. If it were pure luck, it would predict nothing. Real cricket sits in between, and the correlation tells us where.

📐 Definition — correlation (r). A number from −1 to +1 measuring how tightly two quantities move together in a straight line. r = 1: perfect agreement; r = 0: no linear relationship. For season-to-season comparisons, r is a rough "share of the observed spread that carries over".

We take every IPL batter who faced at least 150 balls in two consecutive seasons — 489 such pairs from 2008 to 2026 — and every bowler with at least 120 legal balls in two consecutive seasons (542 pairs), and correlate season N with season N+1.

bat = batting_summary(balls, by=["batter", "year"]).reset_index()
bat = bat[bat["balls"] >= 150]
nxt = bat.assign(year=bat["year"] - 1)             # season N+1 relabelled as N
pairs = bat.merge(nxt, on=["batter", "year"], suffixes=("_n", "_n1"))
for stat in ["strike_rate", "average", "dot_pct", "boundary_ball_pct"]:
    p = pairs.dropna(subset=[f"{stat}_n", f"{stat}_n1"])
    rows.append(("batting", stat, len(p), p[f"{stat}_n"].corr(p[f"{stat}_n1"])))

The trick worth learning is the self-merge. We make a copy of the season table with every year shifted back by one (assign(year=... - 1)), then merge it with the original on batter and year. Each row now holds a batter's season N numbers and his season N+1 numbers side by side, with the _n and _n1 suffixes telling them apart. .corr() on two columns gives Pearson's r.

A. IPL season-to-season correlation (batters >= 150 balls, bowlers >= 120 balls in BOTH seasons)
   side              stat  pairs  r_season_to_season
batting       strike_rate    489               0.476
batting           average    489               0.232
batting           dot_pct    489               0.489
batting boundary_ball_pct    489               0.510
bowling           economy    542               0.521
bowling       strike_rate    542               0.121
bowling           dot_pct    542               0.572
bowling           average    542               0.073
  strike_rate: N+1 = 67.75 + 0.505 x N   (mean of N = 137.34)
  average: N+1 = 25.56 + 0.240 x N   (mean of N = 34.58)

Full script: code/01_reliability.py (part A).

Two scatter plots of IPL batters' season N statistic against season N+1: strike rate on the left with a fitted line of slope 0.50, batting average on the right with a fitted line of slope 0.24

📊 Figure (described): Left: each dot is an IPL batter with 150+ balls in two consecutive seasons; strike rate in season N (x) against season N+1 (y). The cloud tilts upward, but the fitted orange line (slope 0.50) is much flatter than the dashed "perfect repeat" line. Right: the same for batting average — a fat, nearly shapeless cloud with a fitted slope of 0.24. Strike rate carries over about half; batting average carries over about a quarter.

This table is one of the most useful in the book. Read it slowly.

Strike rate, dot % and boundary-ball % repeat at roughly r = 0.5. They are about half signal across a season of 150+ balls. The fitted line says: take a batter's strike rate, subtract the average (137.34), halve the difference, and add it back — that is the best straight-line forecast of next season. A batter 40 points above average this season projects about 20 above next season.

Batting average repeats at only r = 0.23. The fitted slope of 0.24 means a T20 batter who averaged 20 runs above the mean this season is forecast to be about 5 above next season. In T20, average is mostly noise at the season level. The reason is the denominator: a season of 150–400 balls contains roughly 8 to 20 dismissals, and a handful of dropped catches, run-outs or one-off brilliant deliveries can swing it by 15 runs.

For bowlers, the gap is even starker. Economy (r = 0.52) and bowling dot % (0.57) repeat as well as anything a batter does. Bowling strike rate (0.12) and bowling average (0.07) barely repeat at all. A bowler's wicket count in an IPL season is close to a lottery — the wickets depend on who was batting, what they were trying to do, and whether the catch stuck. Read that once more: the IPL bowling average, season to season, has a correlation of 0.07 with itself. If you pick bowlers on last season's wickets, you are mostly picking on luck.

This is Theme 1 (traditional stats are broken) and Theme 3 (small samples plague cricket) arriving together. The "traditional" statistics — batting average, bowling average, wickets — are the least reliable. The quiet process statistics — dot %, economy, boundary % — are the most reliable. We will lean on that fact in Chapter 8 and Chapter 14.

🔍 Why this works — why dot % repeats and wickets don't. Every ball contributes information to a dot-ball rate: 300 balls give you 300 yes/no observations. A wicket rate in T20 uses those same 300 balls but the "yes" happens only about 15 times. The information is in the rare events, and rare events are noisy. Statisticians would say the dot-ball rate has a much larger effective sample size. The practical rule: when a rate is built on rare events (wickets, dismissals, sixes for a low-hitting batter), demand a much bigger sample before you believe it.

🔄 Check your understanding 1. In the IPL, which repeats better season to season: a batter's strike rate or his batting average? By roughly how much? 2. A bowler took 25 wickets last IPL season and 12 this season. Using the table, is the drop more likely to be skill or luck?

Answer

  1. Strike rate (r = 0.476) repeats about twice as strongly as average (r = 0.232) for batters with 150+ balls in both seasons.
  2. Mostly luck. IPL bowling average and strike rate barely repeat (r = 0.07 and 0.12), so wicket tallies swing a lot without any change in the bowler. Check his economy and dot % — those repeat (0.52, 0.57) and tell you far more about whether anything really changed.

6.3 How Many Balls Before a Stat Means Something?

The cricket question: a debutant has faced 60 balls. How much should I trust his strike rate?

Season-to-season correlation tells us about "a season". But seasons vary in length, and we want a rule for any sample. So we run a cleaner experiment: split-half reliability.

Take every IPL batter who has faced at least 2n balls in his career. Draw 2n of his balls at random, split them into two halves of n, and compute the statistic in each half. Do that for every batter, then correlate the first halves with the second halves across batters. Because both halves come from the same batter over the same career, any disagreement between them is noise. Repeat for n = 25, 50, 100, … 600, averaging twenty random splits each time.

for n in NS:
    eligible = [k for k, v in by_batter.items() if len(v) >= 2 * n]
    for rep in range(20):                          # average over 20 random splits
        h1, h2 = [], []
        for k in eligible:
            arr = by_batter[k]
            idx = rng.choice(len(arr), size=2 * n, replace=False)
            h1.append(arr[idx[:n]].mean(axis=0))
            h2.append(arr[idx[n:]].mean(axis=0))
        h1, h2 = np.array(h1), np.array(h2)
        for name, j in STATS.items():
            res.append((n, len(eligible), rep, name, np.corrcoef(h1[:, j], h2[:, j])[0, 1]))

by_batter is a dictionary mapping each batter to a NumPy array with one row per ball faced and four columns (runs, dot yes/no, boundary yes/no, dismissed yes/no). rng.choice(..., replace=False) shuffles and picks 2n distinct balls; the first n indices make half one, the rest half two.

B. Split-half reliability (mean of 20 random splits), IPL 2008-2026, balls faced
stat  batters  boundary-ball %  dismissal rate  dot %  strike rate
n                                                                 
25        416            0.300           0.131  0.307        0.343
50        320            0.399           0.167  0.331        0.390
100       227            0.534           0.259  0.490        0.525
150       186            0.620           0.290  0.563        0.617
200       158            0.663           0.333  0.633        0.648
300       127            0.675           0.345  0.696        0.665
400       104            0.744           0.352  0.758        0.730
600        78            0.783           0.392  0.801        0.781

Fitted stabilisation constant k (reliability = 0.5 at n = k balls):
  strike rate      k =     98 balls   (r at 120 balls = 0.55, at 300 = 0.75)
  dot %            k =    109 balls   (r at 120 balls = 0.52, at 300 = 0.73)
  boundary-ball %  k =     96 balls   (r at 120 balls = 0.55, at 300 = 0.76)
  dismissal rate   k =    554 balls   (r at 120 balls = 0.18, at 300 = 0.35)

Full script: code/01_reliability.py (part B).

There is a beautifully simple curve hiding in these numbers. If a statistic is "true talent plus independent noise", the reliability of an n-ball sample follows

📐 Definition — the stabilisation constant k. Reliability(n) = n / (n + k), where k = (variance of one ball) / (variance of true talent between players). k is the sample size at which a statistic is half signal, half noise. Small k: the stat settles quickly. Large k: it needs a lot of evidence. (Baseball analysts call the same idea a stat's "stabilisation point"; Tango, Lichtman and Dolphin's The Book uses it throughout.)

We fit k to each column with scipy.optimize.curve_fit, which finds the k that makes the curve pass closest to the observed points.

Line chart of split-half reliability against balls per half, IPL 2008–2026. Strike rate, dot percentage and boundary-ball percentage rise together, crossing 0.5 near 100 balls; dismissal rate rises slowly and stays below 0.4 even at 600 balls

📊 Figure (described): Split-half reliability (y) against balls in each half (x) for four batting statistics in the IPL. Strike rate, dot % and boundary-ball % climb together and cross the 0.5 line at about 100 balls (fitted k ≈ 96–109). The dismissal rate — the engine of batting average — climbs far more slowly (fitted k ≈ 554) and is still under 0.4 at 600 balls. The dashed vertical line marks n = 120.

The headline: in the IPL, strike rate, dot % and boundary % are half signal after about 100 balls; the dismissal rate — and so the batting average — needs about 550. An established top-order batter reaches 100 balls within a handful of innings, but 550 balls is one to two full IPL seasons (Kohli faced 1,340 balls across 2024–26; Abhishek Sharma 739). That asymmetry explains the whole of §6.2 and, as we will see in Chapter 25, it decides how heavily each stat must be regressed when we forecast.

Be honest about the method's limits. The pool of batters shrinks as n grows (416 batters can supply 50 balls; only 78 can supply 1,200), and the survivors at large n are established players whose true abilities are more alike — which drags reliability down at the top end. That is visible in the dismissal-rate points flattening below the fitted curve. Balls drawn from a ten-year career also mix a batter's younger and older selves. Treat the k values as good working estimates for the modern IPL, not physical constants. Different competitions (women's cricket, Tests) have different noise and different spreads of talent, so their k values differ — you will compute some in the exercises.

🧩 Productive struggle. Before reading on, try this. A batter in his first IPL season has faced 120 balls at a strike rate of 180. The league strike rate is 150. Using only the reliability curve (k ≈ 100 balls for strike rate), what single number would you bet on as his "true" strike rate? Write it down, and write down why before you look at §6.6.

One way to think about it

Reliability at 120 balls is 120 / (120 + 100) ≈ 0.55. So about 55% of his 30-point excess over the league is signal: 150 + 0.55 × 30 ≈ 166. You have just done empirical-Bayes shrinkage — §6.6 makes it formal and tests whether it actually predicts better.


6.4 Regression to the Mean: Why Hot Starts Cool

🚪 Threshold concept: small samples and regression to the mean. Every observed number is true ability + luck. When you select players because their number is extreme — the top of a leaderboard, the hottest start, the worst slump — you are selecting, in part, for extreme luck. Luck doesn't repeat, so next time their numbers move back toward the middle. This is not a force acting on players. It is a property of selecting on noisy numbers. Once you see it, you see it everywhere: the "second-season syndrome", the "curse" of the magazine cover, the "Player of the Tournament" who disappoints the next year, the bowler "found out" after a brilliant first season. Most of those stories are regression to the mean wearing a costume.

Back to the hook. We split every IPL batter-season from 2009 to 2026 into the batter's first five innings and the rest of the season, and compared both with his IPL record before that season. To keep the comparison fair, a batter-season enters only if the batter had five innings with at least 50 balls in them, at least 60 more balls afterwards, and at least 200 career IPL balls beforehand.

per = batting_summary(balls, by=["batter", "year", "start_date", "game"]).reset_index()
per = per[per["balls"] > 0].sort_values(["batter", "start_date", "game"])
per["inn_no"] = per.groupby(["batter", "year"]).cumcount() + 1

first5 = per[per["inn_no"] <= 5].groupby(["batter", "year"]).apply(agg, include_groups=False)
rest = per[per["inn_no"] > 5].groupby(["batter", "year"]).apply(agg, include_groups=False)
season = per.groupby(["batter", "year"]).apply(agg, include_groups=False)
cum = season.groupby(level="batter")[["runs", "balls", "outs"]].cumsum() - season[["runs", "balls", "outs"]]

Two idioms carry this. groupby(...).cumcount() + 1 numbers each batter's innings within a season in date order: 1, 2, 3… so inn_no <= 5 picks the first five. And cumsum() minus the current row gives "everything before this season" — a running career total that excludes the season being judged. (The column game is a copy of match_id; we copy it because batting_summary already uses match_id internally to count innings.)

Batter-seasons in the study: 577 (IPL 2009-2026)
Slope of (rest - prior) on (first five - prior): 0.306
Correlation first-five SR vs rest-of-season SR: 0.427
Correlation prior SR vs rest-of-season SR:      0.375

Pooled strike rates by first-five quintile:
                n  SR_first5  SR_rest  SR_prior
quintile                                       
Q1 coldest  117.0      106.2    125.6     129.5
Q2          114.0      124.1    132.3     131.4
Q3          115.0      136.0    134.1     133.2
Q4          116.0      148.9    142.2     135.3
Q5 hottest  115.0      176.1    153.4     138.8

Hot starts by average (first-five average >= 50): 103 batter-seasons
  pooled first-five average: 66.83
  pooled rest-of-season avg: 37.21
  pooled prior IPL average:  33.66
  share whose rest-of-season average was lower than their first-five average: 94.2%

Full script: code/02_hot_starts.py.

Left: scatter of first-five-innings strike rate against rest-of-season strike rate for 577 IPL batter-seasons, with a fitted line much flatter than y = x. Right: grouped bars by quintile of first-five strike rate showing prior, first-five and rest-of-season strike rates

📊 Figure (described): Left: each dot is an IPL batter-season; the first-five-innings strike rate (x) against the rest-of-season strike rate (y). The fitted line is far flatter than the dashed y = x line. Right: the batter-seasons grouped into fifths by how hot their start was. For the hottest fifth, the orange "first five" bar (176) towers over the purple "before the season" bar (139), and the blue "rest of season" bar (153) sits between them. For the coldest fifth the pattern flips. Every group's rest-of-season bar is pulled toward its prior.

Three things to take from this.

First, regression is partial, not total. The slope of 0.306 says about 30% of a hot (or cold) start's departure from a batter's prior survived into the rest of the season, and about 70% evaporated. Rahane is a near-perfect illustration: 78 points above his prior in the first five innings, 19 points above it for the rest of the season — about a quarter survived.

Second, averages regress far more violently than strike rates. The 103 batter-seasons that began with a first-five average of 50 or more averaged a pooled 66.83 in those innings and 37.21 for the rest of the season, against 33.66 before. Nearly all of the hot start vanished, and 94.2% of those batters averaged less over the rest of the season than in their first five. That is exactly what §6.3 predicted: five innings contain at most five dismissals, and a statistic with k ≈ 550 balls is almost pure noise over 100.

Third, the recent past can beat the old past. Look at the two correlations: the first-five strike rate (0.427) correlated more strongly with the rest of the season than the career-to-date strike rate did (0.375). Isn't that a contradiction? No. The career prior is stale — it includes a batter's 2012 self — and the IPL itself changed under everyone's feet: the league's average first-innings total rose from 171.1 in 2022 to 183.0 in 2023 and 195.7 in 2026. A good forecast blends the two, which is exactly what the Bayesian machinery in §6.6 and §6.10 does.

Here are the hottest starts of the impact-player era and what came next:

Hottest first-five strike rates, IPL 2023-2026 (same filters):
         batter  year  runs_f5  balls_f5  sr_f5  runs_rest  balls_rest  sr_rest  sr_prior
  Priyansh Arya  2026      211        85  248.2        153          87    175.9     182.3
       N Pooran  2025      288       128  225.0        236         139    169.8     162.3
       N Pooran  2023      141        65  216.9        217         142    152.8     151.2
       TH David  2026      147        68  216.2        158          94    168.1     173.4
Abhishek Sharma  2026      129        60  215.0        434         215    201.9     163.0
     RM Patidar  2026      222       104  213.5        279         156    178.8     154.3
        SS Iyer  2025      250       120  208.3        354         225    157.3     127.5
Abhishek Sharma  2024      177        85  208.2        307         152    202.0     137.4
      AM Rahane  2023      209       105  199.0        117          84    139.3     120.7
     GJ Maxwell  2023      176        89  197.8        224         129    173.6     153.9
  10 of 10 scored more slowly for the rest of the season

All ten slowed down. But look at Abhishek Sharma in 2024: a first-five strike rate of 208.2 against a prior of 137.4, and then 202.0 for the rest of the season. That was not luck evaporating; that was a batter who had genuinely changed, and whose prior was out of date. Regression to the mean is the right default. It is not a law that every surge is fake. The skill of the analyst is knowing when the prior has gone stale — a young player developing, a change of role, a new technique — and that is precisely where watching cricket earns its keep.

🏏 Eye test:

Wendell: So your numbers say Abhishek was "real" and Rahane was "mostly luck". Fine. But you only knew that afterwards. In April, both of them looked like the same line on your spreadsheet.

Narrator: True. In April the data alone says: expect each to keep about a third of the surge.

Wendell: And that's where I come in. If it's a youngster who's hitting the ball cleaner every week, that's one story. If it's a veteran with fifteen years and nearly 150 IPL matches behind him, that's another. Age, role, how he's getting out, whether he's changed his set-up — I'd watch the footage before I bet on either.

Narrator: And that's a prior. You're telling the model how much its old information should count. Chapter 25 turns "young players improve, older players are who they are" into an aging curve. Until then, your eyes are the best tool we have for deciding when the past has stopped being a good guide.

🔄 Check your understanding 1. In the 2009–2026 hot-start study, roughly what share of a hot start's strike-rate excess over the batter's prior survived into the rest of the season? 2. Why did hot starts measured by average collapse so much more completely than hot starts measured by strike rate?

Answer

  1. About 30% (the fitted slope was 0.306).
  2. Average has dismissals in the denominator; five innings hold at most five dismissals, and the dismissal rate needs roughly 550 balls to be half signal (§6.3). Strike rate uses every ball, so it stabilises five times faster (k ≈ 100 balls).

6.5 How Sure Are We? Bootstrap Intervals

The cricket question: Vaibhav Suryavanshi's IPL strike rate is 229. Is he really a 229 batter, or could he be a 200 batter who got lucky?

A number without an interval is a claim without a confidence level. The most practical way to put an interval around a cricket statistic is the bootstrap, and it needs no formulas at all.

📐 Definition — bootstrap confidence interval. Treat the sample you have as a stand-in for the population. Draw a new sample of the same size from your sample, with replacement, recompute the statistic, and repeat thousands of times. The middle 95% of the recomputed values is a 95% bootstrap interval: a range of values for the true statistic that are consistent with the data. In cricket we resample innings, not balls (a cluster bootstrap), because balls within an innings are not independent — the same batter, the same pitch, the same match situation.

def bootstrap(inns: pd.DataFrame, stat: str, b: int = B, seed: int = 6) -> np.ndarray:
    """Cluster bootstrap: resample innings, recompute pooled SR or average."""
    rng = np.random.default_rng(seed)
    idx = rng.integers(0, len(inns), size=(b, len(inns)))
    runs = inns["runs"].to_numpy()[idx].sum(axis=1)
    if stat == "sr":
        return 100 * runs / inns["balls"].to_numpy()[idx].sum(axis=1)
    outs = inns["outs"].to_numpy()[idx].sum(axis=1).astype(float)
    outs[outs == 0] = np.nan                        # a resample with no dismissals has no average
    return runs / outs

The whole bootstrap is four lines of NumPy. rng.integers(0, len(inns), size=(b, len(inns))) builds a grid of random innings numbers — 5,000 rows, each a fresh "career" of the same length drawn with replacement. Indexing the runs array with that grid and summing along each row gives 5,000 resampled run totals in one step, with no Python loop. Notice that we pool: strike rate is total runs over total balls, never the average of per-innings strike rates.

Strike rate with 95% innings-bootstrap intervals (5,000 resamples, seed 6)
                               sample  inns  balls    SR  lo95  hi95  width  naive_width  sd_per_ball
AM Rahane — IPL 2023, first 5 innings     5    105 199.0 150.0 229.3   79.3         71.9          1.9
       SV Samson — T20 World Cup 2026     5    161 199.4 184.8 217.2   32.4         66.1          2.1
 V Suryavanshi — IPL career (2025–26)    23    449 229.0 200.6 255.7   55.1         44.1          2.4
        Abhishek Sharma — IPL 2024–26    44    739 201.1 179.9 220.8   41.0         31.6          2.2
         NR Sciver-Brunt — WPL career    36    936 144.0 131.9 155.2   23.3         20.5          1.6
                V Kohli — IPL 2024–26    46   1340 154.7 146.4 162.8   16.4         18.4          1.7
  naive_width = normal interval treating balls as independent; sd_per_ball = SD of runs off one ball

Full script: code/03_bootstrap_ci.py.

Forest plot of strike rates with 95% bootstrap intervals for six samples, from Rahane's five innings in IPL 2023 (interval 150 to 229) to Kohli's IPL 2024–26 (146 to 163)

📊 Figure (described): Each horizontal bar is a 95% bootstrap interval around a strike rate (black dot). Rahane's first five innings of 2023 span 150 to 229 — a range covering "ordinary modern opener" to "superstar". Suryavanshi's IPL career (449 balls) spans 201 to 256: almost certainly exceptional, but the exact level is uncertain. Kohli's 1,340 balls in 2024–26 pin his strike rate to 146–163. Bars shorten as samples grow.

So: is Suryavanshi "really" a 229 batter? The data says his true IPL strike rate is very probably above 200 — a remarkable statement on 449 balls — but anything from about 200 to 256 is consistent with what we have seen. Compare Kohli: three seasons and 1,340 balls narrow his interval to about 16 points wide. The width shrinks roughly with the square root of the sample, so to halve an interval you need four times the balls.

Look at the last column, too. Suryavanshi's per-ball SD is 2.4 runs; Sciver-Brunt's is 1.6. A six-hitter's outcomes are more spread out, so the same number of balls buys a wider interval. Two batters with identical strike rates and identical balls faced can deserve different amounts of confidence.

⚠️ Common pitfall: bootstrapping five innings. Look at Samson's T20 World Cup 2026 row: five innings, and the bootstrap interval (32 points wide) is narrower than the naive ball-by-ball interval (66 points). That is the bootstrap failing, not Samson being reliable. With five clusters there are only so many ways to reshuffle the data. Samson's three big innings went at strike rates of 194, 212 and 193 — strikingly similar — and his two short ones totalled 23 balls, so the resamples barely vary. The bootstrap needs a reasonable number of clusters — think 15–20 innings or more. Below that, report the naive interval (or the Bayesian one from §6.10) and say plainly that the sample is too small to be sure of anything.

When we compare intervals across larger samples, the cluster bootstrap is usually a little wider than the naive interval (Suryavanshi 55 vs 44 points, Abhishek 41 vs 32), because a batter's balls within an innings move together: a set batter in a flat-track chase faces a run of easy balls. Kohli's row is the exception — his innings are unusually consistent in tempo — which is a reminder that the bootstrap measures the data you have, not a textbook ideal.

Intervals around averages: the dismissal count is the sample

Averages are where intervals get humbling.

Batting average with 95% innings-bootstrap intervals
                              sample  inns  outs  average  lo95  hi95  width
L Wolvaardt — Women's World Cup 2025     9     8     71.4  36.5 117.9   81.4
               EA Perry — WPL career    25    15     64.8  43.2 104.3   61.1
        NR Sciver-Brunt — WPL career    36    27     49.9  34.3  72.9   38.6
                    HC Brook — Tests    70    68     53.1  40.7  67.5   26.8
   SPD Smith — Tests (from Dec 2001)   227   199     55.3  47.3  63.9   16.7
                     JE Root — Tests   309   283     50.5  44.1  57.4   13.4

Brook minus Root, Test average: point 2.64; 95% interval -11.7 to 17.9; share of resamples with Brook ahead 63.6%

Forest plot of batting averages with 95% bootstrap intervals: Wolvaardt's Women's World Cup 2025 spans 37 to 118, Perry's WPL career 43 to 104, down to Root's Test career 44 to 57

📊 Figure (described): Batting averages (black dots) with 95% bootstrap intervals for three women's samples and three men's Test careers. Laura Wolvaardt's 71.4 in the 2025 Women's World Cup rests on eight dismissals and spans 37 to 118. Ellyse Perry's WPL average of 64.8 rests on 15 dismissals and spans 43 to 104. Joe Root's Test average, built on 283 dismissals, spans only 44 to 57. The intervals shrink as dismissals — not innings, not runs — accumulate.

Ellyse Perry's WPL average of 64.80 is the highest of any batter with 100+ WPL balls in the book's data. It is built on 15 dismissals, and its bootstrap interval runs from 43 to 104. Nat Sciver-Brunt's 49.93 rests on 27 dismissals. We genuinely cannot tell from WPL data alone which of them is the more reliable run-scorer; we can say both are very good.

And the Test comparison everyone wants to have: Harry Brook averages 53.09 in the Cricsheet Tests, Joe Root 50.45. Is Brook better? Bootstrapping the difference gives a 95% interval from −11.7 to +17.9 runs, with Brook ahead in 63.6% of resamples. That is barely better than a coin-flip's worth of evidence. Brook's 68 dismissals simply cannot outvote the noise. (Root's average here covers only the Tests in Cricsheet's ball-by-ball data, which begins in December 2001; official career figures can differ slightly.)

🔷 R corner (not run in this book's build) — the same innings bootstrap in base R: r inns <- read.csv("perry_wpl_innings.csv") # columns: runs, balls, outs set.seed(6) boot_avg <- replicate(5000, { s <- inns[sample(nrow(inns), replace = TRUE), ] if (sum(s$outs) == 0) NA else sum(s$runs) / sum(s$outs) }) quantile(boot_avg, c(0.025, 0.975), na.rm = TRUE)

📋 Try it — Evaluate this player. Using code/03_bootstrap_ci.py, add Smriti Mandhana's WPL career and her women's T20I career (load_deliveries("t20s_female")). Report each strike rate with its 95% interval. Do the intervals overlap? What does that tell you about whether she scores faster in the WPL than for India?

Worked approach

Call innings_table(wpl, "S Mandhana") and innings_table(t20s_female, "S Mandhana"), then bootstrap(..., "sr") on each. Her WPL record in the snapshot is 1,023 runs off 748 balls (SR 136.76); her T20I record is 4,612 runs off 3,552 balls (SR 129.84). With 35 WPL innings and 157 T20I innings, expect the WPL interval to be roughly twice as wide as the T20I one. If they overlap substantially, the data cannot distinguish a "WPL Mandhana" from an "India Mandhana" — and you should resist the narrative that she bats differently in franchise cricket until the sample grows.

🔄 Check your understanding 1. Why do we resample innings rather than individual balls in a cricket bootstrap? 2. Brook's Test average is 53.09 and Root's 50.45. The 95% interval for the difference runs from −11.7 to +17.9. What can you honestly say?

Answer

  1. Balls within an innings share a batter's form, the pitch and the match situation, so they are not independent; resampling whole innings keeps that dependence and gives honest (usually wider) intervals.
  2. That the data cannot tell them apart: the interval comfortably includes zero, and Brook is ahead in only about 64% of resamples. "Brook has the higher average so far" is true; "Brook is the better Test batter" is not established by these numbers.

6.6 Shrinkage: Blending What You Saw With What You Knew

The cricket question: an IPL batter has 64 balls at a strike rate of 201.6. Another has 330 balls at 182.4. Who is more likely to be the faster scorer?

The interval tells you how uncertain a number is. Shrinkage gives you a single best estimate that already accounts for the uncertainty. The idea is the one you used in the productive-struggle box: pull each observed number toward a sensible central value, by an amount that depends on how much evidence the number rests on.

📐 Definition — normal–normal (empirical Bayes) shrinkage. shrunk rate = (n × observed rate + k × prior mean) / (n + k) where n is the sample (balls), the prior mean is what you would guess with no data on this player (e.g. the league strike rate), and k = σ²/τ² is the prior's worth in balls: σ² is the variance of one ball, τ² the variance of true talent between players. A batter with n = k balls is pulled exactly halfway to the prior. "Empirical Bayes" means we estimate the prior from the population of players itself.

Estimating k from one season

How do we get τ², the spread of true talent? We can't observe true talent directly, but we can observe the spread of observed strike rates and subtract the part that noise alone would produce. That is the method of moments: observed variance = true variance + noise variance.

def k_method_of_moments(year: int, min_balls: int = 30) -> dict:
    """k = per-ball variance / true-talent variance, from one season's spread of SRs."""
    s = seasons[(seasons["year"] == year) & (seasons["balls"] >= min_balls)]
    r = 100 * faced.loc[faced["year"] == year, "runs_batter"]
    sigma2 = r.var()                                   # noise of a single ball
    w = s["balls"]
    obs_var = np.average((s["strike_rate"] - np.average(s["strike_rate"], weights=w)) ** 2, weights=w)
    noise_var = sigma2 * len(s) / w.sum()              # sigma^2 / (typical n)
    tau2 = obs_var - noise_var                         # what's left is real spread in ability
    return {... "k": sigma2 / tau2}
A1. Method-of-moments k by IPL season (batters >= 30 balls)
 year  batters  league_sr  sd_ball  sd_obs  sd_noise  sd_true     k
 2022      102      133.9    171.6    20.5      13.5     15.4 123.6
 2023       99      141.7    173.9    19.2      13.5     13.7 161.2
 2024      101      150.6    181.3    22.6      14.5     17.3 109.8
 2025       98      152.5    182.2    19.5      14.3     13.3 187.7
 2026      101      156.3    186.5    24.0      14.8     18.8  98.1

Full script: code/04_shrinkage.py.

Each season tells the same story. The observed strike rates of IPL batters (30+ balls) spread with an SD of about 19–24 points; noise alone would produce about 14; what is left — the true-talent spread — is about 13–19 points. Every season, roughly 40–55% of the variance you see on an IPL strike-rate leaderboard is noise. The resulting k ranges from about 100 to 190 balls, sitting right on top of the split-half estimate of 98 from §6.3. Two completely different methods agree, which is the best evidence you can get that the number means something.

Applied to IPL 2026 (with that season's k of 98 balls), shrinkage reorders the top of the table:

A3. IPL 2026 (league SR 156.34), top 10 raw strike rates (>= 30 balls) and their shrunk values:
         batter  runs  balls  strike_rate  shrunk_sr
  V Suryavanshi   776    327        237.3      218.6
       FH Allen   349    163        214.1      192.4
  Priyansh Arya   364    172        211.6      191.6
Abhishek Sharma   563    275        204.7      192.0
    Urvil Patel   129     64        201.6      174.2
     RM Patidar   501    260        192.7      182.7
 Shashank Singh   132     70        188.6      169.8
       TH David   305    162        188.3      176.2
   RD Rickelton   448    240        186.7      177.9
        VR Iyer   209    112        186.6      172.5

    Top 10 by SHRUNK strike rate:
         batter  runs  balls  strike_rate  shrunk_sr
  V Suryavanshi   776    327        237.3      218.6
       FH Allen   349    163        214.1      192.4
Abhishek Sharma   563    275        204.7      192.0
  Priyansh Arya   364    172        211.6      191.6
     RM Patidar   501    260        192.7      182.7
   RD Rickelton   448    240        186.7      177.9
   Ishan Kishan   602    330        182.4      176.4
       TH David   305    162        188.3      176.2
    Urvil Patel   129     64        201.6      174.2
      JP Inglis   266    143        186.0      173.9

Scatter of IPL 2026 batters' observed strike rate against balls faced on a log scale, with arrows from each observed value to its shrunk value; arrows are long on the left (few balls) and short on the right

📊 Figure (described): Every IPL 2026 batter with 30+ balls. Orange dots are observed strike rates; blue dots are shrunk estimates; grey arrows connect them; the dashed line is the league strike rate (156.3). On the left (30–60 balls) the arrows are long — a batter at 80 is pulled up to about 138 — while on the right (300+ balls) they are barely visible. Shrinkage is strong where evidence is weak and gentle where evidence is strong.

So, to the question at the head of the section: Urvil Patel's 201.6 off 64 balls shrinks to 174.2; Ishan Kishan's 182.4 off 330 balls shrinks only to 176.4. On the evidence of IPL 2026, Kishan is slightly the better bet to be the faster scorer — even though Patel's raw number is 19 points higher. Kishan and Josh Inglis enter the shrunk top ten; Shashank Singh and Venkatesh Iyer, whose fast numbers rested on 70 and 112 balls, drop out.

Does shrinkage actually predict better? Test it.

Every shrinkage claim should be tested on data the method hasn't seen. We take all 947 consecutive-season pairs in the IPL (batters with at least 30 balls in season N and 60 in season N+1) and ask: which predicts next season's strike rate — measured relative to that season's league, so that the scoring boom doesn't contaminate the test — better: the raw number, or the shrunk one? We try a grid of k values, weighting errors by next season's balls.

A2. 947 consecutive-season pairs, IPL 2008-2026 (>=30 balls in N, >=60 in N+1)
    weighted RMSE predicting next season's SR (relative to league) for each k:
    k=0: 22.96  k=25: 20.66  k=50: 19.48  k=75: 18.76  k=100: 18.28  k=125: 17.94  k=150: 17.70  k=200: 17.38  k=250: 17.21  k=300: 17.10  k=400: 17.02  k=600: 17.03
    raw (k=0) RMSE 22.96; best k on this grid = 400 (RMSE 17.02); league-mean-only RMSE 17.92

    By balls faced in season N (k = 300):
         pairs    raw  shrunk  league_only
bucket                                    
30–59     81.0  41.14   22.71        22.42
60–119   164.0  28.98   17.84        17.23
120–239  360.0  23.05   19.32        20.81
240+     342.0  17.31   14.08        14.90

📐 Definition — RMSE (root-mean-square error). The square root of the average squared forecast error. It is in the same units as the thing forecast (here, strike-rate points) and punishes big misses heavily. Lower is better.

Grouped bar chart of forecast error for next season's strike rate by sample-size bucket, comparing raw, shrunk and league-average forecasts; shrunk is far better than raw in every bucket

📊 Figure (described): Forecast error (weighted RMSE in strike-rate points) for next season's strike rate, grouped by how many balls the batter faced in season N. Orange bars (raw season strike rate) are tallest everywhere — 41 points for batters with 30–59 balls. Blue bars (shrunk with k = 300) are much lower in every group. Olive bars (ignore the player, predict the league average) are close to the blue bars for small samples but worse for batters with 120–239 balls.

Three findings, all practical:

  1. Shrinkage beats the raw number at every sample size, and the gain is enormous for small samples: an error of 41 points falls to 23 for batters with 30–59 balls.
  2. Forecasting wants more shrinkage than describing. Within a season, k ≈ 100–190 balls. To predict next season, the best k is 300–400 balls. Why? Because next season the batter is not quite the same player: role, form, fitness and age all move his true ability a little. That extra drift is more noise from the forecaster's point of view, so the past deserves less weight. Shrinkage constants are purpose-specific; Chapter 25 builds this into proper projections.
  3. For tiny samples, the league average is nearly as good as anything. For batters with fewer than 120 balls, ignoring the player entirely (olive bars) is about as accurate as shrinking. A season's 50 balls tell you almost nothing about next season. If you remember one sentence from this chapter for the auction room, make it that one.

🪞 Learning check-in. Pause and take stock before the second half of the chapter. Can you explain, without notation, why a 64-ball strike rate should be pulled further toward the league average than a 330-ball one? Could you explain to a friend why the forecasting shrinkage is stronger than the descriptive shrinkage? If either explanation feels shaky, reread the productive-struggle box in §6.3 and the three findings above — they are the same idea seen twice. Notice, too, how you feel about the claim that "roughly half of a leaderboard's variance is noise". If it sounds wrong, that is your intuition meeting the threshold concept; keep both in view.

Shrinking averages: the Beta–binomial model

Strike rate is a mean of runs; average is a ratio with dismissals on the bottom. Dismissals are yes/no events, and the natural prior for a yes/no rate is the Beta distribution.

📐 Definition — Beta–binomial shrinkage. Model each batter's per-ball dismissal probability p as drawn from a Beta(a, b) distribution fitted to the population. After the batter is out s times in t balls, the posterior mean is (s + a) / (t + a + b). The prior behaves like a dismissals in a + b extra balls; a + b is its worth in balls. A shrunk batting average is then (shrunk runs per ball) / (shrunk dismissal rate).

We fit the prior to the WPL — 65 batters with 60+ balls — and apply it to the competition's highest averages.

pool = wbat[wbat["balls"] >= 60].copy()
p = pool["outs"] / pool["balls"]
m = np.average(p, weights=pool["balls"])
v_obs = np.average((p - m) ** 2, weights=pool["balls"])
v_noise = m * (1 - m) * len(pool) / pool["balls"].sum()
v_true = max(v_obs - v_noise, 1e-6)
ab = m * (1 - m) / v_true - 1                          # a + b, the prior's worth in balls
a, b = m * ab, (1 - m) * ab
B. WPL Beta prior for dismissal rate per ball (batters >= 60 balls, n = 65):
    mean 0.0508 (one dismissal every 19.7 balls); a = 13.4, b = 250.9; prior worth a + b = 264 balls
    League runs per ball 1.300; SR shrinkage k = 100 balls
    Highest raw WPL averages (>= 100 balls) and their shrunk averages:
         batter  innings  runs  balls  outs  average  avg_shrunk
       EA Perry       25   972    731    15    64.80       46.45
NR Sciver-Brunt       36  1348    936    27    49.93       42.37
         G Voll        9   324    226     7    46.29       33.44
         H Kaur       34  1193    820    26    45.88       39.56
     MM Lanning       35  1200    947    32    37.50       33.88
       NJ Carey        6   149    105     4    37.25       28.86
      BL Mooney       27   780    601    22    35.45       31.72
       RM Ghosh       33   814    539    24    33.92       31.72
  Shafali Verma       37  1124    739    34    33.06       31.63
    L Wolvaardt       23   659    506    20    32.95       30.01

Perry's 64.80 becomes 46.45 — still the best in the competition, but no longer 15 runs clear of everyone. Georgia Voll's 46.29 from nine innings becomes 33.44: promising, unproven. The ordering at the top survives; the gaps shrink to what the evidence supports. That is shrinkage working as it should — it does not flatten everyone into the league average, it scales each claim to its evidence. (The method of moments here uses the same idea as for strike rate: observed spread of dismissal rates minus the binomial noise expected from each batter's balls.)

⚠️ Common pitfall: shrinking toward the wrong centre. We shrank every WPL batter toward the league dismissal rate, which includes lower-order hitters who come in to swing at the death. Top-order batters are a different population; pulling an opener toward a number partly made by number-eights is unfair to her. In practice you shrink toward the mean of a comparable group (same role, same batting position, same competition) — or, better, model the centre too. Chapter 11's hierarchical matchup model and Chapter 25's projections do exactly that.

🔄 Check your understanding 1. In IPL 2025, the observed SD of batters' strike rates was 19.5, noise SD 14.3. What was the true-talent SD, roughly? 2. A batter has faced exactly k balls. How far toward the prior does normal shrinkage pull him? 3. Why is the best k for forecasting next season (≈300–400) bigger than the within-season k (≈100–190)?

Answer

  1. √(19.5² − 14.3²) ≈ 13.3 — matching the script's output.
  2. Exactly halfway: n = k gives equal weights to observed and prior.
  3. Next season's true ability differs a little from this season's (role, age, form), adding season-to-season drift that behaves like extra noise; the past deserves less weight, so the forecast leans harder on the prior.

6.7 Simpson's Paradox: Better in Every Phase, Worse Overall

The cricket question: can one batter have a higher strike rate than another in the powerplay, the middle overs and the death — and still have the lower strike rate overall?

It sounds impossible. It is not only possible; in the IPL it is common. Chapter 4 previewed a bowling version of this trap with Jasprit Bumrah's and R Ashwin's IPL economy rates by phase; here is the batting version, and then a Test one. We searched every pair of IPL batters with at least 60 career balls in each phase.

for i in range(len(names)):
    better_all = (sr[i] > sr).all(axis=1)        # i beats j in every phase
    worse_overall = ov[i] < ov                     # ...but j is ahead overall
    for j in np.where(better_all & worse_overall)[0]:
        found.append((names[i], names[j], (sr[i] - sr[j]).min(), ov[j] - ov[i], min(tot[i], tot[j])))

The search is vectorised against every other batter at once: sr is a players × phases array, so sr[i] > sr compares batter i's three phase strike rates with everyone's, and .all(axis=1) asks "higher in all three phases?" for each opponent in one line.

Search 1: IPL batters with >= 60 balls in every phase: 111
  pairs showing the paradox: 168

  The worked pair: RG Sharma vs MS Dhoni (IPL 2008-2026)
           RG Sharma balls  RG Sharma SR  RG Sharma share  MS Dhoni balls  MS Dhoni SR  MS Dhoni share
phase                                                                                                 
powerplay           2028.0         126.4             36.8            72.0         81.9             1.8
middle              2643.0         122.5             47.9          1903.0        100.5            48.1
death                843.0         181.1             15.3          1982.0        175.0            50.1
OVERALL             5514.0         132.9            100.0          3957.0        137.5           100.0
  League phase mix of balls faced: powerplay 31.4%, middle 46.1%, death 22.5%
  Phase-standardised SR: RG Sharma 136.9 vs MS Dhoni 111.4

Full script: code/05_simpsons_paradox.py.

Left: grouped bars of strike rate by phase for Rohit Sharma and MS Dhoni, with Rohit higher in powerplay, middle and death but lower overall. Right: stacked bars of each batter's share of balls faced by phase — Dhoni 50% at the death, Rohit 15%

📊 Figure (described): Left: Rohit Sharma (blue) out-scores MS Dhoni (orange) in the powerplay (126 vs 82), the middle overs (123 vs 100) and the death (181 vs 175) — yet Dhoni's overall IPL strike rate is higher (137 vs 133). Right: the reason. Half of Dhoni's IPL balls (50%) came at the death, where everyone scores fastest; only 15% of Rohit's did, with 37% in the powerplay.

📐 Definition — Simpson's paradox. A comparison that holds in every subgroup reverses when the subgroups are pooled, because the two sides have different mixes of subgroups and the subgroups have different baselines. The pooled number answers "who scored faster across the balls they actually faced?"; the subgroup numbers answer "who scored faster in like-for-like situations?".

Rohit Sharma has the higher strike rate in every phase of the IPL. MS Dhoni has the higher overall strike rate — 137.5 against 132.9 (the same career figures as the book's reference tables: 137.45 and 132.92). Both statements are true. The overall number rewards Dhoni for when he batted, not how. Half his IPL balls came in overs 16–20, where the league scores fastest; Rohit opened, and faced 37% of his balls under powerplay restrictions where even quick batters score slower than at the death.

The fix is standardisation: compute each batter's strike rate as if he had faced the same mix of phases — here the league's mix of balls faced (31.4% powerplay, 46.1% middle, 22.5% death). On a level field, Rohit's standardised strike rate is 136.9 and Dhoni's 111.4. That is not a verdict on who was more valuable — Dhoni's job was to finish, and he finished at a career death strike rate of 175 — but it does show that the raw overall strike rate is no basis for comparing an opener with a finisher. This is the statistical root of Chapter 8's insistence on phase-specific metrics. The same paradox appears with Kohli and Dhoni (Kohli higher in every phase by at least 13 points, lower overall by 2.66) and with several openers against Dinesh Karthik and David Miller.

The Test version: home and away

The version of this paradox people usually describe — "A averages more than B at home and away, but B averages more overall" — also exists in real Test data. Searching the 216 Test batters (in the Cricsheet Tests from December 2001) with at least 15 dismissals both at home and away found 36 pairs. The cleanest involves two great batters:

  The worked Test pair: Younis Khan vs KS Williamson
               avg_home  avg_away  avg_all  home_share   outs
batter                                                       
Younis Khan       67.22     48.26    51.81        0.19   96.0
KS Williamson     65.77     40.95    53.13        0.49  165.0
  (home/away averages exclude neutral venues; overall here = home + away only)

Younis Khan averaged more than Kane Williamson at home (67.22 vs 65.77) and away (48.26 vs 40.95), yet Williamson's home-plus-away average is higher (53.13 vs 51.81). Williamson made 49% of his home-plus-away dismissals at home, where batting is easier; Younis made only 19% of his there. Why so few? Because for most of the 2010s Pakistan's "home" Tests were played in the UAE — a neutral venue in this book's venue table. Case Study 2 tells the whole story.

🔄 Check your understanding 1. Name the two ingredients that must both be present for Simpson's paradox to appear. 2. Rohit's phase-standardised IPL strike rate is 136.9, Dhoni's 111.4. What mix of balls were they standardised to, and why that mix?

Answer

  1. (a) The subgroups have different baselines (death overs score faster than the powerplay; home Tests are easier than away Tests) and (b) the two players have different mixes of subgroups.
  2. The league's overall mix of balls faced (31.4% powerplay, 46.1% middle, 22.5% death). Any common mix removes the paradox; the league mix is a natural "typical batter's workload". A different common mix would change the numbers but not the conclusion here, because Rohit is ahead in every phase.

6.8 Selection on the Outcome: The "Averages More in Wins" Trap

The cricket question: Rohit Sharma averages 58.46 in ODIs India won and 36.01 in ODIs India lost. Does he "perform when it matters" — or does something else explain it?

This is Anchor C, the batting-average illusion, which Chapter 4 introduced as a causation trap. Here we test it properly. If Rohit's split were special, most other batters would not show it. So we compute the same split for every ODI batter with at least 20 innings in wins and 20 in losses — men and women.

b["res"] = np.where(b["winner"] == b["batting_team"], "won",
            np.where(b["winner"].notna(), "lost", "other"))
s = batting_summary(b, by=["batter", "res"]).reset_index()

np.where(condition, a, b) is a vectorised if/else: for every ball it labels the batting side's result. Nesting two of them gives three labels — won, lost, other (ties and no-results).

Men's ODIs: 245 batters with >= 20 innings in wins and in losses
  higher average in wins: 230 of 245 (93.9%)
  median average in wins 42.59, in losses 24.69; median ratio 1.65
  median SR in wins 88.77, in losses 77.87
Women's ODIs: 35 batters with >= 20 innings in wins and in losses
  higher average in wins: 34 of 35 (97.1%)
  median average in wins 48.16, in losses 25.77; median ratio 1.92
  median SR in wins 88.63, in losses 69.92

RG Sharma: avg won 58.46 (171 inns), lost 36.01 (96 inns); ratio 1.62 — higher than 47% of the men's group
  V Kohli          won  75.65 (185)  lost  36.68 (108)  ratio 2.06
  AB de Villiers   won  66.35 (132)  lost  36.96 (76)  ratio 1.80
  Babar Azam       won  72.11 (73)  lost  33.05 (62)  ratio 2.18
  JE Root          won  67.88 (97)  lost  34.81 (81)  ratio 1.95
  KS Williamson    won  58.05 (86)  lost  37.77 (73)  ratio 1.54
  Shakib Al Hasan  won  53.97 (86)  lost  29.28 (110)  ratio 1.84
  Tamim Iqbal      won  52.52 (94)  lost  26.44 (117)  ratio 1.99
  S Mandhana       won  63.92 (57)  lost  33.50 (42)  ratio 1.91
  L Wolvaardt      won  63.02 (70)  lost  41.05 (44)  ratio 1.54
  SW Bates         won  55.43 (42)  lost  24.38 (57)  ratio 2.27
  AC Jayangani     won  60.21 (27)  lost  27.93 (56)  ratio 2.16
  H Kaur           won  57.61 (52)  lost  27.20 (49)  ratio 2.12

Full script: code/06_luck_and_selection.py (part A).

Overlaid histograms of each ODI batter's average in wins minus average in losses, for men and women; almost all of the mass lies to the right of zero, and Rohit Sharma's gap of about 22 runs sits in the middle of the men's distribution

📊 Figure (described): For every ODI batter with 20+ innings in both wins and losses, the difference between their average in wins and their average in losses. Men in blue (245 batters), women in orange (35). Almost every bar sits to the right of zero. The dashed green line marks Rohit Sharma (+22.5): squarely in the middle of the pack.

93.9% of men's ODI batters and 97.1% of women's average more in wins. The typical batter averages 1.65 times as much in wins as in losses; Rohit's ratio of 1.62 is below the median. Kohli's is 2.06, Babar Azam's 2.18, Tamim Iqbal's 1.99, Shakib Al Hasan's 1.84; for women, Mandhana 1.91, Chamari Athapaththu (listed in Cricsheet as AC Jayangani) 2.16, Harmanpreet Kaur 2.12. Rohit's split is not evidence that he rises to the occasion. It is evidence that he is an ODI batter.

The mechanism is selection on the outcome: we sorted matches by the result, and the result is partly made of the runs we are measuring. When a top-order batter scores 100, his team usually wins; when he falls for 5, they usually lose. The arrow runs from runs to result, and conditioning on the result guarantees the gap. A cleaner question — does a batter's innings change his team's chance of winning by more than a typical innings would? — needs win probability, which is the subject of Chapter 9 and Chapter 20.

⚠️ Common pitfall: comparing a player to zero instead of to the population. "He averages 22 more in wins" sounds like a finding. The right comparison is with what every comparable player does. Rohit's gap is ordinary once you see the distribution. Whenever a stat is split by an outcome (wins/losses, chases won/lost, finals won/lost), compute the same split for everyone before you call anyone special.

📋 Try it — Settle this debate. A broadcaster claims a bowler "wins matches" because his ODI economy rate is 4.5 in wins and 6.1 in losses. Using bowling_summary and the same res label (from the bowling side's point of view), compute economy in wins and losses for every ODI bowler with 20+ matches in each. What share of bowlers are more economical in wins? Is the broadcaster's bowler special?

Worked approach

Label each ball with whether the bowling team won (winner == bowling_team), call bowling_summary(b, by=["bowler", "res"]), pivot, and filter on matches. Expect the same structural gap as for batting averages, for the same reason: a bowling side that concedes less usually wins. The broadcaster's bowler is special only if his gap sits well into the tail of that distribution — and even then, sample size (§6.5) decides whether the tail position is meaningful.

🔄 Check your understanding 1. What share of men's ODI batters (20+ innings in wins and in losses) average more in wins? 2. In one sentence, why does splitting by the match result manufacture a gap?

Answer

  1. 93.9% (230 of 245); for women's ODI batters, 97.1% (34 of 35).
  2. Because the result is partly caused by the runs being measured — high scores help produce wins — so sorting matches by result sorts the batter's innings by how well they went.

6.9 Luck vs Skill: How Much of an IPL Table Is Coin-Flips?

The cricket question: a team finishes top of the IPL league table. How much of that was them?

Theme 6 of this book is that variance is not failure. Here is the starkest evidence for it. If every IPL team were exactly equal — every match a fair coin-flip — the table would still have a top and a bottom. Some teams would win 10 of 14 and some 4 of 14 by luck alone. So the honest question is: how much more spread does the real table have than a coin-flip league?

📐 Definition — the luck share of a table. For a team playing g games, a pure 50% team's win percentage has binomial variance 0.25/g. Then: observed variance of win % = true-strength variance + luck variance, so luck share = (0.25/g) / observed variance*, and the number of games needed before a record is half skill is k*** = 0.25 / true-strength variance. (This decomposition is the standard sabermetric approach popularised by Tom Tango.)

ts["win_pct"] = ts["wins"] / ts["games"]
obs_var = ts["win_pct"].var(ddof=1)
luck_var = (0.25 / ts["games"]).mean()             # binomial variance of a 50% team
skill_var = obs_var - luck_var
B. IPL team-seasons 2008-2026: 166 (mean 14.7 decided games each)
  observed SD of win%: 13.7 points
  SD expected from luck alone (coin-flip teams): 13.1 points
  implied SD of true team strength: 4.0 points
  share of observed variance that is luck: 92%
  games needed before a record is half skill, half luck (k = 0.25 / skill var): 159
  bootstrap 90% interval for the luck share: 79% to 100%  (values above 100% mean 'indistinguishable from pure luck')
  Contrast — men's T20Is between full members, team-years with >= 8 decided games: 129
    observed SD 18.6 points, luck SD 14.3, true-strength SD 11.9; luck share 59%
  simulated coin-flip team-seasons: SD 13.0 points; share >= 64% wins: 16.1% (real: 13.3%); share <= 36%: 16.4% (real: 18.1%)
  team win% season N vs N+1 correlation: 0.07 (145 pairs)

Full script: code/06_luck_and_selection.py (part B).

Overlaid histograms of IPL team-season win percentages (2008–2026) and 10,000 simulated coin-flip team-seasons; the two distributions are almost the same shape and width

📊 Figure (described): Grey: the distribution of win percentages for 10,000 simulated team-seasons in which every match is a coin-flip, with the same schedule lengths as the real IPL. Blue: the 166 real IPL team-seasons, 2008–2026. The two shapes nearly coincide — the real table is only slightly wider than pure luck would make it.

This is one of the most surprising numbers in the book. About 92% of the spread in IPL team-season records is what coin-flips alone would produce. The real spread is 13.7 percentage points; luck alone gives 13.1. The implied spread of true team strength is just 4 points — a team two standard deviations above average is, in truth, roughly a 58% team, not the 71% team that a 10-wins-from-14 season suggests. It would take about 159 games — more than ten IPL seasons — before a team's record was half skill. And a team's win percentage this season correlates with next season's at just 0.07.

Be careful about what this does not say. It does not say IPL results are random or that strategy doesn't matter. It says the league's design — a capped auction, player movement between seasons, short schedules and a format where one over can flip a match — compresses true team differences into a narrow band, and that 14 games is far too few to separate them reliably. The estimate is also uncertain itself: a bootstrap over team-seasons puts the luck share somewhere between 79% and effectively 100%. (Franchise renames also break a few season-to-season pairs; the 0.07 uses the 145 pairs that survive.)

Now the contrast: in men's T20Is between full members, luck explains about 59% of the spread, and the true-strength SD is about 12 points. International cricket has real gaps between nations — no auction evens them out. Same format, very different competitive structure. Your forecasting models in Part V will inherit exactly this: pre-match IPL models will rarely be confident, and they shouldn't be. Theme 6 says a good pre-match model is right about 60–65% of the time. In the IPL it may struggle to reach even that — not because the model is bad, but because the league is close to a coin-flip machine.

🔄 Check your understanding 1. If luck alone gives an SD of 13.1 points and the observed SD is 13.7, what is the implied true-strength SD? 2. Why is the luck share in full-member T20Is (59%) so much lower than in the IPL (92%)?

Answer

  1. √(13.7² − 13.1²) ≈ 4.0 points.
  2. True team strength varies much more between national sides than between auction-built franchise squads working to the same purse; with a bigger true-strength variance, luck is a smaller share of the total.

6.10 Bayesian Updating: Changing Your Mind One Innings at a Time

The cricket question: Sanju Samson scored at a strike rate of 199 in the 2026 Men's T20 World Cup. What should we now believe about his true strike rate?

Everything in this chapter has been circling one idea, and now we name it. You come into a tournament with a belief about a player. You watch some innings. You end with an updated belief. The Bayesian recipe makes that process explicit and consistent.

📐 Definition — prior, likelihood, posterior. The prior is your belief about a player's true ability before the new data (a distribution, not a single number). The likelihood says how probable the observed data would be under each possible true ability. The posterior — your updated belief — is proportional to prior × likelihood. For a strike rate with a normal prior N(μ₀, τ²) and n balls of per-ball SD σ, the posterior mean is (μ₀/τ² + 100 × runs/σ²) / (1/τ² + n/σ²), and the posterior precision (1/variance) is the sum of the prior precision and the data precision. Today's posterior is tomorrow's prior.

You already used a version of this in §6.6 — the league mean was the prior. Now the prior is the player's own recent record, and the question becomes how strong that prior should be. We compare two honest choices:

  • an open-minded prior: centred on his last two years, but only as strong as the spread between batters (τ) — "he is his recent self, give or take what separates good batters from average ones";
  • a sceptical prior: start from the population, then count every ball of his last two years in full — "two years of evidence is two years of evidence".
pre_b, pre_r = pre_s["balls"], pre_s["runs"]
prec_s = 1 / tau ** 2 + pre_b / sigma ** 2
mu_s = (lg_sr / tau ** 2 + 100 * pre_r / sigma ** 2) / prec_s
priors = {"open-minded": (mu0, 1 / tau ** 2), "sceptical": (mu_s, prec_s)}
...
    prec = p0 + upd["balls"].cumsum() / sigma ** 2
    mean = (m0 * p0 + 100 * upd["runs"].cumsum() / sigma ** 2) / prec

cumsum() turns the innings log into running totals, so one vectorised line computes the posterior after every innings of the tournament.

Example 1 — SV Samson, Men's T20 World Cup 2026 (first match 2026-02-07)
  last two years (T20I + IPL): 1520 runs off 999 balls, SR 152.15
  sigma (per-ball SD of 100 x runs, IPL 2022-26) = 179.3; tau (true-talent SD) = 15.9; league SR 146.9
  open-minded  prior: mean 152.2, SD 15.9, worth 128 balls
  sceptical    prior: mean 151.6, SD 5.3, worth 1127 balls
      date    opponent  runs  balls  cum_SR  open_mean  scep_mean
     prior                 0      0     NaN      152.2      151.6
2026-02-12     Namibia    22      8   275.0      159.4      152.4
2026-02-26    Zimbabwe    24     15   200.0      159.4      152.5
2026-03-01 West Indies    97     50   195.9      168.0      154.3
2026-03-05     England    89     42   201.7      175.6      156.2
2026-03-08 New Zealand    89     46   199.4      178.5      157.5
  tournament SR 199.38 off 161 balls
  open-minded  posterior SR 178.5 (90% credible 161.1–195.8); P(true SR > 180) = 0.44
  sceptical    posterior SR 157.5 (90% credible 149.3–165.8); P(true SR > 180) = 0.00
  Out of sample — IPL 2026 (after the World Cup): 477 runs off 288 balls, SR 165.62 (league SR 156.34)

Full script: code/07_bayesian_updating.py (example 1).

Line chart of Sanju Samson's estimated true strike rate through the 2026 T20 World Cup: the raw tournament strike rate near 200, the open-minded posterior rising from 152 to 179, the sceptical posterior rising from 152 to 158, and a dotted line at his later IPL 2026 strike rate of 166

📊 Figure (described): Samson's five innings of the 2026 T20 World Cup along the x-axis. Orange squares: his raw tournament strike rate so far, near 200 from the second innings on. Blue: the posterior under the open-minded prior, climbing from 152 to 179 with a wide 90% band. Purple: the posterior under the sceptical prior, creeping from 152 to 158 with a narrow band. Green dotted line: what he actually did next, a strike rate of 166 in IPL 2026 after the World Cup.

The two priors disagree sharply after a tournament like that: 178.5 against 157.5. And what happened next — 165.62 off 288 balls in the IPL after the World Cup, in a league scoring at 156.34 — landed between them. The open-minded prior over-reacted a little; the sceptical prior under-reacted a little. Two honest caveats: the "next" sample is itself only 288 balls (an interval of roughly ±20 points), and it comes from a different competition. One check does not settle which prior is right; dozens of players across many tournaments would. That systematic version is a back-test, and Chapter 25 runs it.

The women's World Cup: updating an average

For Laura Wolvaardt at the 2025 Women's ODI World Cup, the quantity of interest is a batting average, so we combine a Beta–binomial update of her dismissal rate per ball with a normal update of her runs per ball, and simulate the ratio (a Monte Carlo step — draw 20,000 plausible dismissal rates and scoring rates from their posteriors, divide, and read off the median and the middle 90%).

Example 2 — L Wolvaardt, Women's ODI World Cup 2025 (first match 2025-09-30)
  last two years before: 25 inns, 1254 runs, 1525 balls, 21 outs, average 59.71, SR 82.23
  population: 198 batters >= 300 balls; dismissal rate 0.0252 (1 per 39.7 balls); Beta strength a+b = 323 balls; runs per ball 0.732
      date    opponent  runs  balls  out  cum_avg  open_avg  open_lo90  open_hi90  scep_avg  scep_lo90  scep_hi90
     prior                 0      0    0      NaN      64.0       30.2      166.9      52.4       39.1       72.5
2025-10-03     England     5      5    1      5.0      53.0       26.9      123.3      50.9       37.9       70.0
2025-10-06 New Zealand    14     10    1      9.5      48.2       25.8      104.1      49.6       37.3       67.7
2025-10-09       India    70    111    1     29.7      47.4       26.6       95.6      50.2       37.9       68.2
2025-10-13  Bangladesh    31     56    1     30.0      44.3       25.8       84.2      49.5       37.5       67.6
2025-10-17   Sri Lanka    60     47    0     45.0      54.2       31.5      103.4      51.3       38.8       69.6
2025-10-21    Pakistan    90     82    1     54.0      59.3       35.8      108.0      52.6       40.1       71.0
2025-10-25   Australia    31     26    1     50.2      57.0       35.1      100.4      52.1       39.9       69.9
2025-10-29     England   169    143    1     67.1      68.8       43.3      118.0      55.6       42.6       74.4
2025-11-02       India   101     98    1     71.4      71.6       46.0      119.8      56.9       43.7       75.7
  sensitivity (open-minded prior strength x0.5): posterior average 71.8 (90% 44.6–128.1)
  sensitivity (open-minded prior strength x2.0): posterior average 71.3 (90% 48.2–110.5)
  Out of sample — ODIs after the final (to 2026-10-28): 9 inns, 473 runs, 8 outs, average 59.12, SR 102.60

Full script: code/07_bayesian_updating.py (example 2).

Line chart of Laura Wolvaardt's estimated batting average through the 2025 Women's World Cup: the raw tournament average climbs from 5 to 71; the open-minded posterior dips then rises to 72; the sceptical posterior stays between 50 and 57; a dotted line marks her later ODI average of 59

📊 Figure (described): Wolvaardt's nine innings in the 2025 Women's World Cup (scores printed along the bottom; 60* was not out). The orange raw average starts at 5 after an early dismissal, sits near 30 after four innings, and finishes at 71.4 after 169 in the semi-final against England and 101 in the final against India. The blue open-minded posterior follows it at a distance with a very wide band; the purple sceptical posterior barely moves, from 52 to 57. The green dotted line is her average in the ODIs after the tournament: 59.

Watch the tournament as it unfolded. After four innings Wolvaardt's raw average was 30.0; a fan might have said she was out of form. Both posteriors stayed in the 40s and 50s — four innings are not enough to overturn two years. After the semi-final and final, the raw average was 71.4; the open-minded posterior followed it to 71.6, while the sceptical one moved only to 56.9. Her next nine ODIs produced an average of 59.12 — closer to the sceptical estimate, though, again, on just eight dismissals.

The two examples point the same way: raw tournament numbers overstate what a tournament tells you, and the right amount of trust in a player's past lies somewhere between "only as a rough centre" and "every ball counts in full". Finding the right point between those is not a matter of taste. It is an empirical question that Chapter 25 answers by back-testing projections across thousands of player-seasons.

⚠️ Common pitfall: a prior you can't defend. A Bayesian estimate is only as honest as its prior. Always (1) say what the prior is and where it came from, (2) show how the answer changes under a stronger and a weaker prior (the sensitivity lines above), and (3) when you can, check against what happened next. A posterior quoted to one decimal place without those three things is spin.

📋 Try it — Predict this match (well, this batter). Sahibzada Farhan was the leading run-scorer of the 2026 Men's T20 World Cup in the book's data: 383 runs off 239 balls (SR 160.25) in six innings. Adapt code/07_bayesian_updating.py to build his open-minded and sceptical priors from his T20I + PSL record in the two years before the tournament (load_deliveries("psl")), and compute both posteriors. Then check his record in any T20 matches after the final.

Worked approach

Replace "SV Samson" with "Sahibzada Farhan" and the IPL table with the PSL table in the pre and after blocks. Keep σ and τ from the IPL (or, better, re-estimate τ from PSL seasons with the method of moments — an excellent extension). Expect the sceptical posterior to sit close to his pre-tournament strike rate if his prior rests on many more balls than the 239 he faced at the World Cup; the open-minded one will move most of the way toward 160. Report the number of balls behind the "after" check and treat it as weak evidence if it is small.

🔄 Check your understanding 1. In a normal–normal update, what happens to the posterior SD as more balls arrive? Does it depend on whether the batter scored quickly or slowly? 2. After Samson's tournament, the two posteriors were 178.5 and 157.5. What single fact about the priors explains most of that 21-point gap?

Answer

  1. It shrinks, because precision adds: 1/SD² = 1/τ² + n/σ². In this simple model it depends only on the number of balls, not on how quickly he scored.
  2. Their strength: the open-minded prior was worth about 128 balls, so 161 tournament balls outweighed it; the sceptical prior was worth about 1,127 balls, so the tournament moved it only a little.

Spaced Review

Before you look at the answers, try each from memory.

  1. From Chapter 4: batting average divides runs by dismissals. Why does a finisher with many not-outs tend to have an inflated average — and how does this chapter's finding that the dismissal rate stabilises slowly (k ≈ 550 balls) make that problem worse for lower-order batters?
  2. From Chapter 5: which format has the lowest dismissal probability per ball faced, and what does that imply about how to judge whether a Test average is trustworthy?
  3. From Chapter 3: what does df.groupby(["batter", "year"]).cumcount() return, and where did this chapter use it?
Answers
  1. Not-outs remove dismissals from the denominator without removing the runs, so a batter who often finishes unbeaten has fewer outs per run scored. Lower-order batters also face fewer balls, so their dismissal counts are small and noisy on top of the not-out bias — two problems stacked. A finisher's average is among the least trustworthy numbers on the scorecard; strike rate and runs per innings are steadier.
  2. Tests: 1.95% of balls faced ended in a striker dismissal in 2023–2026, against 5.15% in the IPL. Measured in balls, a Test batter collects dismissals much more slowly, so "he has faced 1,000 balls" means far less for a Test average than for a T20 one. The honest unit for any average is the number of dismissals behind it — count those, whatever the format.
  3. It numbers the rows within each batter-season group in their current order, starting at 0. We sorted by date and added 1 to number each batter's innings in a season, then kept innings 1–5 for the hot-start study (§6.4).

Project Checkpoint: uncertainty.py

Nusrat has a confession. The "Form Guide" panel she sketched for Crease ranks batters by their last five innings, and it has been flashing a different hero every week. After this chapter she knows why: she built a regression-to-the-mean machine. This chapter's module gives Crease the tools to say how sure it is, and to rank on estimates instead of raw numbers.

project/crease/uncertainty.py exposes small, independent functions:

Function What it does
innings_table(balls, batter) per-innings runs, balls, outs with the book's standard definitions
ratio_ci(num, den, ...), strike_rate_ci, average_ci innings (cluster) bootstrap intervals
reliability(n, k), fit_k(ns, rs), split_half(per_ball, n) the n/(n+k) curve and how to estimate it
k_method_of_moments(rates, n, sigma2) split observed spread into noise and talent; return k
shrink_normal(obs, n, prior_mean, k) normal–normal shrinkage
fit_beta_prior, shrink_beta, beta_interval Beta–binomial prior, posterior mean, credible interval
normal_update(prior_mean, prior_sd, total, n, sigma) conjugate update of a true rate
luck_share(wins, games) luck vs skill in a league table
simpsons_pairs(rates, weights), standardise(rates, mix) detect and fix Simpson's paradox

Here is the heart of the shrinkage helper — deliberately tiny:

def shrink_normal(observed, n, prior_mean, k):
    """Normal–normal shrinkage: (n * observed + k * prior_mean) / (n + k)."""
    observed, n = np.asarray(observed, float), np.asarray(n, float)
    return (n * observed + k * prior_mean) / (n + k)

The checkpoint script exercises every function family on real data:

1. Intervals
   V Suryavanshi, IPL career SR 229.0  (95% bootstrap 200.6–255.7)
   EA Perry, WPL average 64.80  (95% bootstrap 43.2–104.3)
2. Normal shrinkage of IPL 2026 strike rates
   true-talent SD 18.8, noise SD 14.8, k = 98 balls
               balls  strike_rate  shrunk
batter                                   
Urvil Patel       64        201.6   174.2
V Suryavanshi    327        237.3   218.6
Ishan Kishan     330        182.4   176.4
3. Beta prior for WPL dismissal rate, and Perry's shrunk rate
   prior Beta(13.4, 250.9); Perry raw balls/dismissal 48.7, shrunk 35.0 (90%: 26.5–48.9)
4. Conjugate update: Samson's true SR after the 2026 T20 World Cup (open-minded prior)
   posterior 178.5 ± 10.6 (SD)
5. Luck share — IPL team-seasons, 2008–2026
   IPL: observed SD 13.7 pts, luck SD 13.1, luck share 92%, k = 159 games
6. Simpson's pairs in IPL phase strike rates (>= 60 balls per phase)
   168 paradox pairs; e.g.
better_in_every_group better_pooled  min_group_gap  pooled_gap
            RG Sharma      MS Dhoni           6.17        4.53
   phase-standardised SR: {'RG Sharma': 136.9, 'MS Dhoni': 111.4}

Checkpoint complete: crease.uncertainty works.

Full script: code/project_checkpoint.py. (The pooled gap prints as 4.53 here and 4.54 in §6.7 because the module pools from the rounded phase strike rates.)

Nusrat's first change: the Form Guide now shows each batter's strike rate with its bootstrap interval and ranks on the shrunk value. Her second: a small "sample warning" badge whenever a number rests on fewer than k balls (about 100 for strike rate, about 550 for average). Neither change takes more than five lines.

How it plugs in later: Chapter 8's batting.py can report phase metrics with intervals from ratio_ci; Chapter 11's matchup model is shrink_beta grown into a hierarchy (batter × bowler type); Chapter 13's auction valuation shrinks runs-above-replacement before comparing it with price; Chapters 20 and 24 carry the same honesty about uncertainty into calibration; and Chapter 25 turns shrink_normal and the drift lesson of §6.6 into Marcel-style projections. Every later module that prints a rate should be able to answer "how sure?" with a call into this one. The formulas are collected in Appendix D.


Chapter Summary

The big idea. Every cricket number is true ability + luck. Luck is large relative to the differences between players, so small samples mislead, extreme numbers regress, and honest analysis reports uncertainty and shrinks toward what we already knew.

Tool / fact What it tells you Key number from this chapter
Per-ball SD Noise in one delivery IPL 2023–26: 1.81 runs (≈180 SR points) vs true-talent SD ≈13–19 SR points
Season-to-season r How much of a stat repeats IPL batting SR 0.48, average 0.23; bowling economy 0.52, average 0.07
Stabilisation constant k Sample where a stat is half signal IPL SR ≈ 98 balls; dot % 109; boundary % 96; dismissal rate ≈ 554
Regression slope How much of a hot start survives 0.31 of the first-five SR excess (IPL 2009–26)
Bootstrap interval Range consistent with the data Suryavanshi IPL SR 229 [201–256]; Perry WPL avg 64.8 [43–104]
Normal shrinkage Best estimate given sample size IPL within-season k ≈ 100–190 balls; forecasting k ≈ 300–400
Beta–binomial Shrunk dismissal rate / average WPL prior worth 264 balls; Perry 64.80 → 46.45
Simpson's paradox Pooled vs like-for-like Rohit beats Dhoni in every IPL phase, trails overall 132.9 vs 137.5; standardised 136.9 vs 111.4
Outcome selection "Averages more in wins" 93.9% of men's and 97.1% of women's ODI batters do; Rohit's ratio 1.62 is ordinary
Luck share How much of a table is coin-flips IPL ≈ 92%; full-member men's T20Is ≈ 59%
Bayesian updating Belief after new evidence Samson post-WC SR 178.5 (open) vs 157.5 (sceptical); his next 288 IPL balls: 165.6

Decision framework — before you believe a cricket number:

  1. How many balls (or dismissals, or games) is it built on? Compare with k. Below k, it is mostly noise.
  2. What would the interval be? If you can't say, bootstrap it (with 15+ innings) or use a Bayesian interval.
  3. Was it selected for being extreme? Leaderboards, hot starts, "best in the tournament" — expect regression.
  4. What is the right prior? League mean, role-group mean, or the player's own history — and how strong? Show the sensitivity.
  5. Is the comparison like-for-like? Different phase mixes, venue mixes or eras invite Simpson's paradox; standardise.
  6. Was the split chosen by the outcome? Wins-vs-losses splits are guaranteed to flatter batters.
  7. Did you check against what happened next? Back-test whenever you can.

What's Next

You now have the statistical habits; next you need to show them. Chapter 7 builds cricket's essential charts — Manhattans, worms, wagon wheels, pitch maps — and the principles for drawing uncertainty honestly on every graphic. Then Part II puts these tools to work on batting, starting with the metrics that, as §6.2 showed, actually repeat.