The Mean as a Constant Squared-Error Predictor
For a list of real targets, the arithmetic mean minimizes squared error among constant predictions.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace three targets
For 2, 4, 6, predicting four gives squared residuals 4, 0, and 4. Predicting three gives 1, 1, and 9, for a total of eleven instead of eight. The sample mean gives the minimizing value.
Use a comparable reference
A fitted model should be compared with a mean estimated from training data and evaluated on the same held-out targets. See training and test boundaries.[1]
Derive the best constant for a small sample
For targets two, four and nine, their arithmetic mean is five. Predicting five gives squared residuals nine, one and sixteen, totaling twenty-six. The objective \(\sum_i(y_i-c)^2\) is minimized at the mean because its derivative in \(c\) vanishes there with positive curvature. See MAE and MSE.
Constant 4 → squared errors 4,0,25 → total 29
Constant 5 → 9,1,16 → total 26
Constant 6 → 16,4,9 → total 29
Check sensitivity to outliers
Replacing nine by ninety moves the best squared-error constant substantially. A different loss can produce a different baseline. Fit the constant using training targets only.