What does Regression to the Mean and the Cover Jinx conclude, in numbers, about “Closing the Loop: Annual Reviews by Shrinkage Ranking, Copy without Causal Overstatement, and a Pre-registered Plan”?
Answer: Chapter 8 gives an annual review by shrinkage ranking (the first-placed store in the example has only 0.634 probability of a top-three finish), a copy audit, a pre-registered plan and the distilled Shrinkage Ranking Calculator. Marked boxes separate published evidence, runnable Python calculations (22 programs), classical sources and the author's hypotheses.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (22 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.634
| pooled rate 0.4461, between-store sd tau 0.0683 | ||||||||
| store | n | raw | B | shrunk | 80% interval | rank raw>new | P(top3) | |
| S11 | 45 | 0.578 | 0.459 | 0.507 | 0.442 to 0.571 | 1 > | 1 | 0.634 |
| S07 | 120 | 0.517 | 0.694 | 0.495 | 0.447 to 0.543 | 3 > | 2 | 0.555 |
| S10 | 300 | 0.500 | 0.850 | 0.492 | 0.458 to 0.526 | 5 > | 3 | 0.525 |
| S01 | 40 | 0.550 | 0.430 | 0.491 | 0.425 to 0.557 | 2 > | 4 | 0.507 |
| S02 | 60 | 0.500 | 0.531 | 0.475 | 0.415 to 0.535 | 4 > | 5 | 0.361 |
| S04 | 250 | 0.480 | 0.825 | 0.474 | 0.437 to 0.511 | 6 > | 6 | 0.285 |
| S12 | 700 | 0.460 | 0.930 | 0.459 | 0.436 to 0.482 | 7 > | 7 | 0.071 |
| S03 | 900 | 0.450 | 0.944 | 0.450 | 0.429 to 0.470 | 8 > | 8 | 0.023 |
| S06 | 500 | 0.430 | 0.904 | 0.432 | 0.404 to 0.459 | 9 > | 9 | 0.007 |
| S08 | 1500 | 0.420 | 0.966 | 0.421 | 0.405 to 0.437 | 10 > 10 | 0.000 | |
| S09 | 80 | 0.375 | 0.601 | 0.403 | 0.348 to 0.459 | 11 > 11 | 0.021 | |
| S05 | 35 | 0.257 | 0.398 | 0.371 | 0.303 to 0.439 | 12 > 12 | 0.011 |
Show the full program
# Chapter 8. p81: An annual review by shrinkage ranking, end to end.
# Twelve stores, each with n customers this year and k of them buying
# again (illustrative counts). Raw rate k / n. Empirical Bayes:
# pooled rate m = sum k / sum n, se_i^2 = m (1 - m) / n_i,
# tau^2 = max(var(raw) - mean(se^2), small floor),
# B_i = tau^2 / (tau^2 + se_i^2), shrunk_i = m + B_i (raw_i - m),
# 80 % interval: shrunk_i +- 1.2816 sqrt(B_i se_i^2).
# P(top 3) by 20,000 draws from the posteriors (fixed seed). The same
# functions are in distill/tool.py.
# 年度评估:十二家门店的复购率,按收缩估计排名并给出前三名概率。
import math
import random
STORES = [("S01", 40, 22), ("S02", 60, 30), ("S03", 900, 405),
("S04", 250, 120), ("S05", 35, 9), ("S06", 500, 215),
("S07", 120, 62), ("S08", 1500, 630), ("S09", 80, 30),
("S10", 300, 150), ("S11", 45, 26), ("S12", 700, 322)]
def shrink(rows):
m = math.fsum(k for _, _, k in rows) / math.fsum(n for _, n, _ in rows)
raw = [k / n for _, n, k in rows]
se2 = [m * (1 - m) / n for _, n, _ in rows]
mr = math.fsum(raw) / len(raw)
var = math.fsum((v - mr) ** 2 for v in raw) / (len(raw) - 1)
tau2 = max(var - math.fsum(se2) / len(se2), 1e-6)
out = []
for (name, n, k), r, s2 in zip(rows, raw, se2):
b = tau2 / (tau2 + s2)
out.append((name, n, r, b, m + b * (r - m), math.sqrt(b * s2)))
return m, math.sqrt(tau2), out
def top_prob(out, top=3, draws=20000, seed=None):
rng = random.Random(20261112 if seed is None else seed)
hits = [0] * len(out)
for _ in range(draws):
x = [rng.gauss(o[4], o[5]) for o in out]
for i in sorted(range(len(x)), key=lambda j: -x[j])[:top]:
hits[i] += 1
return [h / draws for h in hits]
if __name__ == "__main__":
m, tau, out = shrink(STORES)
raw_rank = sorted(range(len(out)), key=lambda i: (-out[i][2], i))
new_rank = sorted(range(len(out)), key=lambda i: (-out[i][4], i))
pt = top_prob(out)
print("pooled rate {:.4f}, between-store sd tau {:.4f}".format(m, tau))
print("store n raw B shrunk 80% interval rank"
" raw>new P(top3)")
for i in new_rank:
name, n, r, b, z, sd = out[i]
print("{:<4} {:>5} {:.3f} {:.3f} {:.3f} {:.3f} to {:.3f}"
" {:>2} > {:>2} {:.3f}".format(
name, n, r, b, z, z - 1.2816 * sd, z + 1.2816 * sd,
raw_rank.index(i) + 1, new_rank.index(i) + 1, pt[i]))Single source and citation
Fan, Y. (2026). Regression to the Mean and the Cover Jinx: Posterior Calibration of Fortune Reports and Serial Independence in the Tale of the Lost Horse (Version 1.0.0), Chapter 8: Closing the Loop: Annual Reviews by Shrinkage Ranking, Copy without Causal Overstatement, and a Pre-registered Plan. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-202 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026202,
author = {Fan, Yafu},
title = {Regression to the Mean and the Cover Jinx: Posterior Calibration of Fortune Reports and Serial Independence in the Tale of the Lost Horse},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · A Conditional Expectation with Slope Below One: Why Top Stores Slip the Next Year
- Chapter 2 · The Flight Instructor's Illusion: Why Criticism Looks More Effective than Praise
- Chapter 3 · Splitting Variance into Skill and Luck: Repeated Measures, Intraclass Correlation and Reliability
- Chapter 4 · Shrinkage Estimation: James and Stein, Efron and Morris's Eighteen Batters, and Shrinkage Ranking
- Chapter 5 · The Cover Jinx: Select at the Peak and You Will See a Fall
- Chapter 6 · Posterior Calibration of Fortune Reports: Buying at the Low Point, Barnum Statements and the Brier Score
- Chapter 7 · Sources East and West: the Huainanzi's Old Man Who Lost His Horse and Galton's 1886 "Regression towards Mediocrity"