Estimators and Likelihood

An estimator is a recipe for guessing, and some recipes are better. Bias against variance, counting tanks from serial numbers, and Fisher’s idea of choosing the parameter that makes the data most likely

Estimators and Likelihood

An estimator is a recipe that turns a sample into a guess. Different recipes aimed at the same target behave differently: some are off on average, some scatter widely, and the best is not always the one that is right on average. There is also a principle, maximum likelihood, that writes a good recipe for almost any problem.

Bias and Variance

Press Play, then × 1000, and compare the three archers’ averages and spreads in the table. Change the sample size, then switch to the standard deviation, where even the unbiased archer starts to miss.

1,000
samples drawn
σ² = 4
the target (the truth)
÷ (n + 1)
smallest mean squared error so far
÷ (n − 1)
average closest to the target so far
RecipeAverageBiasVarianceMean squared errorBias in theoryMSE in theory
divide by n − 13.974−0.0266.9466.9470.0008.000
divide by n3.180−0.8204.4465.119−0.8005.760
divide by n + 12.650−1.3503.0874.911−1.3335.333
In theory, dividing by n − 1 = 4 has no bias at all, yet the smallest mean squared error for this population comes from dividing by n + 1 = 6. Shrinking the estimate costs a little bias and saves more variance.

Teal dots are one sample; the dashed white curve and line are the truth, which the archers never see. Each histogram collects one archer’s estimates, with the latest in amber; the triangle marks the archer’s average, and the thick bar from the dashed line to the triangle is the bias. On the round targets only the left–right position means anything (the error of the estimate); the up–down scatter is decoration. Mean squared error = bias² + variance.

Go deeper:Bias, Variance, and Why n − 1

Write θ for the true value and T for an estimate of it computed from a random sample. The bias of T is its average over all possible samples minus θ, and its variance is its spread about its own average. The usual single measure of quality is the mean squared error, the average of (T − θ)², and it splits exactly: mean squared error = bias² + variance. An archer can lose by aiming off-centre or by having an unsteady hand, and the two faults add.

All three recipes start from the sum of squares, SS = Σ(xi − x̄)². The deviations are measured from the sample’s own mean x̄, which is the point closest to the data in exactly this sense, so SS is smaller than the sum of squared deviations from the true mean μ would be. On average the shortfall is one σ²: the expected value of SS is (n − 1)σ², whatever the shape of the population. Dividing by n − 1 instead of n makes up for it, and the result S² has expected value σ². This is Bessel’s correction, named after the astronomer Friedrich Bessel.

Unbiased does not mean best. For a normal population, SS/σ² has a chi-squared distribution with n − 1 degrees of freedom, and the mean squared error of SS/d is σ⁴(2(n − 1) + (n − 1 − d)²)/d², which is smallest at d = n + 1. Dividing by n + 1 always guesses low on average, but it scatters so much less that it wins. For a population with heavier tails the best divisor is larger still. And the square root of S² is biased low as an estimate of σ for every population, because a square root shrinks large values more than small ones; unbiasedness does not survive a change of scale.

Trading a little bias for a large cut in variance is one of the most useful ideas in statistics. See also Models and Overfitting, where it decides how flexible a model should be, and Bayesian Statistics, where pulling estimates towards a common value beats treating each alone.

The German Tank Problem

Tanks are numbered 1 to N as they are built. Capture tanks one at a time and watch three guesses at N compete, then move the true N and see which guess stays centred and tight over 5,000 repeat captures.

5
tanks captured, k
289
largest serial seen, m
56.8
average gap between captured serials, m/k − 1
0 / 5,000
repeat captures of 5 from 300
EstimatorThis captureAverage over repeatsBiasStandard deviationBias in theorySD in theory
Twice the mean, minus 1339.0———0.076.9
The largest serial289.0———−49.242.0
Largest plus average gap345.8———0.050.4
With 5 tanks out of 300, the largest serial falls short of N by 49.2 on average. Adding the average gap removes that bias, and the result has a standard deviation 1.53 times smaller than twice-the-mean, which wastes what the largest serial knows.

Teal tanks are the serial numbers captured so far, on a line of every tank made; the dashed white line is the true N. Amber diamonds are the three estimates from this one capture. Each histogram shows where that estimator lands over 5,000 fresh captures of the same size, with a triangle at its average and a thick bar for its bias.

Go deeper:Serial Numbers as Intelligence

