How do you derive the bias–variance decomposition of the expected squared error , where is the model fitted to a random training set?
Foundations, Bias and variance
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can do the add-and-subtract trick cleanly, and be precise about which expectations are over the training set and which are over the noise.
Key idea
Assume , where is the true function and is noise with and , drawn fresh at test time and so independent of the training set. Add and subtract the average prediction , where averages over training sets . The cross terms vanish because is independent of and has mean zero.
Steps
- Fix a test point . State the model , and note that depends on the random training set .
- Write . Adding and subtracting splits the error into pieces that are easy to average.
- Square, then take expectations over and . Show that each cross term is zero.
- Arrive at that is, bias² + variance + noise.
- Interpret each term. Note that averaging over gives the overall test MSE (mean squared error).
Common mistakes
- Not saying which random variables each expectation is over.
- Dropping the cross terms without justifying it by independence and zero mean.
- Assuming the same decomposition holds for 0-1 loss (the misclassification rate). It does not decompose this simply.
How long your answer should be
A half-page derivation; about 5 minutes at a whiteboard.
Read this
Previous in Foundations: Cross-validation for polynomial regression of degree 1 to 6 gives these mean errors (standard error in brackets): degree 1: 0.300 (0.030); degree 2: 0.180 (0.020); degree 3: 0.115 (0.020); degree 4: 0.100 (0.020); degree 5: 0.095 (0.025); degree 6: 0.110 (0.030). Which degree does the one-standard-error rule choose, and why prefer it to the plain minimum?
Next in Foundations: For a single weight and a number , solve and . Why does this show that L1 regularisation gives sparse solutions and L2 does not?