Variance and Mean Squared Error
How do we compare two estimators, one biased and one not, that both try to estimate the same unknown quantity? Intuition says "prefer the unbiased one," but this is often wrong. A slightly biased estimator can pack far less variance. It can land closer to the truth more reliably. Mean squared error (MSE) is the single number that resolves this tension. It measures the average squared distance between an estimator and its target. It decomposes exactly into a bias term and a variance term. This article proves the bias-variance decomposition of MSE. It builds the intuition for the resulting tradeoff. It also works through concrete examples — including the classical case of estimating a normal variance — where a biased estimator strictly beats the unbiased one.
- MSE of an estimator for is , a single scalar measuring average squared error.
- The bias-variance decomposition: .
- Unbiasedness () is not the goal; small MSE is the goal, and bias can be traded for variance.
- The classical example: the MLE for normal variance is biased but has smaller MSE than the unbiased .
- MSE gives a common currency for comparing estimators of different types, and underlies shrinkage and regularization methods (ridge regression, James-Stein estimation).
- Key idea: minimizing total error requires balancing bias against variance, not eliminating bias alone.
Where this lives today
The bias-variance tradeoff encoded in the MSE decomposition is one of the most widely reused ideas in quantitative science. In statistics itself, it directly motivates the Rao-Blackwell Theorem, which shows how to reduce variance of an unbiased estimator without increasing bias by conditioning on a sufficient statistic, and the Cramer-Rao Lower Bound, which gives a hard floor on the variance (hence the MSE) achievable by any unbiased estimator. In regression, the Gauss-Markov Theorem identifies ordinary least squares as the minimum-variance unbiased linear estimator, but modern ridge regression and LASSO deliberately introduce bias via a penalty term to shrink coefficient variance and reduce total prediction MSE, especially when predictors are correlated or numerous relative to sample size. In machine learning, the identical decomposition (renamed "bias-variance tradeoff" for prediction error rather than parameter estimation) explains why simple models underfit (high bias) while overly flexible models overfit (high variance), guiding the choice of model complexity, regularization strength, and ensembling strategies such as bagging (which primarily reduces variance) and boosting (which primarily reduces bias). In signal processing and control theory, the Kalman filter's optimality criterion is minimum mean squared error, and the entire field of "MMSE estimation" is built on exactly this decomposition. In physics and engineering measurement, calibration procedures explicitly manage the tradeoff between systematic error (bias) and random error (variance) when combining or filtering noisy instrument readings. Empirical Bayes and James–Stein shrinkage estimators, which provably beat the sample mean in mean squared error for three or more simultaneously estimated parameters, are a striking and famous demonstration that unbiasedness can be strictly suboptimal even in the simplest Gaussian models.
:::quiz[Why does the proof of the bias-variance decomposition require ?]
- It is a stylistic convenience with no mathematical necessity
- It guarantees the mean and variance of exist as finite numbers so the algebraic expansion and linearity-of-expectation steps are valid ✓
- It is needed only to compute the bias, not the variance
- It ensures is unbiased
Ask the tutor: Can you show me how the bias-variance decomposition extends to derive the Cramér-Rao lower bound?
Let be an unknown parameter and let be an estimator of , a real-valued (or vector-valued) statistic computed from data whose distribution depends on . Assume for every , so that all expectations below are finite. The mean squared error of at is
The bias of at is , and is unbiased if for all . The subscript is often suppressed when the parameter is clear from context, but MSE, bias, and variance are all in general functions of , not single numbers.
Intuition
Picture an archer shooting arrows at a target, where the bullseye is the true parameter and each arrow is one realization of the estimator computed from a fresh sample. Two failure modes are possible. The shots can be scattered widely around the bullseye (high variance, low bias), or they can be tightly clustered but consistently off-center (low variance, high bias). MSE is exactly the average of the squared distances from the bullseye over many shots, and the bias-variance decomposition says this average splits cleanly into "how far is the center of the cluster from the bullseye" (bias squared) plus "how spread out is the cluster around its own center" (variance). This reframes the entire question of estimator quality. An estimator is not disqualified merely because its shots are off-center on average; if the cluster is tight enough, a slightly off-center but tight cluster beats a centered but wildly scattered one. The art of point estimation, and much of modern statistics (ridge regression, James-Stein shrinkage, regularized machine learning), is precisely about deliberately accepting a controlled amount of bias in exchange for a larger reduction in variance, so that the total MSE goes down.
Let be a real-valued parameter and let be an estimator of with for the fixed value of under consideration. Then
In particular, if is unbiased, .
We use the technique of adding and subtracting the mean inside the square, then expanding. Write , a fixed real number once is fixed (it does not depend on the random data). The finiteness hypothesis guarantees, by the Cauchy–Schwarz inequality applied to and the constant , that is finite, so is a well-defined finite number, and it guarantees as well, so every quantity manipulated below is finite and the algebra is legitimate. Starting from the definition,
Insert and remove :
The second parenthesis is the constant . Squaring,
Take of both sides. Expectation is linear (this uses only finiteness of the individual terms, already established), so
The first term on the right is, by definition, . The middle term vanishes: since is a constant,
using linearity of expectation once more. The last term is . Combining,
as claimed. If is unbiased then for every , and the formula reduces to .
∎For any estimator with finite second moment, and , with equality in the first iff is unbiased at , and equality in the second iff .
Both inequalities are immediate from Bias–Variance Decomposition of MSE, since and are each dropped from a sum of two nonnegative terms. Equality in holds exactly when the dropped term is zero, i.e. , i.e. is unbiased at that . Equality in holds exactly when .
∎Worked examples
Example 1: Estimating a normal variance — biased MLE versus unbiased sample variance. Let be i.i.d. with both and unknown, and let . Consider two estimators of :
It is a standard fact (proved via the Bias of an Estimator framework) that is unbiased, , while is biased, with
For normal samples, the exact sampling distribution gives , and since a random variable has variance ,
Since is unbiased, . Now compute . Since ,
By the Bias–Variance Decomposition of MSE,
Compare the two MSEs by cross-multiplying (both denominators positive):
We ask whether , i.e. whether . Expand: , so the inequality becomes , i.e. , i.e. , which holds for every (the smallest sample size for which is defined).
Conclusion: for every , the biased MLE has strictly smaller MSE than the unbiased . For a concrete number take , : , while . Unbiasedness alone did not deliver the smaller total error; the small sacrifice in bias () was more than repaid by the reduction in variance.
Example 2: A shrinkage estimator of a Bernoulli mean. Let be i.i.d. , unknown, and let be the usual sample proportion, which is unbiased with , so . Consider the shrinkage estimator that pulls toward :
Its bias is
so , nonzero unless or . Its variance is
By the decomposition,
Take a concrete asymmetric case: , true , and compare (the plain unbiased ) against (shrunk toward ). For : For : variance term ; bias term . Total:
Since , the shrunk, biased estimator has smaller MSE at for this . (Had the true been very far from , e.g. , the bias term would dominate and shrinkage toward would instead hurt: at , gives variance term and bias term , total , versus for — here shrinkage is worse.) This illustrates that the optimal tradeoff depends on the unknown truth, which is precisely why shrinkage constants are typically tuned by cross-validation or Bayesian priors rather than fixed blindly.
The decomposition requires , which is what guarantees every term in the proof (in particular and ) is a finite real number so the algebra of "expand and take expectations" is valid. To see what breaks without it, let be a single observation from the standard Cauchy distribution, with density , and consider the (admittedly poor, but legal) estimator for the location parameter of this symmetric Cauchy family. The Cauchy distribution has no finite mean and no finite variance: . Formally attempting the decomposition: , so the left side is (in the extended sense) . But the "bias" does not exist at all — it is not merely infinite, the defining integral does not converge even in the improper sense, because and , and is undefined. So "" is not a well-defined quantity, and the right-hand side cannot even be written down, let alone shown to equal the left side. The theorem's hypothesis is not a technical nicety; without it, the objects in the claimed identity fail to exist.
Scope, edge cases & common traps
| Situation | What happens |
|---|---|
| unbiased | ; the two are literally the same number |
| biased, low variance | MSE can be smaller than that of an unbiased competitor (Example 1, 2) |
| is a constant, e.g. | , ; can be zero at one but huge elsewhere |
| Vector-valued | Decomposition holds coordinatewise, or with |
| Decomposition may fail to be well-defined (see counterexample) | |
| Comparing estimators via MSE | MSE is a function of ; one estimator can dominate on some but not all — no uniformly best estimator generally exists |
The mathematician behind it
Origins · 1 minCarl Friedrich Gauss and how this was discovered
Gauss developed the theory of errors and the method of least squares in the context of astronomical and geodetic measurement, effectively working with what we now call mean squared error as the criterion for the "best" combination of observations. His 1809 treatise Theoria Motus justified least-squares estimation under a normal error model, and his later work (with Legendre's independent, earlier publication of least squares itself) laid groundwork that Gauss and later Andrei Markov formalized into the Gauss-Markov Theorem, establishing minimum-variance properties of least-squares estimators among unbiased linear estimators — a direct ancestor of the modern bias-variance framework.
Is a biased estimator ever preferable to an unbiased one?
Yes, and this is one of the central lessons of the MSE decomposition. Since , an estimator with a small nonzero bias but substantially reduced variance can have strictly smaller MSE than an unbiased alternative. The normal-variance example in this article shows the maximum likelihood estimator of , which is biased, beats the unbiased sample variance in MSE for every sample size . Shrinkage estimators (ridge regression, James–Stein estimators) are built entirely around this principle: deliberately introducing controlled bias to buy a larger reduction in variance.
Does minimizing MSE always require knowing the true parameter ?
In general, yes, which is a genuine practical limitation. MSE is itself a function of the unknown , so an estimator that minimizes MSE at one value of may not minimize it at another; there is typically no single estimator that is uniformly best for every possible (a "uniformly minimum MSE estimator" rarely exists among all estimators, biased or not). This is why statisticians often restrict to a sensible class (e.g., unbiased estimators, or linear estimators) and search for the best estimator within that class, or use a minimax criterion, choosing the estimator that minimizes the worst-case MSE over all .
How does MSE relate to the Cramér–Rao lower bound?
The Cramér–Rao lower bound gives a floor on the variance of any unbiased estimator, under regularity conditions, in terms of the Fisher information. Since MSE equals variance for unbiased estimators, the Cramér–Rao bound directly lower-bounds their MSE too. For biased estimators, a generalized Cramér–Rao bound exists that also lower-bounds MSE, but it depends on the derivative of the bias function with respect to . This connection is why the Cramer-Rao Lower Bound is typically introduced immediately after the bias-variance decomposition: it tells us how small the variance term can possibly get.
What is the Rao–Blackwell theorem's relationship to this decomposition?
The Rao-Blackwell Theorem shows that conditioning any estimator on a sufficient statistic produces a new estimator with the same bias but variance no larger than the original. Combined with the bias-variance decomposition, this means Rao-Blackwellization never increases MSE, and typically strictly decreases it (unless the original estimator was already a function of the sufficient statistic). It is a constructive procedure for exploiting the variance term of the decomposition while leaving the bias term untouched.
Can MSE be decomposed for vector-valued parameters?
Yes. If estimates , define , the expected squared Euclidean distance. The same proof technique (add and subtract coordinatewise, expand, use linearity of expectation) gives , where is the covariance matrix and denotes trace (sum of variances of each coordinate). This vector form underlies the James–Stein phenomenon, where shrinking a vector of unbiased means toward a common point reduces total MSE whenever .
Why does the Cauchy distribution counterexample matter if real data are rarely Cauchy-distributed?
It matters because it isolates exactly which hypothesis is doing the work in the theorem, a key discipline in rigorous mathematics. Heavy-tailed distributions do appear in practice — in finance (extreme returns), physics (resonance line shapes, which are literally Cauchy/Lorentzian), and robust statistics test cases — so the warning is not purely academic. More importantly, it demonstrates that "finite second moment" is not a throwaway technical assumption: without it, bias itself may fail to be a well-defined real number, so the decomposition's right-hand side cannot even be written down, let alone proved equal to the left-hand side.