Lab · c13.s06.L1

Bias–variance: the shrink trade

Shrinking an estimate toward zero trades a small, growing bias for a larger, shrinking variance.

Question: Why does a slightly wrong model sometimes predict better?

Bias–variance: the shrink tradeError against shrinkage c, 0.00 to 1.20, at ten observations. The navy MSE curve starts at 1.000, bottoms out at 0.091 at c = 0.909, then rises; the russet bias² curve grows as c falls, the gold variance curve shrinks. A strip of one hundred simulated estimates clusters near 0.90 rather than the true mean 1.00, and the readout gives bias −0.100, variance 0.081 and MSE 0.091.Bias–variance: a slightly wrong estimate can win0.000.250.500.751.000.000.300.600.901.20shrinkage csquared errorMSEbias²variancebest c100 estimatesn = 10 observations · error against shrinkage cc = 1.00centre 1.00true mean 1.00-0.112.261.00c = 1.00 · n = 10bias 0.000 · bias² 0.000 · variance 0.100 · MSE 0.100best c = 0.909 at n = 10: MSE 0.091 against 0.100 at c = 1.00, 9.1% lower
Re-simulated Re-simulated: the three error curves are the exact bias², variance and MSE of the shrunk mean c × sample mean for n Gaussian observations with mean 1.00 and standard deviation 1.00, and the dot strip is a seeded simulation of 100 replications; data/scripts/c13.s06.L1.py reproduces both. At n = 10 the MSE curve bottoms out at c = 0.909 with MSE 0.091 against 0.100 at c = 1.00, a 9.1% gain; at n = 100 the best c is 0.990 and the gain is 1.0%. The slider covers the full 25-point c grid at n = 10, and the frames show the honest and best stored settings for n = 2, 5, 20, 50 and 100.
Lab controls
1

Left and Right move one grid step of 0.05; Page Up and Page Down jump further; Home sets 0.00 and End sets 1.20; the value is shown in text

10 observations

Up and Down or Left and Right move between the six values; Home selects 2, End selects 100; the chosen value is shown in text

Frame 1 of 8: The honest setting, c = 1.00No shrinkage: the estimate is the sample mean, so the bias is 0.000 and the variance is 0.100. MSE is 0.100, and the dotted line marks the best c = 0.909, where MSE is 0.091.

The honest setting, c = 1.00. No shrinkage: the estimate is the sample mean, so the bias is 0.000 and the variance is 0.100. MSE is 0.100, and the dotted line marks the best c = 0.909, where MSE is 0.091.

Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.

Text description of this lab

Error against shrinkage c, 0.00 to 1.20, at ten observations. The navy MSE curve starts at 1.000, bottoms out at 0.091 at c = 0.909, then rises; the russet bias² curve grows as c falls, the gold variance curve shrinks. A strip of one hundred simulated estimates clusters near 0.90 rather than the true mean 1.00, and the readout gives bias −0.100, variance 0.081 and MSE 0.091.

Return to the section that hosts this lab

Caption status: re-simulated. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.