Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 44 1 Solution Created 2026-10-03 Updated 2026-10-14
A useful full statement is the rank-sum form of Cochran's theorem. Let and let be real symmetric matrices satisfying . Put and . Then , and the following conditions are equivalent: the ranks sum to ; the are orthogonal projection matrices with mutually orthogonal ranges; and the are independent, with . A rank-zero form is identically zero. In particular, the usual projection version of Cochran's theorem partitions the squared length of a standard normal vector into independent chi-squared distributions.
Here is a proof which also explains the rank condition. Let . Since every vector satisfies , the spaces span . Therefore their dimensions sum to at least . If they sum to , their sum is a direct sum, so every vector has a unique decomposition into vectors belonging to the . For , the identity is one such decomposition, while the decomposition with just in position and zero elsewhere is another. Uniqueness gives . ThusA symmetric matrix with this idempotence is an orthogonal projection matrix. Its different ranges are orthogonal: for , , their inner product is . Choose an orthonormal basis for each range and concatenate them. The resulting change-of-basis matrix is an orthogonal matrix. In these coordinates, each is the sum of squares of the coordinates belonging to its range.
The transformed multivariate normal distribution still has density proportional to , which factors into the standard normal densities of its coordinates. The coordinates are independent, so the disjoint groups of squared coordinates give independent chi-squared distributions of the asserted degrees of freedom. This proves the forward implication. Conversely, if the have the asserted chi-squared laws, then , while has expectation . Taking expectations yields . This completes the equivalence and the proof of Cochran's theorem.
For the application, specify a normal linear modelwith fixed full-column-rank design matrix of size , , unrestricted , and unknown . Test against , where has independent rows, , and is specified. The null contains an affine space of means of dimension , whereas the full mean space has dimension .
Let be the ordinary least squares and maximum-likelihood estimate in the full model, and write . The constrained estimate follows by minimizing the residual squared length under :Indeed, and the correction is the required constrained projection in the inner product. The least-squares normal equations give the Pythagorean decompositionConsequently the explicit residual quantities in the likelihood-ratio test statistic areHere is the full-model residual sum of squares, and is the increase caused by imposing the null restrictions.
To see the geometry behind Cochran's theorem, choose any with , and let project onto and onto . For ,The projectors and are orthogonal and have ranks and . Under , the mean of belongs to , so both of these projectors annihilate it. Thus Cochran's theorem givesThe nuisance variance cancels in the nested-model F-test statisticSince the likelihood-ratio test statistic isit is a strictly increasing function of . Therefore an exact level- likelihood-ratio test rejects when , where the right-hand side is the upper reference quantile of the F-distribution. This calibration is exact under the normal linear model, rather than an asymptotic chi-squared replacement.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 41 1 Solution Created 2026-10-03 Updated 2026-10-14
Write . In this normal linear model, the ordinary least squares criterion is . Differentiating with respect to gives the normal equations for linear least squares, . Full column rank of the design matrix makes invertible, and completing the square proves that the unique minimum isSince , its sampling distribution is the multivariate normal distributionLet be the hat matrix. It is symmetric and idempotent with rank , and . The regression residual vector is , soAn orthogonal projection of a Gaussian vector onto the residual space gives . The residual projection and fitted projection have zero cross-covariance, hence are independent because they are jointly normal. In particular, is an unbiased estimator of and is independent of . The maximum-likelihood estimator of instead divides by and is not unbiased.
For the null hypothesis , put . Under that null hypothesis, is standard normal and independent of . Therefore the Student t-test usesA two-sided level- test rejects when . The denominator is the estimated standard error of the regression coefficient.
The fitted linear regression includes an intercept and three covariates:Thus , and the residual degrees of freedom are . The fitted conditional mean isEach slope measures a conditional association with the response while the other two covariates are held fixed. Increasing wind speed by one mile per hour corresponds to a fitted decrease of in the concentration units used. Its standard error is , giving and a two-sided p-value of : evidence of a negative conditional association at the 5% level. The temperature slope is per degree Fahrenheit, with standard error , and p-value . The insolation slope is per langley per day, with standard error , and p-value . Neither of these last two conditional effects is significant at 5%; that does not establish that either true slope is zero. These are associations, not a demonstration of causal effects.
The intercept estimates the mean at zero values of all three covariates. Its value has a large standard error , giving and p-value . The zero-covariate combination may be outside the observed range, so this test may have little practical relevance. Every coefficient test uses a Student t-distribution with degrees of freedom.
The reported residual standard deviation measures unexplained variation in concentration units; the subsequent table gives , consistent with after rounding. The five-number residual summary describes the spread, from to , with median . An intercept forces the residual sum to zero, not the residual median. These five numbers alone cannot establish normal errors, constant variance or independence; residual-versus-fitted and quantile-quantile plots would be more informative, and successive days also warrant checking serial dependence. The coefficient of determination means that 65.33% of the sample response sum of squares about its mean is explained by this fit. Its adjusted version iswhich accounts for the number of estimated regression coefficients.
The stepwise selection by the Akaike information criterion searches between the intercept-only model and the specified model with all three main effects. For these Gaussian fits, the printed Akaike information criterion is, up to a constant common to the candidates,The full model has and AIC . Removing insolation increases the residual sum of squares by but decreases AIC to , so that removal is chosen. Removing temperature or wind instead would give AIC or and is worse. In the next step the candidate models include deletions and restoration of insolation. Keeping wind and temperature has the smallest AIC: removing temperature gives , restoring insolation gives , and removing wind gives . Hence the search stops, givingThe accompanying F-tests compare a larger model with a one-parameter reduction: , where is estimated from the larger model. For example, removing insolation gives , equal to the corresponding squared test statistic. Deletions from the second-stage model use in the denominator, whereas restoring insolation uses the full-model denominator. These tests describe the comparisons; they do not determine the AIC choice. In particular, temperature is retained despite its deletion-test p-value . AIC balances fit and complexity, and a stepwise optimum need not be a global optimum over a richer model class. Ordinary coefficient inference after choosing a model does not account for the selection itself.
For positive responses, the Box–Cox transformation is for , and . Its profile likelihood refits the linear regression and variance at each and includes the transformation Jacobian. The graph peaks at roughly –. The approximate 95% likelihood-ratio confidence interval contains values a little below zero through approximately one, using the cutoff . Thus a logarithmic transformation () and a square-root transformation () are plausible, while leaving the response on its original scale () is at or very near the upper confidence boundary. The broad profile supports considering a mild power transformation; it does not determine a sharply estimated power. The raster does not justify more precise endpoints or a decisive assertion about which side of the boundary lies.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 41 2 Solution 2026-10-14
Let , and . The proposed least-squares estimators satisfy the sum-to-zero constraints because and . Define . Direct summation givesNow write any other admissible parameters as , , , where . Expanding the ordinary least squares criterion, the cross-products with vanish by the preceding identities. The cross-products between , and vanish by their zero sums. ConsequentlyEvery added term is nonnegative and all vanish only at , . This proves the unique constrained minimum, withThe additive-model residual sum of squares and intercept-only residual sum of squares are thereforeThe same orthogonality gives the analysis of variance identityFitting factor B alone yields fitted values and residual sum . Fitting A alone gives residual sum . Adding B after A then reduces it to , a reduction of again. The reduction due to B is in either order. This is balanced factorial orthogonality; it generally fails for unequal cell replication.
There are observations. The additive model estimates independent parameters, so the missing degrees of freedom are A: 2, B: 1, residuals: 8. The individual requested residual sums are below.
To check for an interaction, extend the normal linear model to , with each row and column sum of zero. Equivalently, fit the six unrestricted cell means. Its residual sum of squares is the within-cell sumThe interaction adds parameters; the cell-means residual has degrees of freedom. Under the no-interaction null hypothesis and the independent equal-variance normal error model,The numerator and denominator arise from orthogonal Gaussian projections, proving the exact F-test. Reject for a sufficiently large value. The printed additive analysis of variance table does not supply , so it cannot determine this test statistic numerically; the replicated cell data would do so.
Past exam of the mathematics course of the University of Cambridge 2008 ii Paper 3 5J Solution Created 2026-09-24 Updated 2026-10-14
The ordinary least squares estimate, which is also the maximum-likelihood estimate in this normal linear model, gives the hat matrixIt is the orthogonal projection onto the column space of , so , and . Since , the vector of regression residuals is , with multivariate normal distributionFor , its covariance is , which is generally nonzero. Therefore the regression residuals are generally dependent, even though the original errors are independent random variables.
Fit the model in R, compute its internally studentized residuals with
rstandard(fit), and examine a normal Q-Q plot with qqnorm(rstandard(fit)) and qqline(rstandard(fit)). A plot of these regression residuals against the fitted values helps detect a curved mean pattern or nonconstant variance. Approximate agreement with a straight line in the Q-Q plot, with no systematic residual pattern, supports the assumed error model.Here . The average leverage is , and . Thus most diagonal corrections and most off-diagonal dependences are small when only a few directions have been removed from a large sample. Also estimates accurately when is large. These facts make the visual independent-normal approximation reasonable, though exceptional high-leverage observations still deserve attention.
The approximation is not an exact distributional statement: the distribution of an internally studentized Gaussian residual has when and . In particular these residuals are bounded, rather than exactly distributed according to Student's t-distribution. Formal goodness-of-fit calibration should account for fitting and dependence.
Past exam of the mathematics course of the University of Cambridge 2009 ib Paper 1 7H Solution Created 2026-09-24 Updated 2026-10-14
An unbiased estimator satisfies for every parameter value. Under the standard full-column-rank assumption on the design matrix, the Gaussian log-likelihood for the normal linear model, up to terms independent of , is . Its maximum is the ordinary least squares minimum. Differentiating gives , and full column rank makes positive definite. ThusSince , its expectation is , proving unbiasedness. Estimating an unknown as well does not change the maximizing coefficient vector.
The printed hypotheses give but do not explicitly require full column rank. Without that condition the maximum-likelihood estimators are not unique: they are with , as in rank-deficient ordinary least squares. If , the observation distributions at and are identical. Every estimator then has the same expectation at both parameters, so no estimator can be unbiased for both entire coefficient vectors. This proves nonidentifiability prevents unbiased coefficient estimation. The stated estimator and unbiasedness claim require the usual full-rank condition.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 34 4 Solution Created 2026-10-03 Updated 2026-10-14
Write for the observed response and for column of the working design matrix . The usual LARS convention gives every covariate unit Euclidean norm. If an unpenalized intercept is fitted separately, first centre and the nonconstant covariates, and restore the intercept afterward. For an intercept-free model no centring is required. The algebra below also applies to an unscaled full-rank design; only the literal equal-angle interpretation uses unit-length columns. The penalty is defined on the regression coefficients of whichever working design is used, since rescaling covariates changes the units of an L1 penalty.
Initialize , and residual . At iteration , letThese are residual inner products, often called residual correlations. If , all normal equations are satisfied and the path has reached ordinary least squares. Otherwise the active set consists of the selected columns tied at the maximal absolute correlation. Initially select the maximizing column, or all such columns in a tie. Ordinary least angle regression retains previously selected columns and adds each new one when it ties the active correlations. Put for active .
To define the direction, form the signed active design and its Gram matrix . Full column rank makes this matrix positive-definite. Let denote the vector of ones of length , and setThen and . This is the equiangular direction in least angle regression. Define for every covariate, and define the regression coefficient direction by on , zero otherwise. It satisfies .
Along the line , residual correlations are . For an active index these equal , so all active absolute correlations decrease together until level zero at . An inactive covariate first joins when its correlation equals either sign of the common level. Solving these two equalities givesHere means the smallest finite strictly positive candidate; zero denominators do not produce a future entry, and an empty candidate set has minimum . Candidates beyond the zero-correlation endpoint are capped by that endpoint. TakeAt an entry add the newly tied covariate, or all simultaneous ties, and recompute the direction. Once all covariates are active there is no inactive candidate: the final move is to correlation level zero and the full least-squares fit. These definitions specify every term in the stated step formula and the entry knot in least angle regression.
For definiteness use the following penalty normalization for the Lasso estimator:Full column rank makes the criterion strictly convex, so the minimizer is unique. With the alternative squared-error normalization , the penalty parameter is divided by . The Karush-Kuhn-Tucker conditions for the Lasso in the chosen normalization areHence the zero vector is the solution for every . Along a sign-compatible least-angle segment the corresponding penalty is . Active correlation equalities and inactive bounds satisfy the KKT conditions exactly while each nonzero regression coefficient retains the sign . Ordinary LARS can let a regression coefficient cross zero while its correlation sign stays unchanged; continuing past that crossing would violate the KKT conditions.
The required modification is therefore to monitor regression coefficient zero crossings. Along , define the Lasso dropout knotwith ignored and the empty minimum again . Stop atIf a nonzero active regression coefficient reaches zero before the next entry, remove it from the active direction and recompute; the fitted value is continuous at this event. If entry comes first, add that covariate as before. A removed covariate is allowed to re-enter later, so the active set need not increase monotonically. The interior of a segment represents all penalty values through , rather than just the estimates at its knots.
For complete treatment of simultaneous events, full column rank alone does not imply that entries and dropouts occur singly. At a knot with positive level , let , be those correlation signs, and . The KKT-consistent resolution of tied Lasso knots chooses the next tangent byThis strictly convex quadratic program has a unique minimizer. For nonzero or newly entering coordinates its stationarity gives ; for tied zero coordinates kept out, . Thus for a small decrease of the penalty, has the correct regression coefficient signs, active residual scores , and inactive scores within . Strictly inactive coordinates remain feasible by continuity. Choose the resulting support for the next segment and normalize ; this reduces to the preceding equiangular formulas. It handles ties, including a newly tied zero regression coefficient whose unconstrained direction would point against its correlation sign, without perturbing the data.
At each successive event update the support in this manner and continue down to . Between knots the regression coefficients are linear in and satisfy the sufficient KKT conditions. For a fixed support and sign vector , the equalities give ; all sign and inactive-score constraints are linear inequalities in . Each support/sign pattern therefore has an interval of validity, and there are only finitely many such patterns, so the complete path has finitely many linear segments. Together with the initial zero solution for , these interpolated segments give
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 38 1 Solution Created 2026-10-03 Updated 2026-10-14
Let be the flight distance in millimetres for paper level , launch-angle level , design level and replicate , where and . The full factorial design is fitted by the normal linear modelThe assumptions are independent errors with a common variance and normal distribution, and the displayed factor-combination mean structure. The corner-point constraints areand whenever at least one index equals . Thus the eight free mean coefficients are . These treatment coding coefficients are comparisons at the other factors' reference levels, rather than necessarily averaged main effects.
To test the three-factor interaction term, compare the full model with the model retaining all main effects and all two-factor interactions. The null hypothesis is , against a nonzero value. Removing it increases the residual sum of squares by and removes one parameter. With eight residual degrees of freedom, the nested-model F-test givesThere is no evidence that this three-factor interaction is needed. This does not establish that all two-factor interactions vanish: the paper-design interaction is substantial.
The
stepAIC command performs stepwise selection by the Akaike information criterion. Its upper scope is the full factorial model and its lower scope is the intercept-only model. Starting from the full model, it compares admissible additions and deletions, preserving the hierarchy of interaction terms, and chooses changes that reduce the Akaike information criterion. With the supplied scope its default search permits both directions. For these Gaussian fits the displayed criterion, up to constants common to all models, is , where counts mean coefficients. The first deletion changes it from to : the small increase in residual sum of squares is outweighed by removing a parameter. This is a greedy model selection procedure, not an exhaustive search or a sequence of fixed-level hypothesis tests. The command's arguments are described in the MASS documentation.For the selected model, let and . Thenindependently between flights. It has no angle term. The maximum-likelihood estimates of its mean coefficients are also obtained by ordinary least squares:For example, the four fitted means are just the four paper-design cell means, each averaging four flights over the angle levels. With , the variance-covariance matrix of the coefficient estimates is . Its diagonal gives the displayed standard errors; their ratios are , with mm.
The final line of
summary(model2.lm) is the joint nested-model F-test of , comparing this four-parameter model with a common mean. Its statistic iswith F-distribution under the fixed-model null and P-value . Thus the selected paper-design terms jointly improve the fit substantially. The coefficient of determination means they account for about of the observed centred variation. These nominal inferential summaries do not adjust for the preceding model selection on the same data.Using the unrounded fitted means givesin millimetres. Hence choose the high-performance design with the lighter paper; the fitted model leaves both launch angles tied, with expected distance about mm. A preference for one angle is not supported by this selected model. The strong paper-design interaction reverses the design comparison: the simple design is better on heavy paper, whereas the high-performance design is better on light paper. Consequently a single design effect averaged over paper types would conceal the main result. There is little evidence here for an angle effect, and considerable flight-to-flight variability remains.
Before fitting, inspect raw-distance dot plots for all eight factor combinations, and interaction plots of cell means against design, with separate lines for paper and panels for angle. With only two replicates per cell, showing individual observations is more informative than elaborate box plots. These reveal reversals, spread and possible unusual flights. Afterwards inspect a residual-versus-fitted plot, a Q-Q plot of residuals, a scale-location plot, residuals against each factor and, if recorded, flight order, and Cook's distance for influential observations. Residual patterns by angle would question its deletion, while unequal spread or departures from the normal distribution would question the error assumptions rather than merely demand another mean term.
Past exam of the mathematics course of the University of Cambridge 2009 ii Paper 4 5I Solution Created 2026-09-24 Updated 2026-10-14
The fit is a Gaussian linear model for with an intercept and the six displayed explanatory variables:The command computes ordinary least squares; independent normal errors with common variance are the additional assumptions yielding the exact printed tests. A coefficient describes an adjusted association on the log scale, holding the other variables fixed. Exponentiation gives a multiplicative effect on the conditional median of sulphur dioxide, not an additive effect on its original scale. Under the Gaussian model its conditional mean additionally includes the factor .
The estimates are the coordinates of . With observations and parameters the residual degrees of freedom are , and the residual standard error is to the displayed precision. The reported standard error of coefficient is . For each null hypothesis , the displayed statistic has Student t-distribution with degrees of freedom under that null. Its two-sided p-value is .
At the level the intercept, temperature, manufacturing and wind coefficients differ significantly from zero in the full model. Temperature and wind have negative estimated adjusted effects; manufacturing has a positive one. The p-values for population, precipitation and precipitation days, approximately , and , do not reject their respective zero-coefficient hypotheses. This is not evidence that their effects are exactly zero, and these observational associations do not establish causation.
A sensible candidate reduced linear regression keeps an intercept, temperature, manufacturing and wind. It must be refitted: coefficients generally change when correlated predictors are removed. The three deletions can be checked jointly by the F-test statisticwhich has distribution under the joint null. The individual summary does not determine this joint test or establish the reduced model's adequacy.
In the final command, the uniquely matching component named by
fit$df is the residual degrees of freedom. Thus the result is Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 32 1 Solution 2026-10-14
Put and . The rank of a matrix assumption makes invertible, and is the orthogonal projection matrix onto the column space of the design matrix. The Gaussian likelihood has log-likelihoodMinimizing the squared Euclidean norm gives the ordinary least squares normal equations . Maximizing over then gives the maximum-likelihood estimatorsThe divisor for the maximum-likelihood estimator of the variance is , whereas the unbiased residual variance estimate is . The exceptional event has probability zero under the Gaussian linear model with ; on that event the likelihood is unbounded as .
For the joint sampling distribution, write and . Their cross-covariance matrix vanishes because . These two vectors are jointly multivariate normal, so they are independent random variables. The residual orthogonal projection has rank , hence the standard chi-squared distribution result givesThus these two displayed marginal laws, with their independence, specify the full joint distribution.
The quadratic formhas a chi-squared distribution with degrees of freedom and is independent of . Their ratio therefore supplies the exact F-distribution pivotIf is the quantile of that F-distribution, inversion gives the normal linear-model confidence ellipsoidFor every and every , the probability that this confidence set contains is exactly . To test the null hypothesis, reject precisely when lies outside this confidence ellipsoid, equivalently when . Under the null hypothesis the rejection probability is exactly , independent of the unknown variance.
For the numerical calculation, the second column of the design matrix sums to zero and its sum of squares is . Direct calculation from the observations givesConsequently the ordinary least squares estimate, residual sum of squares and unbiased residual variance areThe maximum-likelihood estimator of the variance is instead . At the proposed null value the F-distribution statistic isTherefore reject the null hypothesis at the 5% level. The relevant critical value has numerator and residual degrees of freedom.
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 2010 ii Paper 4 5J Solution Created 2026-09-24 Updated 2026-10-14
Write and fit the normal linear modelThe basic linear regression analysis assumes centered independent normal random variables of a common variance , conditional on the predictors. Independence between makes does not by itself establish independence between different models of the same make; that stronger assumption should be checked, or within-make dependence modelled. The requested R fit is
fit <- lm(log(price) ~ mpg + psngr + length + width + weight, data = cars)The estimate column contains the ordinary least squares coefficients. The standard error estimates the standard deviation of each coefficient estimator. The t value is its estimate divided by its standard error. The last column gives the two-sided p-value for a zero coefficient, using a Student t-distribution with residual degrees of freedom under the stated normal linear model; the stars summarize significance thresholds.
Conditional on the other predictors, passenger capacity and width have negative fitted coefficients, while length and weight have positive ones. All four are significant at the conventional 5% level; length is borderline. There is little evidence for an additional mpg effect once the others are included. These are conditional associations, not causal claims. For example, increasing weight by 100 pounds multiplies the fitted price by approximately , about 1.087.
A reasonable candidate simplification removes mpg and compares the nested models by an F-test, rather than treating a nonsignificant coefficient as proof of no effect:
fit2 <- update(fit, . ~ . - mpg)
anova(fit2, fit)Inspect regression residuals, normal quantiles, residual-versus-fitted plots, leverage and influential observations. The correlated size predictors may produce multicollinearity; missing make effects, nonlinear terms or unequal residual variances may also matter. A random make effect or a covariance adjustment addresses the possible dependence noted above.
Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 1 13J Solution Created 2026-09-24 Updated 2026-10-14
Use a normal linear modelThe distance and climb are treated as fixed predictors; the assumptions are a linear conditional mean, independent errors with common variance, and normal errors for the exact tests. Fit by ordinary least squares using
hills.lm1 <- lm(time ~ dist + climb, data = hills)The overall null hypothesis is , against at least one nonzero slope. The intercept-only and full models have respectively 34 and 32 residual degrees of freedom. Under the null, the F-test statistic isThe displayed residual sums are rounded; use the reported statistic for the test. Its upper-tail p-value is below , so reject the no-relationship hypothesis overwhelmingly. At least one predictor adds information beyond a constant mean.
In the coefficient table, Estimate gives one of the ordinary least squares estimators, Std. Error is the estimated standard deviation of that estimator, t value is the estimate divided by its standard error, and the last column is the two-sided p-value for a zero coefficient. Under the corresponding null, the statistic has a Student's t-distribution with 32 degrees of freedom. The fitted mean isAt fixed climb, an extra mile predicts about 6.22 extra minutes; at fixed distance, an extra foot of climb predicts about 0.01105 extra minutes. Both slopes have strong evidence of being positive. Specifically the climb test uses and , so climb remains significant after controlling for distance. The intercept differs from zero at the 5% level, but extrapolating to a zero-distance, zero-climb race has no useful physical interpretation.
The regression diagnostics show a very large positive residual for Knock Hill and a smaller positive outlier for Bens of Jura. The Q-Q plot has a pronounced upper tail, contradicting the assumed normal-error pattern. These observations can distort both the fitted coefficients and the estimated error variance. Check the source records, units, transcription and any unusual race conditions first, especially for Knock Hill; correct a demonstrated data error and refit. If the records are valid, consider omitted terrain effects, nonlinear distance/climb effects, a suitable response transformation or robust regression, and compare fits with and without influential observations. A diagnostic outlier alone is not a reason to silently delete a valid record.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 1 c Solution Created 2026-10-03 Updated 2026-10-07
The ordinary least squares estimator is . Consequently the fitted values and regression residuals areAn affine transformation of a multivariate normal distribution is again multivariate normal, possibly with a singular covariance matrix. For a random vector with covariance matrix , its transformed covariance matrix is . Since , and , these results giveBoth multivariate normal distributions are supported on their respective projected subspaces. In particular, has variance and has variance ; the regression residuals need not be mutually independent.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 31 3 Solution Created 2026-10-03 Updated 2026-10-07
With the same squared-error normalization as in Question 2, the ridge estimator solvesThe unpenalized intercept in ridge regression is because the columns of are centered. Differentiating the remaining quadratic objective gives . Since , the left matrix is positive definite even when is rank-deficient. Thus the closed-form ridge regression estimator isThe second equality again uses centering. If the penalty convention is with an unnormalized squared-error term , replace by throughout; the limiting assertion is unchanged.
For the full-column-rank case, take a singular value decomposition with positive singular values . The ordinary least squares estimator, which is the slope maximum-likelihood estimator in this normal linear model, and the ridge regression estimator are respectivelyConsequently principal-component shrinkage by ridge regression multiplies the least-squares coordinate in direction by . Ridge shrinks most strongly in directions with the smallest singular values. These are combinations of predictors that the data distinguish least well.
Near multicollinearity creates small singular values, and the factor in ordinary least squares greatly amplifies noise in those directions. Its coefficient variance there is , while the ridge variance iswhich is smaller. The price is bias: the expectation of the ridge coordinate is times the corresponding true coefficient. This bias-variance tradeoff can substantially reduce estimation and prediction error when the poorly identified directions do not contain an excessively large signal. It is not a guarantee of improvement for every coefficient vector. Adding to every eigenvalue also improves the condition number of the normal matrix and makes numerical inversion more stable.
To handle every rank and every relation between and , put and use its spectral theorem for real symmetric matrices. Choose an orthonormal eigenbasis with eigenvalues , and put . ThenIf , then , so and . Thus these terms are exactly zero for every positive ; there is no divergent component in the null space. Each remaining term converges to . By the definition of the Moore-Penrose pseudoinverse,and thereforeThis proves the vanishing-penalty ridge limit without an invertibility assumption. The limit is the minimum-norm least-squares solution: every other least-squares solution differs by a vector in , orthogonal to the displayed solution, and therefore has at least as large a Euclidean norm.
Past exam of the mathematics course of the University of Cambridge 2014 ib Paper 4 19H Solution Created 2026-09-24 Updated 2026-10-06
For the normal linear model, differentiating the ordinary least squares objective gives . Full column rank makes invertible, soThe distribution follows because is a linear transformation of a multivariate normal distribution. Its expectation is , and direct multiplication gives the displayed covariance matrix.
Let , the orthogonal projection onto the design's column space. The residual sum of squares is . Since , symmetry and idempotence give . Thusis an unbiased estimator.
For the two independent regressions choose . The first rows of the design matrix are and the last rows are . The centering conditions and distinct predictors giveIt follows thatThe two estimated slopes are independent normal random variables, as they depend on independent error blocks. ThereforeFor these data use the pooled residual sum of squaresIts scaled value is and is independent of the slope estimates by the permitted normal-model result. Hence the standardized difference has a Student t-distribution with degrees of freedom, giving the exact 95 percent confidence intervalHere is the 0.975 quantile of that distribution. This is a confidence interval for the difference of independent regression slopes. As required by the original framework, this specialization needs . Distinct predictors alone allow , but then the fit is saturated, and there are no residual degrees of freedom to estimate the unknown variance or form this interval.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 30 2 Solution Created 2026-10-03 Updated 2026-10-06
Represent the subset model by a set of column indices and let contain those columns. Its ordinary least squares estimator sets the omitted coefficients to zero and hasFor , use . Full column rank of implies full column rank for each . The matrix is an orthogonal projection matrix of rank .
Put and . Projection orthogonality gives the bias-variance decomposition of mean squared errorwhile the expected residual sum of squares isThese equations distinguish the mean-vector prediction risk in this problem from the additional noise in predicting a new response vector.
First take . Let project onto the full column space of . Since the full model contains , the residual estimate of Gaussian noise varianceis unbiased: its numerator has expectation . Consequently an unbiased Gaussian projection risk estimate isIndeed its expectation is for every , even when the subset model omits true effects. Independence of the two terms is not needed for this expectation calculation. The full-model variance estimate is important: the subset residual variance generally includes omitted-variable bias.
For a finite candidate collection, choose a model minimizing , breaking ties in favour of a smaller model. The term is common to all models, so this amounts to minimizingthe Mallows Cp form. The fit improvement competes with an increasing dimension penalty. Unbiasedness holds for each fixed model; the estimate at the data-selected model need not remain unbiased, because selection favours downward fluctuations. The method is a heuristic model selection rule, rather than an assertion that it finds the true model with certainty.
The printed includes a genuine qualification. If , there are no full-model residual degrees of freedom. Except in the balanced case , no integrable data-only unbiased estimator can satisfy the requested identity for all means and unknown variances. Here is a proof of the unknown-variance risk estimation in a saturated Gaussian model obstruction. Since is invertible, ranges over all . Suppose had the required expectation at every and variance . For , let and let . Marginally . Applying the assumed identity conditionally giveswhereas applying it to the marginal distribution gives . Their difference is , which must vanish. Integrability under the marginal Gaussian justifies conditioning. If , the obstruction disappears and the residual sum of squares alone has expectation . ThusThe general construction therefore requires , or an independently available unbiased variance estimate.