Lite / Independent Engineering Research / 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?
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.
Predict
You use '0.7 × the average' instead of the plain average to estimate a position 3.6 m away. What happens?
- Less scatter, but systematically too short
- More scatter, but unbiased
- Exactly the same as the average
- Unbiased and less scatter: strictly better
Guess first, then reveal
Scaling by 0.7 cuts the spread to 70%, but pulls the centre to 0.7 × 3.6 ≈ 2.5 m. A shrunk estimator trades variance for bias.
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.
What the interactive shows (text version)
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.
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
Intuitive
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.
Technical
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.
Mathematical
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.
Applied
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.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
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.
Reflect
When would you deliberately accept a biased estimator on a robot?
Write your answer on paper or in your own notes. Lite never stores what you write.