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 .
In an additive regression model, each component can transfer a constant to the regression intercept, so impose empirical mean-zero constraints, or population mean-zero constraints when appropriate. Even after centering, nonzero component perturbations with at every observed point make the additive decomposition nonidentifiable. Extra smoothing penalties may resolve the fitted decomposition, but centering alone does not remove concurvity.
// Target: probability-and-statistics.bigb
The fitted simple linear regression isIts regression slope is a predicted decrease of approximately 0.006314 trust-score units per extra year, or 0.06314 units per decade. This is an estimated statistical association between age and the score. A cross-sectional study does not establish that the same person's trust decreases at this rate as they age.
The estimated standard error of the slope is 0.005427. Testing a zero regression slope gives on 746 residual degrees of freedom and . An approximate 95% confidence interval isThere is insufficient evidence of a nonzero linear age association at the 5% level. The interval includes both small negative and small positive slopes; failure to reject does not establish an exactly zero relationship or rule out a nonlinear one.
The regression intercept 6.388920 predicts the score at age zero. That age is outside the observed 19–89 range, so interpreting it substantively would be extrapolation. Its very small reported p-value tests a zero intercept, rather than the age hypothesis. The 746 residual degrees of freedom correspond to 748 observations minus the intercept and slope.
The coefficient of determination is , so the fitted line explains approximately 0.1811% of the observed centered variation, rather than 18.11%. The adjusted coefficient of determination is approximately 0.0004732. The residual standard error is 2.602 score units, close to the reported response standard deviation; most variation remains unexplained by the fitted line. With one predictor and an intercept, the slope's F-test is the square of its Student's t-test statistic, up to printed rounding, so and agree with the slope test.
Output 6 is a residual-versus-fitted plot: its vertical coordinates should be regression residuals . The fitted values range over only approximately 5.83–6.27, as the weak slope predicts over ages 19–89. The printed scatter shows no obvious strong mean curvature or clear widening funnel, but it has marked horizontal concentrations near its extreme residual levels. An absence of obvious curvature does not prove a correct linear conditional mean, and the plot alone cannot establish homoscedasticity, independent errors or a normal distribution. A normal probability plot and residuals against observation order address different aspects. Large residuals also do not by themselves establish influential observations; regression leverage and Cook's distance matter.
There is an additional inconsistency in the original figure. The descriptive output reports observed responses between zero and ten, so residual constraints from a bounded response requireYet the printed graphic contains points around , which would imply , above the stated observed maximum. Some lower-edge points likewise imply negative responses. This is present in the original PDF, rather than introduced by the transcription. The graphic therefore cannot be treated as a fully consistent diagnostic of the reported dataset. The observations about its visible shape above describe the supplied picture; reliable model checking would require the actual fitted values and residuals.
The printed code has separate typographical problems. The displayed model call supports the intended formula with
~, and the plot needs one closing parenthesis:model1 <- lm(t_guard ~ age, data = exam)
plot(fitted(model1), residuals(model1),
xlab = "Fitted values", ylab = "Residuals")
abline(h = 0)These calls correct the syntax; they cannot be rerun on the original observations because the individual-level dataset is not supplied. The regression interpretation above uses the available numerical summaries and states the diagnostic limitation explicitly.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 41 2 Solution Created 2026-10-03 Updated 2026-10-14
A factor is a categorical predictor whose levels distinguish experimental conditions. Two factors have a statistical interaction when the effect of changing one depends on the other's level. For cell means , absence of an interaction means ; equivalently, is independent of .
Index thickness by , temperature by , wash by and replication by . The full factorial design has the normal linear modelThe errors are independent with a common positive variance. Sum-to-zero constraints in each factor index, or the displayed treatment coding, identify the mean coefficients. This full model allows an arbitrary mean in each of the sixteen cells.
The missing statistical degrees of freedom, in the output order, are . The first seven entries total fifteen; with the regression intercept there are sixteen mean coefficients among thirty-two observations, leaving sixteen residual statistical degrees of freedom. Balanced factorial orthogonality makes the term sums of squares in ANOVA independent of their ordering.
All terms involving wash have nonsignificant individual F-tests, and it is useful to test their removal jointly. The reduced model omits twelve mean coefficients. Its residual sum of squares is , compared with for the full model, so the nested-model F-test givesThere is no detected wash effect over the four tested durations. Removing its main effect and all its interaction terms respects the principle of marginality. Retaining the very large thickness-by-temperature interaction is essential: the thickness effect changes substantially with temperature.
With numeric indicators , treatment coding expresses the reduced fitted mean asThus the thin/low, thick/low, thin/high and thick/high fitted means are , respectively, at every wash level. Each is the sample mean of eight observations. The equal-cell replication variance formula therefore givesAlternatively, use the variance of a fitted regression mean with : . Individual coefficient standard errors cannot simply be added; their covariances enter the fitted-mean calculation.
Increasing temperature raises fitted lustre by for thin film and for thick film. Increasing thickness raises it by at low temperature and at high temperature. Their difference, , is the estimated interaction contrast; its standard error is , giving on twenty-eight statistical degrees of freedom. The interaction plot shows this strong departure from parallel mean lines, while the wash panel shows the much smaller variation across wash durations. Neither the nonsignificant wash test nor the plot proves that its true effect is exactly zero.
Past exam of the mathematics course of the University of Cambridge 2006 iii Paper 41 3 Solution Created 2026-10-03 Updated 2026-10-14
The Poisson distribution mass function isIt is an exponential dispersion family of order one withIndeed, and . A generalized linear model specifies independent random variables from a response exponential family, together with a linear predictor and a link function relating it to the response mean. The Poisson canonical link is .
For the insurance counts, let class and merit be the reference levels in a regression factor. The fitted Poisson regression assumesThe insured exposure is known; its logarithm is an offset, not a coefficient to estimate. The model has eight free mean parameters and fixes the dispersion parameter at one. It assumes additive class and merit effects on the log-rate scale, hence multiplicative effects on the rate scale without a class-by-merit interaction.
Apart from constants independent of the parameters, the log-likelihood isDifferentiating gives the Poisson regression margin-matching score equationsThus the fitted totals equal the observed totals in each class and merit category, including the reference categories by subtraction. In design matrix notation these equations are . Fisher scoring solves them iteratively; the reported three iterations describe the numerical fit, not an additional statistical result.
The regression intercept gives the baseline fitted claim rate per insured car year. The merit rate ratios, relative to merit at the same class, areThe class rate ratios, relative to class at the same merit, areEach predicted cell rate is the baseline rate times its class and merit multipliers. The output's coefficient-to-standard error ratios are asymptotic normal Wald test statistics under the fitted Poisson regression, despite the software label “t value”; there is no estimated Gaussian residual scale in this model. All nonreference effects have very large absolute ratios.
The null Poisson deviance is on nineteen statistical degrees of freedom; adding the seven factor coefficients reduces it by . But the final Poisson deviance is still on twelve statistical degrees of freedom, and the deviance residuals include values near and . These are far beyond what a well-fitting unit-dispersion model would normally produce. The additive Poisson model fits substantially better than a common rate, but remains grossly inadequate. A class-by-merit interaction, overdispersion, or statistical dependence between claims could contribute; the summary alone does not distinguish these explanations. Its very small nominal standard errors and formal Wald tests rely on the rejected model, so improved mean structure and error assumptions are needed before treating them as reliable uncertainty assessments.
Past exam of the mathematics course of the University of Cambridge 2008 ib Paper 4 19H ii Solution Created 2026-09-24 Updated 2026-10-14
Set . The maximum likelihood estimation formulas for simple linear regression giveUsing the supplied rounded summaries gives metres and metres. Recomputing directly from the printed table gives approximately and metres, respectively, so the small summary rounding differences do not affect the conclusion.
I would not accept the model merely because the Student t-test fails to reject a zero regression intercept. That hypothesis test tests one parameter restriction within the assumed model, not the adequacy of its error assumptions or its functional form. In particular, complementary elevations and have exactly the same and hence the same fitted mean, but their observed low-angle minus high-angle ranges arefor the four corresponding pairs. All four are positive, suggesting an elevation-dependent effect omitted by the mean model, such as air resistance, rather than random scatter determined only by . This is a regression diagnostics concern, not a claim that these finite data logically rule out the normal-error model. The correct conclusion is nonrejection of the intercept restriction does not validate the regression model; further checks of the residual pattern and error assumptions are needed.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 45 1 a Solution Created 2026-10-03 Updated 2026-10-14
Write for the training values of each component in the additive regression model. Separate the regression intercept from the smooth components by imposing for every . Without these constraints, adding a constant to a component and subtracting it from the intercept gives exactly the same mean function. A population alternative is when those expectations exist. Additional identifiability of additive regression components requirements exclude redundant component directions, as discussed below.
The backfitting algorithm proceeds as follows:
- Initialize and for all , or use another centered starting fit. Choose the smoother and its tuning parameters for each predictor.
- Cycle through . Form the partial residual , using the newest available component estimates.
- Apply the generic smoother in predictor : . Center its fitted values and replace the current component by . The same centering constant is subtracted from its function when predicting at a new predictor value.
- Repeat complete cycles until the components and fitted sum change by less than the chosen numerical tolerance. Return .
Because every component remains centered, the least-squares update of the intercept remains throughout. The essential update isFor penalized least-squares smoothers these updates are coordinate descent on the additive fitting objective. For a completely arbitrary smoother, convergence is an additional property to establish, not a consequence of merely specifying the iteration. Centering removes the constant ambiguity but does not by itself remove concurvity.
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 2010 iii Paper 32 3 Solution Created 2026-10-03 Updated 2026-10-14
In a linear regression model, a large number of predictors or nearly dependent columns of the design matrix can make some eigenvalues of small. The ordinary least squares estimate has covariance matrix , so these directions have large variance, even though the estimator is unbiased. Ridge regression reduces this variance by shrinking the estimate towards zero, at the cost of introducing bias. This bias-variance tradeoff can improve the mean squared error when the signal is not too large in the shrunken directions.
For the usual preprocessing with a regression intercept, separate the constant column from the predictors and leave the intercept unpenalized. Subtract the sample mean from the response and from each nonconstant predictor, then divide each centered predictor column by its positive scale, for example its Euclidean norm. Thus all predictor columns have squared norm one; using squared norm instead simply changes the convention for the penalty. Centering is performed on the slope columns, not on the constant column. A full-rank design containing an intercept retains full rank on its centered slope columns. A model without an intercept should retain its specified mean structure unless an intercept is deliberately introduced.
Let be the resulting scaled, centered slope design matrix, let be the centered response, and let denote the coefficients in these standardized coordinates. The ridge regression problem isHere is the number of slopes; it is one less than the original number of columns when a constant column was present. The gradient of this objective is . Its Hessian matrix is a positive-definite matrix, giving the unique closed-form ridge regression estimatorThe regression intercept in the original coordinates is recovered as , and the original slopes are , where is the scale used for column . This is the unpenalized intercept in ridge regression convention. For a fixed full-rank coefficient design written simply as , with response and coefficient , the same formula readsThe risk comparison below first uses the fixed coefficient coordinates in which this quadratic penalty is imposed, and then addresses reversal of the scaling.
Assume at least one penalized coefficient, zero-mean errors with covariance matrix , and . No normal distribution assumption is needed for this mean squared error calculation. Put and . The covariance and bias of a ridge regression estimator follow directly from its linear expression:For the centered slope model, the response errors have covariance matrix , where . Since , the same coefficient covariance matrix formula still holds with .
By the spectral theorem for real symmetric matrices, write , with orthogonal and every , and put . The bias-variance decomposition of mean squared error now givesThe expression at is the ordinary least squares mean squared error. Its right derivative isTherefore, for every fixed coefficient vector, all sufficiently small positive penalties strictly improve mean squared error.
An explicit sufficient choice follows by subtracting the ordinary least squares risk term by term:Since , every summand is negative wheneverWhen , every positive penalty works. This is a pointwise result: the permitted penalty may depend on the true coefficient vector. A fixed positive penalty cannot improve risk for all arbitrarily large signals, because its squared bias grows quadratically with the signal. The same distinction appears in uniform directional risk improvement by ridge regression and unbounded directional risk of fixed ridge shrinkage. In centered coordinates the unpenalized intercept contributes the same to both coefficient risks, so it does not affect the improvement. Reversing a fixed predictor scaling measures coefficient error with a fixed positive-definite matrix instead of the identity matrix. For this weighted loss the squared bias still has derivative zero at , while the variance term has derivativeThe inequality follows because . Thus sufficiently small penalties also improve the original-coordinate mean squared error, though the explicit sufficient bound above was for the unweighted coordinates. Recovering an uncentered intercept adds a fixed nonnegative quadratic form to the slope loss, and its sample-mean error is uncorrelated with the centered slope errors, so the same weighted argument applies. A model with only an unpenalized intercept gives identical estimators. If the noise variance were zero, the strict improvement assertion would fail; positive noise variance is essential.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 1 Solution Created 2026-10-03 Updated 2026-10-06
The ordinary least squares objective has gradient . The normal equation therefore givesThe Gram matrix is a positive-definite matrix because has full column rank. More explicitly, for any ,since . This proves that the displayed solution is the unique global minimum.
The fitted values are , where the hat matrix isThe inverse of the symmetric matrix is symmetric, so . Multiplication gives . Thus is the orthogonal projection onto the column space of the design matrix.
The regression residual vector is with . Consequently , , and the residual sum of squares isBy fitted-residual orthogonality, . Using , the cross-covariance matrix isBoth vectors are jointly normal, so they are also independent by independence of uncorrelated jointly normal variables. The zero covariance calculation itself only needs the common error variance and lack of error correlations.
For the first wind fit, let be wind velocity and electrical output. The simple linear regression is , with independent . It has two fitted mean parameters and residual degrees of freedom. The missing analysis of variance entries are therefore velocity degrees of freedom , velocity mean square , and residual degrees of freedom . The residual mean square is , and , consistent with the printed value after rounding.
Because the model includes a regression intercept, the coefficient of determination is the explained sum of squares divided by the total centered sum of squares:A large coefficient of determination does not rule out a wrong mean function. In the PDF's first residual-versus-fitted plot, residuals are negative at both ends and positive in the middle. This curved pattern agrees with the visibly flattening output-versus-velocity relationship and motivates a polynomial regression with a quadratic term.
The second wind model is , again with independent common-variance normal errors. Its fitted mean is . The line marked (A) is a two-sided Student t-test of against , conditional on retaining the intercept and linear term. Under the null hypothesis,Its two-sided p-value is . This is far below , so reject a purely linear mean in favour of the quadratic fit. Equivalently, the extra-term nested-model F-test has and null law .
The third fit is a reciprocal-predictor regression, , with estimated mean . It has two mean parameters rather than the quadratic model's three. Its residual standard error is smaller, versus , and its coefficient of determination is larger, versus . The corresponding residual sums of squares are approximately and . The reciprocal fit is preferable on both these fit measures and parsimony. The two models are not nested, so an ordinary extra-term F-test between them is inappropriate. On the common normal-error likelihood, the difference also favours the third model.
Neither lower residual sum of squares nor a higher coefficient of determination establishes adequate assumptions. The quadratic residual-versus-fitted plot removes the original pronounced curvature; the reciprocal plot also has no comparably obvious mean trend. The low-output residuals appear somewhat more spread out, so check scale-location plots and residuals against velocity for heteroscedasticity. Q-Q plots assess normality; residuals against observation order assess serial dependence; regression leverage and Cook's distance identify influential observations. Further cross-validation, replicate observations at comparable velocities, and prediction errors would help choose between their extrapolation behaviours. Both fitted shapes should be judged principally over the observed positive-velocity range.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 2 Solution Created 2026-10-03 Updated 2026-10-06
Let be recall for age level , processing level , and replicate . Write for Younger and for Older. With Older and A as the reference levels in a regression factor, the additive two-factor normal linear model under treatment coding iswhere the errors are independent , with common positive variance. The design matrix is fixed; subjects supply independent observations; the specified conditional mean is correct; and the absence of an interaction term means the age difference is constant across processing levels. These are model assumptions, not consequences of random assignment. The treatment allocation supports independence between processing assignment and background characteristics, but age itself was not randomized.
An older subject in A has and , so the estimated mean is words. Its standard error is the intercept's . There are residual degrees of freedom, giving the 95% confidence interval for this mean:This is a mean-response confidence interval, not a prediction interval for a new individual's recall; the latter also includes the new observation's error variance.
The second two-factor normal linear model adds age-by-processing interaction terms:Its ten free mean parameters are equivalent to one mean for each of the ten cells. To compare the fits, the null hypothesis is . The full residual sum of squares is on degrees of freedom. Adding interaction reduces the additive model's residual sum of squares by , so the reduced value is . The nested-model F-test statistic isIts p-value is . Reject additivity and retain the interaction model. The significant interaction means that a single age effect averaged over all processing methods does not adequately summarize the data.
The regression intercept is the older-A mean. The age coefficient is the younger-minus-older contrast specifically in A. The processing coefficients compare B, C, D and E with A specifically among older subjects. The interaction coefficients are differences between the age contrast in each of those methods and its value in A. Adding the relevant coefficients givesThus A, C and especially D favour younger subjects in their estimated means, whereas B and E have little estimated age difference. In the younger group, D has the largest estimated recall, followed by C and A; B and E are much lower. Among older subjects C is largest, D and A are intermediate, and B and E are lowest. Comparing these orders is a description of estimates, not a claim that every pairwise difference is significant.
Each coefficient's printed standard error estimates its uncertainty; its statistic divides the estimate by that error, and its two-sided p-value uses under the relevant zero-contrast null hypothesis. For example, the older B-versus-A and E-versus-A contrasts have and . The C-versus-A and D-versus-A older contrasts have and . The B interaction has , while the D interaction is borderline at and the other two individual interaction tests are not significant at . These individual tests do not override the joint interaction F-test, and multiple comparisons require care. A simple younger-versus-older contrast outside A combines coefficients and must use their estimated covariance, rather than adding their marginal errors.
The residual standard error estimates . The coefficient of determination is the fraction of centered sample recall variation explained by the ten-cell model. The overall with null law tests all nine non-intercept coefficients jointly against zero, giving extremely strong evidence that the cell means are not all equal. The sequential analysis of variance separates age, process, and their interaction; the balanced design makes the main-effect sums orthogonal, whereas the coefficient table uses the specified reference-level contrasts.
To assess pooling into three processing types, retain age-by-type interaction because the previous test rejects additivity. The reduced model has six cell means. Its null hypothesis says A and C have equal means within each age, and B and E have equal means within each age: four restrictions. Compare it with the ten-cell model usingIn fact the supplied fitted cell means and equal cell sizes determine the increase without raw observations. Pooling two ten-person cells with means adds to the residual sum of squares. Here the four differences are , soTherefore and . At , the data do not reject the three-type reduction, though the result is borderline and is not proof that the pooled means are identical. This factor-level pooling test keeps the previously supported interaction structure; reducing the categories and removing all interaction simultaneously would test a different set of restrictions.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 4 b Solution Created 2026-10-03 Updated 2026-10-06
The generalized cross-validation curve reaches its minimum at among the supplied grid values. This balances improved conditioning against shrinkage bias using an estimate of prediction error, rather than choosing the penalty with the smallest training residual sum of squares. Nearby values have similar errors, so the plot does not establish a highly precise optimal penalty.
Reading the PDF table at gives the fitted regression intercept and slopes:These table entries are necessary because the TeX stores the table only inside a figure. The ridge regression slopes are shrunk relative to the zero-penalty fit; their small nonzero values do not represent variable exclusion.
There is a minor source inconsistency: the prose says the predictors are centered, but the table's intercept varies with . With exactly centered predictor columns and an unpenalized intercept it would remain . The numbers above faithfully report the printed table, while part (a) gives the centered formula and the general uncentered conversion. The table therefore reflects a different or incompletely described preprocessing convention.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 4 d Solution Created 2026-10-03 Updated 2026-10-06
At fraction , the Lasso regularization path lies between the vertical lines marked steps 4 and 5. In that interval the first five predictors have nonzero slopes: are positive and is negative. The sixth predictor remains at zero until the later part of the path, beyond this fraction. Therefore the chosen Lasso model includesThe regression intercept is retained. In particular the negative trace has already left zero at fraction ; a small slope is not the same as a zero slope. The selected fraction came from ten-fold K-fold cross-validation, and is not a numerical value of the ridge penalty in the preceding parts.
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 4 10J Solution Created 2026-09-24 Updated 2026-10-06
Write . Minimizing the residual sum of squares first over the coefficients of reduces the problem to minimizing . Full column rank ensures . Thus the partial regression formula and its variance areThis uses and the isotropic error covariance matrix .
Since the span of is contained in the column space of , orthogonal projection onto the latter removes at least as much squared norm. Consequentlyand inversion proves the requested lower bound. Full rank makes the denominator positive.
Adding to column leaves the column space unchanged. Every old fitted vector is reproduced by keeping all slopes unchanged and replacing the regression intercept by . Uniqueness of the ordinary least squares estimators then proves that slope is unchanged. In particular all columns can be centered by such changes. Applying the previous projection argument to the centered design proves the bound with and ; the normalized inner product is now the usual sample correlation.
Each reported coefficient test is the two-sided Student's t-test of against , conditional on the other predictors. Under the null, has a Student's t-distribution with degrees of freedom. At five percent the intercept is significant, but neither individual test slope is. The final F-test compares the full model against an intercept-only model: . It has degrees of freedom and rejects at five percent, since its -value is . Thus the predictors jointly explain variation, without strong evidence separating their individual conditional effects.
The two test predictors have sample correlation , although each has only moderate correlation with the final exam response. The variance inflation factor is . Their nearly shared direction produces substantial multicollinearity, inflating the individual slope standard errors. The joint F-test can detect this common predictive direction even though either coefficient, given the other, has a large -value.
Let , , and . The independent observations in the normal linear model giveThe centered design condition removes the term:The stated prior density factors into independent normal distributions for the regression intercept and regression coefficient . Multiplication by the likelihood function therefore leaves separate quadratic expressions in the two coefficients. Define the positive posterior variancesand the posterior meansBy completing the square, the joint posterior density isEquivalently,This is Gaussian conjugacy for a normal linear model. Each posterior precision parameter is the sum of its data and prior precision parameters. The formulas remain valid when : all are then zero, so the posterior distribution of equals its prior distribution.
Ridge regression Created 2026-09-24 Updated 2026-10-14
Ridge regression fits a linear regression model while penalizing the size of its slope regression coefficients. For a fixed design matrix containing the slope predictors, observed responses , and an unpenalized regression intercept , the objective isHere is the all-ones vector, and is the squared Euclidean norm of the slopes alone. The first term is the residual sum of squares; the second implements regularization. No random-error assumption is needed to define this fit. The convention is a summed squared-error loss: writing the objective as gives the same fit when .[ref]
Modern regression 1: Ridge regression. slides 5 and 7: summed squared-error objective and unpenalized intercept
For an exact example, reuse the constructed pairs from linear regression. Their sample means are and , and the centered cross-products are and . ThusThe ordinary least squares line has slope and residual sum of squares . At , ridge regression has slope , regression intercept , and residual sum of squares ; at these become , , and . Every line passes through : the penalty reduces the slope while retaining the response sample mean.
The computational benefit is visible after predictor centering. Write for the design matrix with each column's sample mean subtracted, and . The unpenalized intercept in ridge regression gives , and the closed-form ridge regression estimator solvesFor any nonzero vector and , . This positive-definite matrix is therefore invertible even when lacks full column rank, including repeated columns or . The unique penalized slopes resolve the ambiguity of rank-deficient ordinary least squares; they do not supply evidence about slope directions absent from the data. This makes ridge regression useful for multicollinearity.[ref]
High-Dimensional Regression: Ridge. p. 1, equations (1)–(2): uniqueness for positive penalty regardless of design rank
Predictor centering and scaling serve different purposes. Centering handles the free regression intercept. Scaling determines what counts as a large slope: replacing by changes its coefficient to for the same predictions, changing its contribution to an unweighted penalty. A common convention forms standard scores using each nonconstant predictor's sample standard deviation , then penalizes slopes in those coordinates. Since , this is the weighted penalty in the original units. Constant columns have and must be removed before this scaling. Scaling is a modelling choice; equal penalties in original units and in standardized units define different fits.[ref]
Modern regression 1: Ridge regression. slide 7: center predictors, leave the intercept free and scale predictors to sample variance one
The singular value decomposition explains the shrinkage. If is the compact decomposition using the positive singular values , with columns of , thenThe principal-component shrinkage by ridge regression factors are between and : directions with small singular values are damped most. As , the fitted values approach ; the vanishing-penalty ridge limit recovers the ordinary least squares fitted vector as , even if the slope estimates at zero penalty are nonunique. The covariance and bias of a ridge regression estimator describes the resulting bias-variance tradeoff. A penalty can reduce variance of an estimator while introducing bias of an estimator; the unbounded directional risk of fixed ridge shrinkage rules out a uniform improvement for a fixed positive penalty over all possible signals.[ref]
For a second exact construction, choose a centered orthonormal set of three vectors,and set and . The squared singular values are and . At , the fitted coordinates along are , retaining and of their ordinary least squares values . At they become , retaining and . The unfittable component contributes to every residual sum of squares, giving total values , , and at penalties . These are constructed fits, not measured prediction results.
Exact synthetic ridge shrinkage retains the strong singular direction longer than the weak one
. Details. The penalty is a hyperparameter, so fitting slopes at a fixed value and selecting that value are separate tasks. Use a validation set or K-fold cross-validation to compare candidate penalties by held-out squared-error loss. In each split, compute predictor sample means and scales from that split's training data, apply the same transformation to its validation set, and refit the slopes; using held-out information in preprocessing introduces data leakage. Minimum training residual sum of squares cannot select useful shrinkage: ordinary least squares already attains the smallest possible value.[ref]
Model selection and validation 1: Cross-validation. slides 5–8 and 11–14: tuning for prediction, training error and refitting on each training fold
After model selection, refit on all training data with the selected penalty. A separate test set or nested cross-validation assesses the entire selection procedure; a low selected validation score alone is no performance guarantee.[ref]On Over-fitting in Model Selection and Subsequent Selection Bias in Performance Evaluation by Gavin C. Cawley and others. pp. 2079–2080: selection as part of fitting and nested assessment
For a Gaussian linear model with an intercept and one explanatory variable, and , the regression intercept estimator is normal with variance . The residual variance estimate is independent of the coefficient estimators and has a chi-squared distribution with degrees of freedom. Consequently the displayed statistic has a Student t-distribution under , and a two-sided level- test rejects for .
// Target: mathematical-optimization.bigb
Unpenalized intercept in ridge regression 2026-10-06
In ridge regression, penalize slopes but ordinarily leave the regression intercept free. Centering gives and . An exactly centered predictor matrix has for every penalty. A table with a penalty-dependent intercept therefore cannot arise from exactly centered columns under this convention.


