math.vinhnx.ca / statistics / stein’s paradox
Statistics that surprise

Stein’s paradox

You want to estimate a baseball player’s batting average, the share of imported cars in Chicago, and tomorrow’s rainfall in Hanoi. Common sense says to estimate each from its own data. In 1956 Charles Stein proved common sense wrong: with three or more quantities, you do better in total by pulling all of the estimates toward each other, even though they have nothing to do with one another.

One experiment

Average total error over many experiments

It wins wherever the truth is

risk vs distance of θ from the target

The setup

There are $p$ unknown numbers $\theta_1, \dots, \theta_p$. For each one you get a single noisy measurement $x_i \sim \mathcal N(\theta_i, 1)$, all independent. You are scored on total squared error, $\sum_i (\hat\theta_i - \theta_i)^2$. The obvious estimate is $\hat\theta_i = x_i$. It is unbiased, it is the maximum-likelihood estimate, and its expected total error is exactly $p$.

The James–Stein estimator

James and Stein (1961) proposed shrinking every coordinate by the same factor:

$$\hat{\boldsymbol\theta}^{JS} = \left(1 - \frac{p - 2}{\|\mathbf x\|^2}\right)\mathbf x.$$

For $p \ge 3$ its expected total error is strictly smaller than $p$ for every possible $\boldsymbol\theta$. The obvious estimator is inadmissible: something else beats it everywhere, not just on average over some prior. The right-hand chart shows the blue risk curve under the orange line at every distance.

Why should that be possible?

The observations are, on average, too long: $E\|\mathbf x\|^2 = \|\boldsymbol\theta\|^2 + p$. Noise adds length in every direction at once, so pulling the whole vector back toward the origin removes more noise than signal. The data themselves say how much to pull: if $\|\mathbf x\|^2$ is barely more than $p$, the true values are probably small, so shrink a lot; if it is huge, barely shrink at all.

An empirical-Bayes reading makes it feel less magical. If the $\theta_i$ looked as if they came from $\mathcal N(0, \tau^2)$, the best estimate would be $\big(1 - \tfrac{1}{1+\tau^2}\big)x_i$. James–Stein estimates that factor from the data, borrowing strength across coordinates.

The fine print, which is the fun part

Try it: , then switch the target to the grand mean.