Covariance formula for prediction optimism 2026-10-14
With fixed covariates and independent new responses having the same marginal distributions as the training responses, expanding squared losses cancels their second moments. Independence makes , yielding the displayed identity. For a fixed linear smoother with covariance , it reduces to , linking prediction optimism to effective degrees of freedom.
// Target: analysis.bigb
Fitted values Created 2026-09-24 Updated 2026-10-14
Fitted values are the predictions at the predictor values used to fit a regression model. In linear regression with an explicit regression intercept,Here is the slope design matrix, and is the regression residual vector. The fitted values estimate the regression function at the observed predictors; they need not equal the observed responses, which may also contain random errors. Prediction at a new predictor vector uses with the same centering and scaling used in fitting. A prediction interval addresses uncertainty in a new response rather than just displaying this point prediction.
For the five constructed observations in linear regression, ordinary least squares gives fitted values . The ridge regression fit at instead gives . Both fitted vectors have sample mean because the regression intercept is unpenalized; their regression residuals differ and their residual sums of squares are and , respectively.
For ordinary least squares, the fitted values are the orthogonal projection of onto the column space of the complete design matrix, including its regression intercept column. They remain unique even in rank-deficient ordinary least squares, although the regression coefficients can be nonunique. The regression residuals are then orthogonal to every column.[ref]
Regression 1: Different perspectives. slides 6–10: fitted values, hat matrix, projection and orthogonal residuals
With centered slopes, ridge regression instead satisfies , so the regression residuals need not be orthogonal to the slope columns. Their sum is still zero because the regression intercept remains free.For fixed predictors and scales and a fixed positive penalty, ridge regression gives a linear smoother,For with at least one nonzero slope direction, this matrix is not an orthogonal projection matrix: applying it twice shrinks that direction again. Its effective degrees of freedom are , where are the positive singular values of ; the extra counts the free regression intercept. If the penalty is selected using , the resulting fitting rule need not be a linear smoother, since its chosen also depends on .
Generalized cross-validation Created 2026-10-06 Updated 2026-10-14
For a fixed linear smoother, generalized cross-validation replaces the individual leverage corrections of Leave-one-out cross-validation by their average. It selects smoothing parameters by minimizing the displayed criterion. It approximates a predictive error criterion; it is not a universal exact estimate of future error and requires care when observation errors are dependent.
Linear backfitting equations 2026-10-14
For linear smoothers, let and . The centered fixed-point equations of the backfitting algorithm have diagonal identity blocks and off-diagonal blocks . On the centered component space, a consistent system has a unique answer exactly when its homogeneous system has only the zero solution. For two components the reduced equation is . A common centered vector reproduced by both smoothers yields opposite perturbations of the components without changing their sum.
// Target: probability-and-statistics.bigb
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 45 1 b Solution Created 2026-10-03 Updated 2026-10-14
There are two distinct identifiability issues. Without centering, constants can move between the regression intercept and the additive components. After centering, the decomposition still fails to be unique if there are nonzero allowed centered perturbations satisfyingThen replacing by leaves every fitted response unchanged. This nonlinear analogue of multicollinearity is concurvity. For example, if two predictor columns are identical, a centered function can be added to the effect of the first and subtracted from the effect of the second. Conceptually, the data observe their combined effect but cannot tell which predictor deserves the credit. A unique fitted sum can therefore coexist with nonunique individual effects. Smoothness penalties can distinguish some such decompositions, so a representation ambiguity is not automatically an ambiguity of every penalized estimator.
For a precise criterion for the backfitting algorithm with linear smoothers, put , , and . On the centered component space its fixed-point equations are the linear backfitting equationsA consistent system has more than one solution exactly when there is a nonzero centered tuple satisfying for all . In the two-component case, elimination givesThusA common centered direction reproduced exactly by both smoothers, , gives the homogeneous perturbation and is a concrete instance. For example, two identical predictor columns with smoothers that reproduce the same centered linear trend have this property. Approximate concurvity yields an eigenvalue near one, causing poor conditioning and slow or unstable component estimation, but it does not constitute exact nonuniqueness. Failure of an iteration to converge is also distinct from the existence of multiple fixed points.
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.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 5 e Solution Created 2026-10-03 Updated 2026-10-06
The null model's 99 residual degrees of freedom imply . Each predictor has a one-degree-of-freedom linear contribution in the parametric table, plus the reported nonlinear contribution. Consequently the termwise effective degrees of freedom areInclude the intercept once, giving about total effective degrees of freedom. The more precise residual degrees of freedom in the output giveThere is no conflict: and are rounded, so they cannot recover the precise total. Individual unrounded termwise values are not provided.
The package's residual mean-square estimate of error variance ismatching the rounded in the table. The nonlinear experience contribution is highly significant, while the smaller nonlinear education contribution has approximate .
This calculation uses the effective residual degrees of freedom reported by this fit. For a general non-idempotent linear smoother , the noise contribution to expected RSS is , and the expectation can additionally contain squared smoothing bias. Thus dividing by is not a universal exact-unbiasedness theorem. The output's separation of linear and nonlinear term degrees of freedom is documented at cran.r-project.org/web/packages/gam/gam.pdf.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 218 2 e Solution Created 2026-09-24 Updated 2026-09-25
Put , so and with independent noise vectors having covariance matrix . For any deterministic linear smoother ,whereas independence givesExpanding the first trace shows that the second expression exceeds the first by , proving the identity.
For ridge regression,Its effective degrees of freedom are . Thus training error is optimistically biased for independent-copy prediction error by . The graph exhibits exactly this effect: the dashed training curve keeps falling as decreases, while the solid test curve eventually rises through overfitting.