Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 34 3 Solution Created 2026-10-03 Updated 2026-10-06
For fixed-design nonparametric regression, let and . The degree- local polynomial estimator takes the fitted intercept , whereUse a nonnegative regression kernel and an invertible local polynomial Gram matrix to obtain a unique fit. For , solving the single weighted least squares normal equation gives the local constant estimator:At the interior point , use the standard unit-integral regression kernel convention . Otherwise the leading variance below is ; unlike a kernel density estimator, the local constant estimator itself is unchanged by rescaling .
The local constant estimator is a linear estimator in nonparametric regression with weights . The independent unit-variance errors implyTo control the bias of an estimator, differentiability at this one point is enough. WriteSymmetry makes , and the supplied moment approximation gives . Therefore the linear contribution to the bias of an estimator is . The remaining contribution has absolute value at most , because only receive positive weight. This is the interior first-order bias cancellation for local constant regression, and gives squared bias of an estimator . Combining with the variance provesFor fixed , take . It satisfies both asymptotic smoothing bandwidth conditions, and the displayed remainder, multiplied by , tends to zero for this fixed . ThusLetting proves the optimized scaled pointwise error tends to zero. The order of these limits matters: no remainder uniform in has been assumed.
For the lower bound over the whole function class, the absence of a uniform bound on derivatives permits a particularly direct argument. It also avoids assuming a normal distribution for errors when the model only supplies their first two moments. Fix and . Choose a smooth bump function on the interval, with , whose support contains no design point except possibly . Such a bump exists because the design is finite; at an endpoint use the restriction of a smooth bump on the real line. Every , , belongs to the differentiability class.
If is not a design point, all observation means are zero for every . The Le Cam two-point lemma applied to has total variation distance zero and gives a lower bound tending to infinity with . In fact, the supremum of the mean squared error is infinite at every such .
If is a design point, only its response depends on . The resulting location family is the single observation ; all remaining observations are independent of and give no extra information. The single-observation location minimax bound isHere is a proof covering discrete as well as continuous errors. Give the prior distribution , independently of the noise. Put and . Consider an easier experiment in which an oracle also reveals whether , and reveals itself on the complementary event. On the event and , every possible truncated noise value places within . The flat prior distribution then makes the Bayesian posterior noise law exactly its truncated original law. The smallest conditional squared-error loss is its conditional variance , attained by the posterior mean.
The probability of that event is at least for , by restricting further to . Thus every rule's supremum risk function is at least the original Bayes risk, which is at least the easier experiment's Bayes risk, and therefore at least . Let and then . Finite second moment and zero mean give . The rule has constant mean squared error one, proving the equality.
Consequently, at every , the unrestricted differentiability class satisfies the stronger conclusionThus works for every . There is no conflict with the preceding fixed-function limit: the worst functions, including arbitrarily narrow bumps, can vary with . This is the pointwise versus uniform risk distinction. A smoothness ball with a common derivative bound would pose a different minimax risk problem.
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 4 a Solution Created 2026-10-03 Updated 2026-10-06
Use an unpenalized intercept in ridge regression. For centered predictor columns, the ridge regression optimization isDifferentiating with respect to gives . Put . Differentiation with respect to gives the ridge normal equationConsequently the closed-form ridge regression estimator isBecause , the numerator may also be written . For the inverse exists even with multicollinearity or deficient column rank; at a unique ordinary least squares coefficient vector requires full rank. The quadratic penalty stabilizes nearly singular directions but generally does not set individual coefficients exactly to zero.
For uncentered original predictors, use , apply the displayed estimator to , and recover . Any internal scaling used by
lm.ridge must be undone to report coefficients on the original predictor scale. Multiplying the objective by a constant changes the numerical penalty convention unless is rescaled as well. Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 6 b Solution Created 2026-10-03 Updated 2026-10-06
The statistician first models the age- and gender-dependent mean by linear regression. Its fitted value is . At fixed gender, a year of age is associated with a decrease of BMI units; the group coded gender has a fitted mean units above the group coded at the same age. This question does not state which gender receives which code. The intercept refers to age zero in the reference group, outside a typical adult-patient range, so its substantive interpretation is limited. Both slope Student t-tests have small p-values, and the overall F-test supports an age/gender-dependent mean. The coefficient of determination is only , leaving considerable individual variation to investigate.
The residual diagnostics check whether mean adjustment is plausible and whether a single normal error law is adequate. The residual-versus-fitted plot has no strong curved mean trend, although its smooth curve is not perfectly flat. The scale-location plot suggests some decline in spread as fitted BMI increases, so common residual variance is a working approximation rather than an established fact. The normal Q-Q plot has systematic departures, notably shorter tails than the normal reference, suggesting the residual law is not exactly normal. The regression leverage plot does not display an obviously extreme leverage point, but the marked observations and Cook's distance should still be checked for influence. Independence between patients cannot be diagnosed from these four plots alone.
Next the statistician extracts the regression residuals and fits an intercept-only normal model as a baseline residual distribution. With an intercept in the original ordinary least squares model, the residuals sum to zero by the normal equation; the near-zero fitted residual mean and its are therefore automatic, not new evidence of good fit. The standard error in this refit uses degrees of freedom, whereas the original uses after estimating three regression coefficients. The reported log-likelihood for the single-normal residual model is .
The histogram suggests a shape worth exploring beyond one normal density, with broad shoulders and some asymmetry, without showing unambiguous separated clusters. The statistician fits two- and three-component finite Gaussian mixtures with a common variance by the expectation-maximization algorithm, starting from separated means and positive weights. Successive likelihoods increase and the displayed final iterations stabilize, as expected from EM likelihood monotonicity. This is evidence of numerical convergence from those starts, not proof of a global maximum.
The two-component fit assigns weights , residual means and common variance . The three-component fit assigns weights , residual means and common variance . The code correctly passes the square roots of those variances to
dnorm and overlays the resulting weighted densities. Both curves broadly follow the histogram and are very similar. In particular, a two-component mixture need not have two distinct visible modes.These fits explore residual mixture clustering: groups differ in BMI relative to the same age/gender-adjusted mean, rather than simply in raw BMI. Membership can be summarized by the fitted mixture responsibilities, retaining uncertainty instead of asserting a certain label for each patient. The common-variance assumption is economical, but should be checked; the common regression slope assumption and constancy of mixture proportions across age and gender are also substantive. A residual mixture alone does not establish genuine biological subpopulations; a flexible continuous distribution, missing predictors, nonlinear mean effects or heteroscedasticity could explain a similar marginal shape.
There is also a two-stage residual mixture fitting limitation. Fitted regression residuals are not exactly independent identically distributed observations: even under a normal regression, their covariance matrix is , and estimating the mean adjustment introduces uncertainty. With subjects and three initial regression coefficients, treating them as independent is a useful approximation for exploring shape, but ordinary mixture likelihoods omit the first-stage uncertainty. A joint mixture regression with shared slopes, or a suitable bootstrap of the whole analysis, would give a firmer basis for parameter uncertainty and cluster selection. Examine component membership versus age/gender and repeat the algorithm from multiple starts before making substantive clustering claims.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 2 a Solution Created 2026-10-03 Updated 2026-10-06
The Gaussian likelihood has log-likelihood, apart from no omitted parameter-dependent terms,For fixed , maximizing it is ordinary least squares. Differentiating with respect to gives the normal equation . Full column rank makes the quadratic strictly convex, soAt this value, differentiating with respect to gives , soFor positive RSS this is the global likelihood maximum in . RSS is positive almost surely under the model since ; an exactly zero observed RSS instead gives a boundary supremum as .
As a linear image of a multivariate normal vector, the coefficient estimate satisfiesIndeed, , and direct matrix multiplication gives its covariance matrix.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 5 a Solution Created 2026-10-03 Updated 2026-10-06
At a target , approximate the unknown mean locally by and solve the local linear regression weighted least-squares problemwhere is a nonnegative regression kernel and a smoothing bandwidth. A common factor in all weights makes no difference. Estimate by the fitted intercept , and optionally by . Repeat at each target rather than fitting a single global straight line.
For an explicit expression put and . The normal equations yieldThe denominator is positive provided there are at least two distinct positively weighted predictor values. The weights sum to one and their first centered moment is zero, so local linear regression exactly reproduces affine functions and reduces boundary bias compared with a local constant fit. Smaller uses more local detail and increases variance; larger smooths more and can increase bias. Choose the bandwidth by cross-validation or another justified criterion. A nearest-neighbour span provides an adaptive bandwidth, as in the local fits used later.
Past exam of the mathematics course of the University of Cambridge 2017 ib Paper 2 19C Solution Created 2026-09-24 Updated 2026-10-05
The linear least-squares problem is to minimize over , allowing an overdetermined system to have a nonzero residual. For a full QR decomposition, is orthogonal and is with an upper-triangular top block. Orthogonal transformations preserve the Euclidean norm, soIf has full column rank, the top triangular block is nonsingular; setting its residual to zero gives the unique minimizer, while the remaining residual is independent of . Without full column rank, minimizers still exist but need not be unique.
For the specified matrix, one Householder reflection already produces an upper-triangular matrix. Take , the difference between the first column and , and setThe formula gives , . Direct multiplication yields the Householder QR decompositionAll subdiagonal entries in the remaining columns are already zero, so no further reflection is needed. For the supplied right-hand side, . Back substitution gives , , , henceThe residual is orthogonal to every column of , independently confirming the normal equations .
Past exam of the mathematics course of the University of Cambridge 2017 ib Paper 3 20H a Solution Created 2026-09-24 Updated 2026-10-05
The Gauss-Markov theorem states that with full-column-rank design, mean-zero errors and covariance , the ordinary least squares estimator is the best linear unbiased estimator: its covariance is no larger than any other such estimator's in the Loewner order. Normality is unnecessary for that theorem.
In the given normal linear model, maximizing the likelihood function is equivalent to minimizing . The normal equations and full rank giveFor a direct variance comparison, write . Unbiasedness for every requires . Set and , so . The cross covariance terms vanish because . ThereforeThis proves the requested comparison for every contrast without relying only on the theorem's name.
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 ib Paper 1 19H a Solution Created 2026-09-24 Updated 2026-10-03
Minimizing gives the normal equations . Full column rank makes invertible, soWith the hat matrix , the residual is . The symmetric projection has rank , henceand the latter estimator is unbiased.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 210 2 Solution Created 2026-10-03 Updated 2026-10-05
Put and , where is a nonnegative integer and is the smoothing bandwidth. The local polynomial estimator is the intercept of the weighted least squares fitWhen the local polynomial Gram matrix is invertible, the normal equations giveA singular local polynomial Gram matrix requires a selection convention and may leave the intercept unidentified; an arbitrary nonnegative regression kernel alone does not guarantee uniqueness. At , provided , the Nadaraya–Watson estimator isMultiplying every weight by changes neither fit.
For the uniform kernel, let and . Then . For and , the interval is inside , and the regular design hasThe same lower bound holds when the interval starts at zero, despite the absence of the design point zero. In particular the Nadaraya–Watson estimator is defined throughout the integration interval.
For every Lipschitz continuous mean function in , the bias of an estimator and variance satisfyHere the variance uses the independence of the errors in the fixed-design nonparametric regression model. The bias-variance decomposition of mean squared error and Tonelli theorem give a slightly stronger integrated mean squared error bound than required:ThusThe printed integration interval represents a nonnegative risk function for . For , the written integral has reversed limits and is nonpositive, making the displayed upper bound trivial; it should not be interpreted as an integrated mean squared error in that range. For , evaluation outside would additionally require a specified extension of the mean function. The subsequent optimization restricts to .
Minimizing the stated right side givesFor sufficiently large , and . For example take . Therefore the upper bound holds with
For the lower bound, the PDF has the mean squared error ; the TeX erroneously moves the square outside the expected value. The PDF's suggested smooth bump function is , with value zero at the endpoints, rather than the corrupted TeX formula. A triangular alternative suffices because only Lipschitz continuity is needed.
The Le Cam two-point lemma says that for two data laws with parameter separation , every estimator satisfiesIndeed, classify according to the nearer parameter value. Misclassification incurs squared-error loss at least , and the sum of the two error probabilities is at least one minus the total variation distance. Averaging the two risk functions proves the stated form.
Let , , and use the two-point lower bound with a triangular bumpBoth functions are in , and . Assume first that and . At most design points meet the bump's support. The Kullback-Leibler divergence between normal distributions and chain rule for relative entropy giveThe Pinsker's inequality therefore gives . The Le Cam two-point lemma yields the pointwise minimax rate for Lipschitz regressionThis universal constant is valid for .
If the printed lower bound is read as applying to all positive integers , it also holds with a smaller constant depending on the fixed . For , use the constant mean functions and . They have Kullback-Leibler divergence , so Pinsker's inequality and the Le Cam two-point lemma give minimax risk at least . Combining the two ranges gives the explicit all- choiceThe universal asymptotic constant and this parameter-dependent all- constant are distinct conventions; the latter supplies the assertion without inserting an unstated large- restriction.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 350 2 c Solution Created 2026-10-03 Updated 2026-10-05
Use the shape-rate convention for the Gamma distribution. DefineThe zero null space assumption makes a positive-definite matrix, and is the unique ordinary least squares solution. The Gaussian likelihood contributes , which must be retained because is unknown. Multiplying it by the improper prior and the Gamma distribution gives the normal-gamma posterior with a flat prior:Here the constant density of the improper prior cancels on normalization. PutThe normal equation makes the residual orthogonal to the range of . The orthogonal decomposition by a closed subspace into that range and its orthogonal complement givesIntegration over by the Gaussian integral, followed by integration over using the Gamma distribution, yieldsThus the posterior distribution is proper, despite the improper prior; here follows from the zero null space assumption.
Completing the square in and collecting the powers of give the two conditional distributions:Explicitly their probability density functions areFor a joint maximum a posteriori estimate relative to , first fix . The unique maximizing is . The remaining log density is plus a constant. Consequently, if ,The stated assumptions do not always imply . If , the supremum occurs as but is not attained on ; if , the density is unbounded there. In either case there is no joint maximum a posteriori estimate in the stated parameter space. Calling zero a boundary mode does not make it an admissible positive precision.
If “MAP estimators” instead means separate modes of the marginal distributions, integration givesThus the marginal maximum a posteriori estimate of is always , and that of is when , with the same nonattainment at zero when . Joint and marginal maximization are different operations; the usual joint interpretation gives the preceding boxed pair.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 1 29J a Solution Created 2026-09-24 Updated 2026-09-29
The Gaussian likelihood is proportional toso maximum likelihood estimation is equivalent to ordinary least squares. If and has rank , then is invertible and the normal equations giveIf , then and . A least-squares minimizer always exists, but it is not unique: by rank-deficient ordinary least squares, the complete set isan affine subspace of dimension . Thus there are uncountably infinitely many likelihood maximizers. In the generic full-row-rank case their dimension is .
Past exam of the mathematics course of the University of Cambridge 2020 ib Paper 2 18H a Solution Created 2026-09-24 Updated 2026-10-03
Because has full column rank, is invertible. The ordinary least squares estimator isIt satisfies the normal equationsso the residual is orthogonal to the column space of . For any ,The two terms are orthogonal, and the Pythagorean theorem in an inner-product space givesThus minimizes the least-squares objective.
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 221 3 iii Solution 2026-09-28
For fixed , conditional least squares is minimized byTherefore the remaining objective iswhose normal equation givesLetbe the conditional average treatment effect. Since is binary, conditional exchangeability impliesand . HenceThus is the overlap-weighted average treatment effect. It weights covariate strata by the overlap weight and generally differs from the ordinary ATE when treatment effects are heterogeneous and overlap varies with .
Past exam of the mathematics course of the University of Cambridge 2023 ib Paper 1 5B a Solution Created 2026-09-24 Updated 2026-09-25
For any ,If the normal equation holds, the last two terms reduce to , so minimizes. Conversely, at a minimizer the directional derivative in every vanishes, forcing .