The LOO Risk That Knows Its Smoother
Suppose you fit a linear smoother to data , meaning the fitted values satisfy
for some hat matrix that does not depend on (e.g., smoothing splines, kernel regression, ridge regression, local linear fits).
The leave-one-out (LOO) cross-validated residual for observation is
where is the prediction at from the model trained without observation .
Show that
where is the -th diagonal element of .
This is remarkable: you get exact LOO error for all folds from a single model fit.
Answer: LOO Risk That Knows Its Smoother
Key Idea / Intuition
The hat matrix is linear, so adding a synthetic point to the training data โ which the model already predicts perfectly โ doesn't change the fit. This self-consistency condition creates a fixed-point equation relating the full-data fit to the LOO fit , and solving it yields the diagonal shortcut. The denominator measures how much observation "influences" its own prediction.
Formal Proof / Solution
Setup
We want to find โ the fitted value at when observation is left out โ without actually refitting the model.
Step 1: Augment the LOO model with a synthetic point
Consider fitting the model on the full data, but replace the -th response with a free parameter . By linearity of the smoother, the fitted value at position is:
This is because , and only the -th entry of changes.
Step 2: Self-consistency argument (ESL Exercise 5.13 logic)
Now, the LOO fit is by definition the prediction at using only .
Key observation: If we augment the LOO training set with the synthetic pair โ a point the model already predicts correctly โ the fit doesn't change. So the augmented fit at position satisfies the fixed-point condition:
That is, when , the model predicts at position , so adding this point is redundant.
Step 3: Solve the fixed-point equation
Set :
Solve for :
Now note that the full-data fit is:
Substitute:
Add and subtract ... more cleanly:
So:
More directly:
Step 4: Compute the LOO residual
Why this is beautiful
- One fit, folds: The LOO-CV score can be computed from one model fit in operations, once is known.
- as influence: If , observation completely determines its own fit (high leverage), and the LOO residual blows up โ correctly signaling overfitting to that point.
- Generalizes broadly: This works for smoothing splines, ridge regression, kernel smoothers โ any linear smoother. For smoothing splines, is the effective degrees of freedom, making this formula central to model selection via GCV.
Source: The Elements of Statistical Learning, Hastie, Tibshirani & Friedman, 2nd ed., Exercise 5.13 and Section 5.4