School/✦ Research Engineer/Week 11
Estimators: bias, variance and error
Two ways to locate a landmark: one is always 20 cm off but rock-steady, the other is right on average but scatters by a metre. Which is better?
About 40 min · 3 goals · Checked by automated tests
1.Why should I care?
An estimator is any recipe that turns readings into a number: an average, a median, a filter. Engineers choose between recipes using two numbers, bias and variance. Learning to see both, rather than just 'is it accurate?', is the core skill of this term.
- ◇ Define an estimator as a function of random data.
- ◇ Distinguish bias from variance and combine them into mean squared error.
- ◇ Compare estimators by simulation and by formula.
2.Discover
With no systematic offset, compare 'average of all n', 'first reading only' and '0.7 × average' at n = 5. Record bias, spread and RMSE for each. Then add a 0.5 m sensor offset and see which numbers move.
Loading the interactive…
Can't use the interactive? Read a description instead
Each dot on the dartboard is one repeated experiment's estimate; the cross marks their centre. The readout gives observed and theoretical bias, spread and RMSE, so the comparison can be made from the numbers alone.
3.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
An estimator has bias 1.2 cm and standard deviation 0.5 cm. What is its RMSE, in cm?
4.Predict
You use '0.7 × the average' instead of the plain average to estimate a position 3.6 m away. What happens?
Guess first. Being wrong here is how the surprise works.
5.Understand
The estimator is random
An estimator θ̂ = g(X₁, …, Xₙ) is a random variable, because the data are. Imagine repeating the whole experiment many times: each repeat gives a dart on the board. We judge the estimator by the cloud of darts, not by one throw.
Bias and variance
Bias = E[θ̂] − θ: how far the cloud's centre is from the truth. Variance = E[(θ̂ − E[θ̂])²]: how scattered the cloud is. The sample mean is unbiased with variance σ²/n. Using only the first reading is also unbiased, but its variance is σ²: n times worse.
Mean squared error
MSE = E[(θ̂ − θ)²] = bias² + variance. RMSE = √MSE is in the units of θ. A slightly biased estimator can have lower MSE than an unbiased one if it cuts variance enough. That is why filters sometimes deliberately smooth (accepting lag, a bias) to reduce noise.
Explain it another way
Bias is aiming at the wrong spot; variance is a shaky hand. You can be steady and wrong, or wobbly and right on average. The total miss distance counts both.
Consistency: an estimator is consistent if it converges to θ as n → ∞. The sample mean is unbiased and consistent; 0.7 × mean is neither unbiased nor consistent; 'first reading' is unbiased but not consistent.
MSE decomposition: E[(θ̂ − θ)²] = E[(θ̂ − E θ̂)²] + (E θ̂ − θ)², because the cross term 2E[θ̂ − E θ̂](E θ̂ − θ) is zero. For the median of normal data, Var ≈ (π/2)σ²/n for large n: about 57% more variance than the mean.
A rover's landmark range from the camera is biased if the camera calibration is off. Re-calibration attacks bias; averaging frames attacks variance. Knowing which dominates tells you which to spend effort on.
Worked example 1
An estimator has bias 0.3 m and standard deviation 0.4 m. What is its RMSE?
MSE = 0.3² + 0.4² = 0.25 m², RMSE = 0.5 m.
Worked example 2
Mean of 16 readings with σ = 2 m versus a single reading: compare RMSE (both unbiased).
Mean: 2/√16 = 0.5 m. Single: 2 m. The mean is four times better.
Common mix-ups
- Unbiased means accurate.
✓ Unbiased means right on average. A single unbiased estimate can still be far off if its variance is large. - Bias and variance are the same thing measured differently.
✓ They are separate: averaging reduces variance; only calibration or a better model reduces bias.
6.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
'Use only the first of n readings' is an estimator that is…
Practice 3
Estimator A: bias 0, σ = 2. Estimator B: bias 0.5, σ = 1. Which has lower MSE?
Practice 4 · a fresh version every time
A star tracker's single attitude measurement has σ = 2 arcseconds. You average n = 49 independent measurements. What is the standard error of the average, in arcseconds?
Practice 5
For normal data and large n, the median's variance is about (π/2)·σ²/n. How many readings must the median use to match the mean of 100 readings?
7.Apply it
Design a dartboard experiment that shows the median beating the mean. (Hint: think about occasional wild readings, such as a camera mistaking a rock for the landmark.) Describe the noise model you would need and predict the result.
8.Reflect
Concepts: Statistical estimation: bias, variance and likelihood · Measurement error and uncertainty