Mean Squared Error Explained with Worked Examples

The mean squared error of an estimator is . It combines how spread out the estimator is and how far it is off on average.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Mean squared error means

For a sample of from with : the unbiased estimator has variance , so . The maximum likelihood estimator has bias and variance , so : smaller, despite the bias. See the sample variance and the MLE for the normal.

A shrunk estimator of a mean 2 with has bias and variance , so MSE , against for itself: shrinking helps only when the true mean is small relative to the noise. The same trade-off is analysed in the bias–variance decomposition, and ridge regression shrinks coefficients on purpose (ridge regression).

Unbiasedness is therefore not the only criterion. For unbiased estimators the lowest possible variance is the Cramér–Rao bound (Fisher information and the Cramér–Rao bound), and conditioning on a sufficient statistic can only reduce the MSE (Rao–Blackwell).

What is it used for?

Mean squared error rewards estimators that are both close on average and stable.

How to use mean squared error

  1. Find the expected value of the estimator and its bias.
  2. Find its variance.
  3. Compute .
  4. Compare estimators by MSE.

Graph

MSE of the estimators of σ² with n = 10: s² 3.556, MLE 3.04s²: 3.556MLE: 3.0400.511.522.5300.511.522.533.54MSE of the estimators of σ² with n = 10: s² 3.556, MLE 3.04estimatoryGraph with x from 0 to 3 and y from 0 to 4.2. Shows bars (2); point s²: 3.556 at (1, 3.556); point MLE: 3.04 at (2, 3.04).

The biased MLE has the smaller error because its variance is lower.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: unbiased s²

Find the MSE of for , .

Worked example
Answer
3.5563.556
  1. Formula

Example 2: the MLE of σ²

Find the MSE of for , .

Worked example
Answer
3.043.04
  1. Variance
  2. Bias²

Example 3: a shrunk mean

Find the MSE of for , .

Worked example
Answer
0.320.32
  1. Bias²
  2. Variance

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

Var = 2, bias = 0.5

MSE = 2 + 0.25

2.25.

Var = 0.04, bias = 0.1

MSE

0.05.

σ² = 4, n = 10, divisor n

bias = −σ²/n

−0.4.

Unbiased

MSE = Var

Bias zero.

Word problems

MSE(θ̂) = E[(θ̂ − θ)²] = Var(θ̂) + bias(θ̂)². A small bias can be worth accepting if it reduces the variance enough.

MSE

Var = 2, bias = 0.5. Find the MSE.

  1. 2 + 0.25
  2. Check: ✓2.25

Small estimator

Var = 0.04, bias = 0.1. Find the MSE.

  1. 0.04 + 0.01
  2. Check: ✓0.05

Bias of the n-divisor Higher

σ² = 4, n = 10. Find −σ²/n.

  1. −0.4
  2. Check: ✓-0.4

Unbiased Higher

Find the MSE with Var = 2 and bias 0.

  1. 2
  2. Check: ✓2

Common mistakes

Adding bias, not squared

Var + bias ✗

Var + bias² ✓

Square.

Unbiased is always best

ignoring variance ✗

trade-off possible ✓

Bias–variance.

Using SD

sd + bias ✗

variance + bias² ✓

Same units.

Negative MSE

possible ✗

never negative ✓

Check.

Exam tips

  1. MSE = Var + bias².
  2. Square the bias.
  3. Trade-off.
  4. Unbiased: MSE = Var.
  5. Compare estimators by MSE.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. MSE Var 3, bias 1 Foundation

4

2. MSE Var 0.5, bias 0.2 Foundation

0.54

3. MSE Var 1, bias −0.3 Foundation

1.09

4. Bias of n-divisor σ² = 9, n = 3 Higher

-3

5. MSE Var 0.25, bias 0 Higher

0.25

6. MSE Var 4, bias 2 Higher

8

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Mean squared error
E[(θ̂ − θ)²].
Bias
E(θ̂) − θ.
Variance
Spread of θ̂.
Estimator
Rule for estimating.
Unbiased
Bias zero.
Bias–variance trade-off
Balance.

Frequently asked questions

What is MSE?

E[(θ̂ − θ)²].

How does it decompose?

Var + bias².

Is an unbiased estimator always best?

No.

What is the bias of the n-divisor variance?

−σ²/n.

Which page covers maximum likelihood?

maximum likelihood estimation.

Which page covers R²?

coefficient of determination.

More in Advanced statistics and stochastic processes and the formula sheets.