Contents
- 01Introduction
- 02Setting and notation
- 03Intuition
- 04The decomposition and its proof
- 05A warm-up you can do by hand
- 06The experiment
- 07Models where every term has a formula
- 08Diagnosing bias and variance in practice
- 09Fixing high bias and high variance
- 10Beyond the classical picture
- 11Interview questions and model answers
- 12Summary
- References
05A warm-up you can do by hand: estimating a mean
The tradeoff already appears in the simplest estimation problem there is. Let z_1,\dots,z_n be independent observations with unknown mean \mu and variance \sigma^2. The sample mean \bar z is unbiased with \Var(\bar z)=\sigma^2/n. Now consider the shrunken estimator
which pulls the sample mean toward zero (the sample mean itself is c=1). For an estimator of a number the decomposition reads \MSE=\Bias^2+\Var, with no noise term because we are estimating \mu itself rather than a noisy observation. Using \E[c\,\bar z]=c\mu and \Var(c\,\bar z)=c^2\Var(\bar z),
Shrinking (c<1) introduces bias but removes variance. \MSE(c) is a convex quadratic in c; setting its derivative to zero,
and substituting back,
So some shrinkage always helps, and it helps most when the signal \mu^2 is small relative to the variance \sigma^2/n of the sample mean: few observations, noisy data, or a true value near the point we shrink toward.
Worked example 1. Take \mu=1, \sigma=2 and n=10, so \sigma^2/n=0.4. The sample mean has \MSE=0.400, all of it variance. The optimal shrinkage is c^\star=1/1.4=0.714, with bias -0.286, squared bias 0.082, and variance 0.714^2\times0.4=0.204, so \MSE=0.286, a reduction of about 29%. A simulation with 200,000 repetitions gives 0.399 for the sample mean and 0.285 for the shrunken estimator. Figure 3 plots the three curves.
The catch, and why it matters. The optimal c^\star depends on the unknown \mu, so we cannot compute it exactly. In practice the amount of shrinkage is a hyperparameter chosen from data, exactly like a regularization strength. Remarkably, for Gaussian data in three or more dimensions there is a data-driven shrinkage, the James–Stein estimator, whose total MSE is lower than that of the sample means for every value of the true means (Stein, 1956; James and Stein, 1961). The “Bayesian average” used to rank items with few ratings (Section 3) is the same idea: shrink noisy averages toward a common value, more strongly when they rest on fewer observations.
A real example: batting averages. Efron and Morris (1977) gave the best-known demonstration with real data. They took 18 major-league baseball players’ batting averages after their first 45 at-bats of the 1970 season and asked which estimate would better predict each player’s average over the rest of the season: his own early average, or that average shrunk toward the group mean of 0.265. The James–Stein estimator shrank every player about 79% of the way to the group mean, keeping only a fraction c=0.212 of each deviation: Roberto Clemente’s early 0.400 became 0.265+0.212\times(0.400-0.265)\approx0.294. The shrunken estimates were closer to the season averages for 16 of the 18 players. Each player’s 45 at-bats were simply too few: his early average had low bias but high variance, and borrowing strength from the other players traded a little bias for a large reduction in variance.