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 2016 iii Paper 205 2 Solution Created 2026-10-03 Updated 2026-10-06
Use the normalizationThis is ridge regression; the penalty is the squared Euclidean norm. The centering removes the need for an intercept. Differentiating gives the normal equationFor every nonzero , . The coefficient matrix is therefore a positive-definite matrix, even if the design matrix has deficient matrix rank. The objective is a strictly convex function, so the unique minimizer is the closed-form ridge regression estimator, with fitted values
For the primal-dual identity for ridge regression, put and observeBoth parenthesized matrices are positive-definite matrices. Multiplying by their inverses givesThus the same fitted vector has the dual expressionNo inverse of or alone was needed. This is also the kernel-ridge hat matrix for the linear kernel.
Here a positive-definite kernel means a symmetric real-valued function whose every finite kernel matrix is positive semidefinite: for all , and ,This is the usual positive-semidefinite kernel convention; strict positivity for distinct points is not required. In particular . Write , and . Positivity of the two-point kernel matrix impliesIf , substitute to obtain . If , the affine expression can be nonnegative for every only if . Both cases give the Cauchy-Schwarz inequality for positive-semidefinite kernels:The zero-diagonal case is essential when the positive-definite kernel is not strictly positive.
To construct a feature map, let be the real vector space of finite formal linear combinations of symbols , one for each . Define a symmetric bilinear form byThe positive-definite kernel property makes this a positive semidefinite bilinear form. It need not yet be an inner product: distinct formal vectors can have zero squared length. The same quadratic-polynomial argument, now applied to , provesTherefore implies for every . The setis the radical of a bilinear form, hence a linear subspace. SetThe quotient vector space has a well-defined inner product: changing representatives by elements of changes no pairing, and a zero-length class is exactly the zero class. It is therefore an inner-product space.
Define . By construction,Every positive-definite kernel thus has a feature representation, including degenerate kernels and the zero kernel. This is its canonical feature space of a positive-semidefinite kernel. The construction already gives the requested inner-product space.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 1 a Solution Created 2026-10-03 Updated 2026-10-06
Use a common intercept and laboratory-specific slopes in the normal linear model. With denoting days and the indicator variables for laboratories B and C, the design matrix has row , andThe interaction terms change slopes, without introducing laboratory-specific intercepts. Thus the estimated daily growth rates arein millimetres per day, with fitted common intercept mm. The residual degrees of freedom are . The usual unbiased error variance estimate is the square of the residual standard error:The small difference from arises from rounding the standard error to two decimal places; the latter uses the more precise residual sum of squares supplied later. A maximum-likelihood estimate would instead divide that residual sum of squares by .
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 2 e Solution Created 2026-10-03 Updated 2026-10-06
Check that the chosen mean structure adequately describes the transformed response. Examine the residual-versus-fitted plot and residuals versus each predictor: systematic curvature suggests omitted nonlinear effects or an interaction term. Plot residual spread against fitted values, for example using a scale-location plot, to assess homoscedasticity. Compare standardized residuals with a normal distribution using a quantile-quantile plot, especially for finite-sample Student's t-distribution and F-test inference.
Also check independence using the sampling design and residuals versus time, collection site, or other groups; spatially related photovoltaic systems may have correlated errors that are invisible in a residual-versus-fitted plot. Investigate large standardized regression residuals, high regression leverage, and influential observations using Cook's distance. Check that the design matrix has full rank and that severe multicollinearity is not making estimates unstable. Reassess whether the response transformation and retained predictors improve these diagnostics and prediction; a coefficient p-value alone cannot establish model adequacy. If observations are independent only conditional on site effects, use an appropriate dependence model rather than treating correlated systems as independent replicates.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 b Solution Created 2026-10-03 Updated 2026-10-05
Choose knots independently of the eventual validation responses, and let be a natural cubic spline basis as in part (a). A regression spline writes . Define the design matrix . Under the stated normal linear model, maximum likelihood estimation for is the same as ordinary least squares:Differentiation gives the normal equations . If the design has full column rank,If it does not, a Moore-Penrose inverse gives the fitted values, but not every coefficient or off-sample prediction is identifiable. Merely choosing distinct knots does not guarantee full rank for an arbitrary set of observed predictor values.
More knots allow greater curvature and reduce approximation bias at the cost of larger estimation variance. Too many or poorly located knots can cause unstable fits. Equally spaced knots are simple; empirical predictor quantiles put more flexibility where observations are dense; subject knowledge can concentrate knots near likely changes. Both the number and positions can be compared using cross-validation or an appropriate penalized model-selection criterion. Adaptive knot selection must be included within validation, since treating a data-selected basis as prespecified understates its flexibility. Boundary knots should cover the region where inference is intended, and natural linear tails do not by themselves justify far-out extrapolation.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 216 3 b i Solution Created 2026-10-03 Updated 2026-10-05
Use the printed parameterization , , and . Let , be the design matrix with rows , and . Conditional on and the parameters, contributes no extra dependence on by conditional independence.
The stationary autoregressive normal distribution has prior density proportional toIts Gaussian autoregressive conditional precision is the tridiagonal matrix withCombining this prior with and completing the square givesThe precision matrix is positive definite. Compute its lower Cholesky decomposition , solve , draw , and solve . Then return . This Gaussian sampling from a precision Cholesky factor is exact because . Tridiagonal structure gives linear cost in and preserves the conditional correlation between days. Notice that the solve uses , not .
These conditionals are normalized for every fixed positive , despite the joint posterior impropriety explained in part (a). If the intended model uses instead, replace the observation coefficient by throughout; the information and precision terms then use and .
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 1 c Solution Created 2026-10-03 Updated 2026-10-05
Let . After integrating out the random intercepts,The fixed-effect design matrix has four independent columns, so the given has dimensions , with and . Consequently the error contrasts have a multivariate normal distribution with mean zero and covariance matrix .
The restricted likelihood from orthogonal error contrasts is their density. Equivalently, the estimates maximizeThis is restricted maximum likelihood, not maximization over individual rat effects. The unknown disappears because . Replacing by for an orthogonal rotates and conjugates , preserving the determinant and quadratic form; hence the objective is independent of the chosen orthonormal basis. The software's integrated REML log-likelihood can differ by an additive constant depending only on , which has no effect on these variance estimates.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 6 a Solution Created 2026-10-03 Updated 2026-10-05
For the residual-versus-fitted plot, compute fitted values and regression residuals ; the plotted point is .
For the normal Q-Q plot, let be the hat matrix for the full three-column design matrix and let . Form the standardized regression residualsand order them as . R plots against , where are its plotting positions. For , ; is the standard normal distribution function. This standardization is specified in R's diagnostic-plot documentation.
The original PDF shows a residual cloud around zero without compelling systematic curvature or a clear funnel, and a Q-Q pattern approximately following the reference line. Observations 81 and 83 are conspicuous positive tail points, with a smaller lower-tail departure. The plots show no decisive violation of linearity, constant variance or normality, but the extreme residuals merit inspection. They do not test independence across observations and cannot establish that all model assumptions hold.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 6 e Solution Created 2026-10-03 Updated 2026-10-05
Condition on the fixed design matrix and a prespecified . Put . The covariance and bias of a ridge regression estimator follow from its being a linear transformation of the response:Here centering the response introduces no correction in this expression because . For the equal-norm two-predictor design, either diagonal entry simplifies toHowever,The variances quantify sampling variability, but alone do not give valid confidence intervals for the unshrunk slopes. Centering a normal interval at the ridge estimate ignores its bias, which depends on the unknown slopes and need not be small relative to its standard error. Intervals require an appropriate bias correction, a bound on that bias, or another justified inferential procedure. A data-selected penalty introduces additional selection dependence not covered by the fixed- formula. Similarly, holding a software penalty fixed while converting it using an estimated response scale does not hold the effective penalty fixed over repeated samples; the displayed covariance is not an unconditional variance formula for that nonlinear procedure.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 216 1 d Solution 2026-09-28
For the first observations, writeBy Gaussian conjugacy for a normal linear model, the prefix posterior isCompute a Cholesky decomposition of once. If is row of the design matrix, thenThe Rank-one Cholesky update obtains a triangular factor from in operations. Two triangular solves give , and, for , another solve givesThe initial factorization costs and all updates and samples cost . This is within the requested bound.
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 225 4 a i Solution 2026-09-28
PutWith the by design matrix , the scalar-on-function linear model becomesThe ordinary least squares estimator based on the truncated model isThus the omitted tail produces the conditional bias .
LetThe supplied weak law of large numbers and noise limit giveFor a general fixed basis, need not vanish, so the retained coefficients are asymptotically biased and the estimator is inconsistent even for . Moreover, with fixed it cannot recover the full slope when .
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 13J i Solution Created 2026-09-24 Updated 2026-10-03
Let be the first team's goal count in match , let be row of the design matrix, and let be the regression coefficient vector. The fitted Poisson regression assumes that the are independent random variables withThe likelihood function maximized by
glm is therefore Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 218 2 a Solution Created 2026-09-24 Updated 2026-09-25
Because the columns of the design matrix are centred, ridge regression with an unpenalized intercept solvesThe normal equations give, for ,The fitted values are consequentlyIf the objective is normalized by , the same formulas hold after replacing by .
Penalized least squares 2026-10-05
For , a full-column-rank design matrix , and a positive semidefinite matrix , minimize . Differentiation gives . The fitted-value matrix is , whose trace measures the effective degrees of freedom.
Primal-dual identity for ridge regression Created 2026-10-06 Updated 2026-10-07
For any real design matrix and , . Multiplication by identifies the primal ridge regression fitted values with , , the kernel-ridge hat matrix for the linear kernel. No rank assumption is needed.
Quadratic regression 2026-10-07
A polynomial regression of degree two is linear in its unknown regression coefficients despite being curved in the predictor. Its design matrix has columns ; three distinct predictor values give full column matrix rank.
Rank-deficient ordinary least squares Created 2026-09-29 Updated 2026-10-06
If a design matrix has deficient rank, every ordinary least squares minimizer has the form with , where is the Moore-Penrose inverse. Hence the fitted values are unique but the coefficients are not: the minimizers form an affine subspace of dimension .
Regression spline Created 2026-10-05 Updated 2026-10-06
A regression spline fits a regression function in a finite-dimensional spline approximation space with selected knots. Evaluating its basis at predictor values gives a design matrix, reducing fitting to regression on basis coefficients.
For and a full-column-rank design matrix , take with and . Then , so restricted maximum likelihood maximizesChanging the orthonormal basis by an orthogonal matrix leaves this expression unchanged.
Sample principal component 2026-09-29
Let the columns of a centered design matrix be variables and write by the spectral theorem for real symmetric matrices. The columns of are the sample principal-component score vectors. They satisfy , so distinct score vectors have zero sample covariance and has sample variance under the divisor- convention.