Mean Squared Error
Unbiasedness is not the same as accuracy. An unbiased estimator can be wildly wrong on every sample and still average out to the truth. Mean squared error measures how far the estimator lands from the parameter, counting both kinds of error at once.
Definition. Let be an estimator for a parameter . The mean squared error of is
The squared distance from the target, averaged over all possible samples. Squaring makes errors in both directions count as error, and penalizes large misses more than small ones.
Definition. Given two estimators and for , is more efficient than when irrespective of the value of .
The qualifier “irrespective of ” matters. If one estimator wins for some parameter values and loses for others, neither is more efficient in this sense.
1. The decomposition
Theorem. For any estimator of ,
This identity is the most-used result in the course. Total error splits into a random part and a systematic part, and they are separately controllable.
Proof. Write , so . Add and subtract inside the square:
Expanding the square:
The first term is by definition, and the middle term vanishes because . So .
The immediate corollary. For an unbiased estimator the bias term is zero, so
which is why comparing unbiased estimators reduces to comparing variances.
2. Variance and bias as two kinds of error
The two components fail differently, and the distinction is worth holding.
Variance is scatter. The estimator is centred correctly but individual estimates land far from the centre. More data reduces it, since variance typically falls like .
Bias is displacement. The estimator is tightly concentrated but around the wrong value. More data does not necessarily reduce it, since bias can persist at any .
The dartboard picture: high variance is a wide spray around the bullseye, high bias is a tight cluster off to one side. Both are error, and mean squared error adds them on one scale.
3. Deriving an MSE
The standard exam problem gives a family of estimators indexed by a constant and asks for the MSE as a function of that constant.
Worked example. For with , consider for . Show that
For an exponential, and .
Variance. By independence,
Bias. , so
Combine.
4. Minimizing over the constant
Having the MSE as a function of , minimize it. The parameter enters only through the factor , which does not depend on , so minimize the numerator.
Let . Differentiate:
Setting gives
Verify it is a minimum:
so the critical point is a minimum.
The second-order check is worth a mark on its own and is the step most often skipped. A vanishing first derivative locates a stationary point, not necessarily a minimum.
Reading the answer. The MSE-optimal estimator is
against the unbiased . Dividing by rather than shrinks every estimate toward zero, so is biased low. It is still preferred under mean squared error, because the shrinkage cuts the variance by more than the bias adds. Trading a little bias for a larger reduction in variance is worthwhile whenever total squared error is the criterion.
5. Estimating MSE by simulation
When the expectation is intractable, simulate and use the decomposition. This is the standard R-output question.
Fix the true , generate many samples, compute the estimator each time, and read off the simulated mean and variance.
Worked example. Raffle tickets numbered , five drawn with replacement, two estimators: from the method of moments, and .
set.seed(238)
t1 <- numeric(10000)
t2 <- numeric(10000)
for (i in 1:10000) {
x <- sample(1:100, 5, replace = TRUE)
t1[i] <- 2 * mean(x) - 1
t2[i] <- max(x)
}
round(c(mean(t1), mean(t2)), 1)
round(c(var(t1), var(t2)), 1)Output, at a true :
[1] 100.0 83.8
[1] 666.4 199.8Read the two lines: the first gives the simulated means, the second the simulated variances.
For : mean 100.0 against a true 100, so the bias is 0, confirming unbiasedness. Variance 666.4.
For : mean 83.8, so the bias is , negative as the bounded-support argument predicts. Variance 199.8.
Conclusion: prefer . It carries a substantial negative bias, and its much smaller variance still gives it the smaller mean squared error. This is the bias-variance tradeoff in action, and it is the case where the unbiased estimator loses.
The mechanism is worth seeing. uses only the average of the five draws, so a sample that happens to be low or high moves it a long way. uses the maximum, which for a sample of five is usually somewhere near the top of the range and rarely far from it, so it is stable even though it is systematically too small.
6. When the biased estimator does not win
The comparison can go the other way, and the qualifier “irrespective of ” is where it bites.
For estimating , compare the unbiased proportion of zeros against the biased . Simulating at across :
- has larger squared bias at small , decaying toward zero as grows.
- has the larger variance at every .
- The variance difference dominates, so has the smaller MSE throughout.
Here the biased estimator wins again, but only because the variance gap is large enough everywhere. Change the setup and the ordering can flip, which is why the definition of “more efficient” demands the inequality hold for all .
7. The tradeoff as a decision
Mean squared error is a choice of criterion, not a law. Squared error weights a miss of 20 as sixteen times worse than a miss of 5, and that weighting is an assumption about what errors cost.
When it is right, accept bias for variance reduction whenever the trade is favourable. When the application genuinely requires an estimator correct on average, for instance when many estimates are aggregated and biases would accumulate, unbiasedness is worth its variance cost.
The instruction is to make the decision consciously rather than defaulting to unbiasedness because it sounds like correctness.
Vocabulary to deploy
- Mean squared error .
- The decomposition .
- More efficient: smaller MSE irrespective of .
- Bias-variance tradeoff: accepting bias to buy a larger reduction in variance.
- Shrinkage: scaling an estimator toward zero, biasing it while reducing its variance.
- Second-order condition , required to confirm a minimum.