During the Second World War, Allied statisticians estimated German production from the serial numbers on captured equipment: tanks, and more reliably their gearboxes, engines and wheels. Richard Ruggles and Henry Brodie described the work in “An Empirical Approach to Economic Intelligence in World War II” (Journal of the American Statistical Association, 1947). The statistical estimates were far lower than those of conventional intelligence, and when German records were examined after the war they were far closer to the truth. For August 1942 the serial numbers gave 327 tanks a month and conventional intelligence 1,550; the records showed 342.

In the idealised problem, k serials are drawn without replacement from 1, 2, …, N, each set equally likely. The largest, m, can never exceed N, so it is biased low: its expected value is k(N + 1)/(k + 1). The repair comes from a symmetry. The k captured serials cut the unseen tanks into k + 1 stretches (before the first, between neighbours, and after the last), and each stretch has the same expected length. So the expected gap between m and N equals the average gap below the captured serials, (m − k)/k = m/k − 1, which can be computed from the data. Adding it gives m + m/k − 1, whose expected value is exactly N.

Twice the sample mean minus 1 is also unbiased, since the mean of 1, …, N is (N + 1)/2, but its variance is (N + 1)(N − k)/(3k) against (N + 1)(N − k)/(k(k + 2)) for the corrected maximum. The reason is sufficiency: once m is known, the other serials are just a random selection from 1, …, m − 1 and say nothing more about N. The maximum carries all the information in the sample, and m + m/k − 1 is the unbiased estimator with the smallest possible variance. An estimator that ignores this, like the mean, throws information away.

The Likelihood Landscape

Drag the amber marker in the lower panel to slide the model across the data, and find the value that makes the teal bars tallest overall. Then drag a data point, raise n, and try the two-parameter map with its Climb button.

4.666
maximum likelihood estimate of μ: the sample mean x̄
0.707
standard error from the curvature of the peak
—
standard deviation of the estimate over 0 fresh samples
0.707
large-sample theory at the truth, 1/√(n I)
Your candidate is 4.27 log units below the peak: the likelihood at the peak is 71.3 times the likelihood here. Drag the parameter towards the peak.

Teal dots are the data (drag them); the dashed white curve is the truth that produced them, and the amber curve is your candidate model. Each teal bar is the height the candidate gives one data point. The likelihood is the product of the bars, so its logarithm is the sum of their logs, drawn below in amber, with the dotted parabola that matches the peak’s curvature. Raise n and the peak narrows.

Go deeper:Fisher’s Maximum Likelihood

R. A. Fisher introduced the method in a series of papers from 1912 to 1922, ending with “On the Mathematical Foundations of Theoretical Statistics” (1922). Take a model that gives the probability, or probability density, of the data for each value of its parameter θ. Hold the observed data fixed and read that expression as a function of θ: this is the likelihood. The maximum likelihood estimate is the θ at which it is largest. Because independent observations multiply, it is easier to work with the logarithm, which turns the product into a sum and has its peak in the same place.

The likelihood is not a probability distribution over θ. It need not add up to 1 across parameter values, and it does not say how probable any value of θ is; it says how probable the data would be if θ were the truth. Only ratios of likelihoods carry meaning. Turning a likelihood into probabilities for θ takes a further ingredient, a prior (see also Bayesian Statistics).

For the models in the demo the peak can be found with calculus. Normal data: the estimate of μ is x̄, and the estimate of σ² is SS/n, with divisor n and so biased low, as the first demo showed. Exponential data with rate λ: 1/x̄. Poisson counts with mean λ: x̄. Binomial data with k successes in n trials: k/n. Maximum likelihood does not promise unbiased estimates; it promises estimates that home in on the truth as the sample grows, under mild conditions.

How sharply the log-likelihood is peaked measures how much the data say. The Fisher information I(θ) is the expected curvature of the log-likelihood of a single observation, with its sign reversed; n independent observations carry n·I(θ). The Cramér–Rao bound says that, under smoothness conditions, no unbiased estimator can have variance below 1/(n·I(θ)), and for large samples the maximum likelihood estimate is approximately normal with exactly that variance. This is why the curvature at the peak gives a standard error. The tank problem breaks the smoothness conditions, because the range of possible data depends on N, and its best estimator has a variance that falls like 1/k² instead of 1/k.

Key Takeaways

  • Mean squared error = bias² + variance, so an estimator can fail by aiming off or by scattering.
  • Dividing the sum of squares by n − 1 gives an unbiased variance, yet for normal data n + 1 has the smaller mean squared error.
  • In the tank problem the largest serial plus the average gap, m + m/k − 1, is unbiased and far tighter than twice the mean.
  • Maximum likelihood picks the parameter under which the data were most probable; the sharpness of the peak gives its standard error.

Spot a mistake or have an idea?

Search