Mean Square Error
Study guides: VEE-MS, Exam MAS-I, Exam MAS-II
The Mean Square Error of an estimator \hat{\theta} of a parameter \theta is the expected squared difference between the estimator and the parameter. The mean square error, \text{MSE}(\hat{\theta}), is
\text{MSE}(\hat{\theta}) = E\left[(\hat{\theta} - \theta)^2\right]
Expanding the square, the mean square error is the variance of the estimator plus the square of its bias:
\text{MSE}(\hat{\theta}) = \text{Var}(\hat{\theta}) + \left[\text{Bias}(\hat{\theta})\right]^2
\text{Bias}(\hat{\theta}) = E[\hat{\theta}] - \thetais the bias of\hat{\theta}.
For an unbiased estimator the bias is 0, so the mean square error equals the variance.
Estimator A of
\thetais unbiased with variance 100. Estimator B has bias-4and variance 50. What is the mean square error of each?
- The mean square error of A is
100 + 0^2 = 100.- The mean square error of B is
50 + (-4)^2 = 66.
Comparing estimators by mean square error
Of two estimators of the same parameter, the one with the smaller mean square error is preferred, and two estimators with nearly equal mean square errors are about equally good. A biased estimator can have a smaller mean square error than an unbiased one when its variance is smaller by more than its squared bias, as estimator B is above.
For a normal sample of size n, the sample variance S^2 divides the sum of squared deviations by n - 1 and is unbiased. Its mean square error is
\text{MSE}(S^2) = \frac{2\sigma^4}{n-1}
The estimator \hat{\sigma}^2 that divides by n has bias -\sigma^2/n, and its mean square error is
\text{MSE}(\hat{\sigma}^2) = \frac{(2n-1)\sigma^4}{n^2}
For every n \ge 2, the biased estimator \hat{\sigma}^2 has the smaller mean square error.
A normal sample of size 10 is drawn from a population with variance 4. Which of
S^2and\hat^2has the smaller mean square error?
- The mean square error of
S^2is2 \times 16/9 = 3.556.- The variance of
\hat{\sigma}^2is2 \times 9 \times 16/100 = 2.88, and its bias is-4/10 = -0.4.- The mean square error of
\hat{\sigma}^2is2.88 + 0.16 = 3.04, which equals19 \times 16/100.- The biased estimator
\hat{\sigma}^2has the smaller mean square error.
Mean square error of a prediction
In statistical learning the target is a response y_i rather than a parameter. The mean square error of a fitted model on n observations is
\text{MSE} = \frac{1}{n}\sum_{i=1}^{n}(y_i - \hat{y}_i)^2
\hat{y}_iis the fitted value for observationi.
On the observations used to fit the model it is the training MSE, and on observations not used to fit it the test MSE (test error). The mean square error of a forecast is the same average, taken over the squared forecast errors. For a model Y = f(X) + \varepsilon fitted as \hat{f}, the expected test MSE at a new point x_0 is
\begin{aligned} E\left[(y_0 - \hat{f}(x_0))^2\right] &= \text{Var}(\hat{f}(x_0)) \\ &\quad + \left[\text{Bias}(\hat{f}(x_0))\right]^2 \\ &\quad + \text{Var}(\varepsilon) \end{aligned}
\text{Var}(\varepsilon)is the irreducible error, the variance of the error term that no model offcan predict.
The expected test MSE is never below \text{Var}(\varepsilon), however flexible the model. The first two terms are governed by the bias-variance tradeoff.
A model fitted to three observations
y = 3, 5, 7gives fitted values\hat = 4, 5, 6. What is the training MSE?
- The residuals are
-1, 0 and 1.- Their squares sum to 2.
- The training MSE is
2/3 = 0.6667.
Comparing biased estimators by their variances The smaller variance means the smaller mean square error only when both estimators are unbiased. An estimator with variance 10 and bias 10 has a mean square error of
10 + 100 = 110, larger than the 100 of an unbiased estimator with variance 100.
Practice questions
- CAS Exam MAS-I Fall 2018, Question 16
- CAS Exam MAS-I Fall 2018, Question 33
- CAS Exam MAS-I Fall 2018, Question 37
- CAS Exam MAS-I Spring 2018, Question 30
- CAS Exam MAS-I Spring 2018, Question 34
- CAS Exam MAS-I Fall 2019, Question 29
- CAS Exam MAS-I Spring 2019, Question 17
- Exam MAS-I Practice Question 36
- Exam MAS-I Practice Question 64
- CAS Exam MAS-I Sample Question 2
- Exam MAS-II Practice Question 7