Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 45 4 b Solution Created 2026-10-03 Updated 2026-10-14
Condition on the training covariates, and let . The fresh response has the same marginal distribution as and is independent of the complete training response vector, hence independent of . Assume the relevant second moments are finite. Expanding the squared errors givesThe first expectation averages over both training and new responses; the second averages over training responses only. Subtracting cancels both second-moment terms, leavingAveraging over the design points proves the covariance formula for prediction optimism:No linear fitting rule or Gaussian noise assumption is needed. The difference arises because a training response and its fitted value are dependent, whereas a fresh response and the fitted value are independent. Ordinary fitting often makes those covariances positive and the training error too favorable, explaining the name prediction optimism.
For example, if is a fixed linear smoother and , then . ThusThis links the optimism correction to effective degrees of freedom. For a data-selected fitting operator, its realized trace alone does not generally give the covariance penalty, since selecting the model uses the responses too.
Training error Created 2026-09-24 Updated 2026-10-14
Training error is the average loss function evaluated on the observations used to fit the prediction rule. It is the empirical risk of the fitted rule on its own training data. With squared-error loss, it is the average squared regression residual, measuring fit to observed responses rather than performance on fresh responses. Flexible fitting usually makes it optimistically biased for prediction error, as quantified by prediction optimism.
For a reproducible polynomial regression example, take , , and the known noiseless target . Construct responses with fixed disturbancesOrdinary least squares over polynomials of polynomial degree at most 1, 2, and 7 gives training errors , , and . The monotone improvement follows because these candidate families are nested: every smaller-degree fit remains available in the larger family. This argument concerns minimum training error, not generalization, and assumes the fitting mathematical optimization is solved. Degrees 2 and 7 fitted instead to the exact noiseless responses have mathematically zero training error; the script obtains approximately and from rounding. Extra flexibility alone does not force overfitting.