Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 49 1 Solution Created 2026-10-03 Updated 2026-10-14
A cubic spline belongs to and is a polynomial of degree at most three on each interval separated by the spline knots. A natural cubic spline is additionally an affine function on the exterior intervals and . On this is equivalent to the endpoint conditions ; these conditions remain part of the definition when an outer knot coincides with or .
Let be the natural cubic spline interpolant of the prescribed values, and let be any other interpolating function. Set , so . On the interval , integration by parts twice givesbecause the fourth derivative of each cubic piece is zero. The second boundary term is zero because vanishes at the spline knots. After summing the first terms, the interior contributions cancel by continuity of and , and the two remaining terms vanish by the natural endpoint conditions. On the exterior intervals . Thus , and the second derivative roughness penalty satisfiesIf equality holds, the continuous nonnegative function has zero integral, so everywhere. Hence is an affine function, and its zeros at two distinct spline knots force . This proves the minimum roughness property of the natural cubic spline interpolant and its equality case: the unique minimum-roughness interpolant is .
For the fixed-design nonparametric regression fit, use the penalized least squares criterionLet be the natural cubic spline interpolant with value vector . Replacing by for leaves the residual sum unchanged and reduces the second derivative roughness penalty, strictly unless . It therefore remains to minimize the finite-dimensional quadratic formThe supplied spline roughness penalty matrix is positive semidefinite. For every nonzero vector ,Consequently is a positive-definite matrix, and is strictly convex. Its normal equations for linear least squares have the unique solutionThe preceding strict reduction also proves uniqueness over the whole class , not just over the natural cubic splines. This is the cubic smoothing spline. If the residual criterion is divided by instead, the corresponding formula is , reflecting a change in the numerical convention for the smoothing parameter.
The independence and specified error mean and variance are not needed for existence or uniqueness of this minimizer. They do imply, with smoothing matrix and , that and . The null space of consists of sampled affine functions: these have zero roughness, and conversely zero roughness forces their natural cubic spline interpolant to be an affine function. Thus these functions are reproduced without bias of an estimator, while other components are smoothed.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 5 b Solution Created 2026-10-03 Updated 2026-10-06
Assume initially that the design points are distinct and ordered on . The cubic smoothing spline minimizesover functions with an absolutely continuous first derivative and square-integrable second derivative. Dividing the residual term by simply changes the scaling assigned to . The minimum roughness property of the natural cubic spline interpolant reduces the problem to natural cubic splines with knots at the design points: among functions with any prescribed fitted values, that interpolant has the smallest integrated squared curvature. The minimizer is therefore a natural cubic smoothing spline, with natural second-derivative boundary conditions and linear tails when extended.
Choose a full basis for this natural-spline space. Put and . Writing changes the objective toDifferentiation gives . Although the curvature penalty has an affine nullspace, the full basis at distinct design points makes the combined matrix positive definite. HenceEquivalently, use the cardinal basis that interpolates the observations, making and . These are smoothing matrices, symmetric but generally not idempotent. Their effective degrees of freedom are . As the fit interpolates; as it approaches ordinary least squares on the affine functions. With replicated predictors, use a design matrix for distinct knots and observation weights; the basis form remains valid when identifiable.
Useful choices include Leave-one-out cross-validation, generalized cross-validation, and estimation of smoothness by restricted maximum likelihood through a mixed-model representation. For fixed , the leave-one-out residual identity for a linear smoother givesMinimize these over a suitable range. Choose smoothing by predictive performance or a variance-component likelihood, not by arbitrarily forcing a visually appealing curve.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 5 d Solution Created 2026-10-03 Updated 2026-10-06
Use the backfitting algorithm to alternate conditional updates of the two additive functions. Initialize and both centered function vectors at zero. With the smoothing matrices for the chosen experience and education spline penalties, one cycle isfollowed byThe centering transfers any constant component to the intercept; update to the mean of if necessary, which is under the stated constraints. Repeat until changes in the functions or objective are negligible. Each function is estimated by smoothing its partial residual, namely the response after subtracting all other currently fitted terms.
For fixed penalties these updates are block minimizations ofsubject to the centering constraints. Each step cannot increase the objective; with identifiable additive terms and a positive-definite constrained quadratic, backfitting converges to its unique minimizer. Highly dependent predictors can make the decomposition poorly identified or slow convergence. The Gaussian identity-link model needs these least-squares updates directly; non-Gaussian generalized additive models use weighted backfitting inside iteratively reweighted least squares. The package implementation also separates each spline's unpenalized linear component from its nonlinear component, giving the two ANOVA tables displayed in part (e).
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 210 3 Solution Created 2026-09-24 Updated 2026-10-03
A cubic spline with knots is twice continuously differentiable and restricts to a polynomial of degree at most three between consecutive knots. It is a natural cubic spline when it is linear outside , equivalently when its second derivative vanishes at the two outer knots and on the exterior intervals.
Let be the natural cubic spline interpolating prescribed values and let be any other interpolant in . Then . Piecewise integration by parts, using that between knots, is continuous, on the exterior intervals, and every jump of is multiplied by , givesConsequentlyEquality forces almost everywhere. Then is affine and its zeros at at least two distinct knots force , proving uniqueness.
For the penalized problem, fix a vector of fitted values. The preceding variational result says that its natural spline interpolant has the least roughness among all functions taking those values, and by assumption that roughness is . The infinite-dimensional problem therefore reduces toBecause is positive semidefinite, is positive definite. The unique fitted-value vector isand is its unique natural cubic spline interpolant.
For Leave-one-out cross-validation, let minimizeand defineIf , its normal equations sayThus , whereTaking the th coordinate and writing givesTherefore one spline fit and the diagonal of its smoothing matrix give
For distinct ordered observations , let be their natural cubic spline interpolant with values . Its roughness is a quadratic form, , where is positive semidefinite and its nullspace consists of vectors sampled from affine functions. Minimizing penalized least squares gives . Thus the smoothing matrix is and its effective degrees of freedom are . As the fit approaches interpolation and the trace approaches ; as it approaches the least-squares affine line and the trace approaches .