Estimators & sampling theory
Every number you compute from data — a mean return, a volatility, a Sharpe ratio — is an estimator: a random variable whose value would have been different on a different sample. Statistical inference begins by taking that randomness seriously: what distribution does the estimator itself follow, is it aimed at the right target (bias), how much does it scatter (variance), and is there a floor on how precise any estimator can be (Cramér–Rao)? This chapter builds the machinery: MSE decomposition, the story behind , the genesis of the distribution, Fisher information, and sufficiency.
Fix a model: data drawn iid from a distribution with unknown parameter . A statistic is any function of the data ; an estimator is a statistic used to guess . Because the data are random, has its own distribution — the sampling distribution — and every question about estimation quality is a question about that distribution: where is it centred, how wide is it, what shape does it take as grows. The single most common conceptual failure is treating an estimate as a number rather than a draw.
Bias, variance, and mean squared error#
For an estimator of , define the bias and the mean squared error . These connect through the fundamental decomposition:
Add and subtract inside the square:
The cross term vanishes because and is a constant. What remains is variance plus squared bias. Moral: unbiasedness is not sacred — a small bias is a good trade if it buys a large variance reduction. Shrinkage estimators live on exactly this trade.

Two more properties complete the vocabulary. is consistent if in probability as — by Chebyshev (see inequalities & bounds), it suffices that bias and variance both vanish. is efficientif its variance attains the Cramér–Rao lower bound below. Consistency is a minimal sanity requirement (more data should get you there); efficiency is the gold standard at finite .
Worked example. Estimate of a normal from observations with true , using . Since (mean 9, variance 18), the divisor gives bias 0 and MSE ; the divisor gives bias and MSE ; the divisor gives bias and MSE — the most biased of the three has the lowest MSE. Problem 1 below proves is optimal in this class.
Why s² divides by n − 1#
The sample variance is . The exists because the deviations are measured from , which was itself fit to the data — the sample mean chases the sample, making raw squared deviations systematically too small.
Decompose deviations about into deviations about plus the mean’s own error (the cross term telescopes to zero):
Take expectations: the left side is , and . Hence
so dividing by is exactly what restores unbiasedness. One degree of freedom was spent estimating ; the correction refunds it.
Hand computation: data gives and , so , while the version gives — smaller, as the bias predicts.
Unbiasedness does not survive nonlinear transformations. Since whenever is non-degenerate, , i.e. : the sample standard deviation systematically understates volatility. This is Jensen’s inequality for the strictly concave square root (see Jensen). Under normality the exact correction is known (about ), but the point to internalise is the direction and the reason.
Sampling distributions under normality#
Let iid. Three exact facts organise all of classical inference:
- — exactly, not just asymptotically (linear combinations of normals are normal: joint distributions).
- — a sum of squares of effective standard normals, one degree lost to .
- and are independent — a property that characterises the normal distribution.
Sketch of independence: the vector of deviations and are jointly normal, and ; for jointly Gaussian vectors zero covariance implies independence, and is a function of the deviations alone. Now define a variable with degrees of freedom as with independent of . Then
because the numerator is standard normal, the bracket is , and the two are independent. Every unknown- test and confidence interval in hypothesis testing is this one algebraic identity. The extra randomness in is why has fatter tails than the normal, melting back to as grows (see the distribution zoo).
Worked example. A strategy’s 9 monthly returns average with . Then on 8 degrees of freedom — nowhere near the needed for a two-sided 5% test. Nine months of data cannot distinguish this edge from zero; the sample-size arithmetic is in LLN & CLT.
Fisher information and the Cramér–Rao bound#
How precise can any estimator be? For a density smooth in , define the score and the Fisher information
the second equality holding under regularity (differentiation under the integral). Information adds across iid observations: a sample carries .
Theorem. For any unbiased estimator of from an iid sample of size (regular model), .
Sketch. The total score has mean zero (differentiate ) and variance . Differentiating the unbiasedness identity in gives . Cauchy–Schwarz (proved in inequalities & bounds) then forces
Equality holds iff is a linear function of the score — the exponential-family case where efficient estimators exist.
Worked example (Bernoulli). For , , so and . The bound is — exactly the variance of , which is therefore efficient. For the normal mean, and attains : efficient again. With the floor is a standard error of — no cleverness beats it.

Sufficiency — compressing without losing#
A statistic is sufficient for if the conditional distribution of the data given does not depend on — everything the sample says about is already in . The workable criterion is the factorisation theorem (Fisher–Neyman): is sufficient iff the likelihood splits as
- Bernoulli / Poisson: — the likelihood depends on the data only through the count. The order of heads and tails carries no information about .
- Normal: is jointly sufficient for : two numbers summarise any sample size.
- Uniform: , since — the maximum is the whole story (see order statistics).
Rao–Blackwell makes sufficiency operational: replacing any unbiased estimator by preserves unbiasedness (tower property) and never increases variance (law of total variance, both proved in joint distributions) — so optimal estimators are always functions of sufficient statistics. And a teaser for what lies beyond: for three or more normal means, the James–Stein estimator shrinks every coordinate toward a common point and beats the sample means in total MSE everywhere — unbiasedness is not just non-sacred, it is dominated. The Bayesian view that makes shrinkage natural is in Bayesian inference.
A backtest Sharpe is — a ratio of two noisy estimators. Propagating their sampling error (delta method, LLN & CLT) gives : a strategy with a true annual Sharpe of 1 measured over one year has a standard error near 1 — the estimate is mostly noise. This is why desks (a) demand long samples before believing a Sharpe, (b) shrink estimated alphas and betas toward priors exactly as Rao–Blackwell and James–Stein suggest, and (c) treat a single backtest statistic the way this chapter treats any estimator: as one draw from a wide sampling distribution. The testing machinery built on this view is the gauntlet.
Simulation — checking the theory#
The claims above are all checkable in a few lines: unbiasedness of , the MSE ranking of the three divisors, and Jensen’s bias in .
import numpy as np
rng = np.random.default_rng(11)
sigma2, n, reps = 4.0, 10, 200_000
x = rng.normal(0.0, np.sqrt(sigma2), size=(reps, n))
ss = np.sum((x - x.mean(axis=1, keepdims=True)) ** 2, axis=1)
for name, div in [("1/(n-1) unbiased", n - 1), ("1/n MLE ", n), ("1/(n+1) min-MSE ", n + 1)]:
est = ss / div
print(f"{name}: mean={est.mean():.3f} bias={est.mean() - sigma2:+.3f} "
f"MSE={np.mean((est - sigma2) ** 2):.3f}")
# theory: MSE = 3.556 (n-1), 3.040 (n), 2.909 (n+1) -> most biased wins
s = np.sqrt(ss / (n - 1))
print(f"E[s] = {s.mean():.4f} < sigma = {np.sqrt(sigma2):.1f} (Jensen)")Practice problems#
For normal data, compare the MSE of as an estimator of for , and find the optimal .
Solution. Let , so and . Then
Minimising the quadratic in gives . Plugging in: for the unbiased choice, for the MLE, and for the optimum. The lesson: unbiasedness costs MSE, and you should know why each divisor exists.
You observe serial numbers of captured tanks, uniform without replacement from , with maximum . Estimate .
Solution. The maximum is sufficient, and by symmetry the observed tanks split into exchangeable gaps, so the expected gap above the maximum is : . Solving for gives the unbiased (indeed UMVU, being a function of the complete sufficient statistic)
Intuition: add the average observed gap on top of the maximum. Numeric: , gives . The Allies used this on tank gearbox serials; it beat intelligence estimates badly.
You see heads in tosses. Show is unbiased and efficient.
Solution. : unbiased. . From the worked example above, , so the Cramér–Rao bound is — attained exactly, so no unbiased estimator does better at any . The slick close: the Bernoulli score is linear in , which is precisely the equality condition in the Cauchy–Schwarz step of the CR proof.
From iid Uniform, the natural estimator is . Find its bias and fix it.
Solution. , so the density is and — biased low, because the maximum can never exceed . The corrected estimator is unbiased with variance — shrinking like , dramatically faster than the of moment-based estimators. Non-regular models can beat the Cramér–Rao rate; the bound’s smoothness assumptions fail here (the support depends on ). Full story in maximum likelihood.
For normal data, both the sample mean and sample median estimate consistently. Which is better, and by how much?
Solution. The sample median is asymptotically where is the density; for the normal, , giving variance versus for the mean: the median is only efficient — you throw away a third of your data by using it. The twist worth knowing: under fat tails the ranking flips (for the Cauchy the mean does not even converge — see when the CLT fails), which is why robust statistics exist and why the “right” estimator depends on the tail model.
Next: a systematic machine for generating good estimators — maximise the likelihood — and when that machine breaks. Maximum likelihood & method of moments.

