Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 37 1 e Solution Created 2026-10-03 Updated 2026-10-07
The largest positive regression residual divided by the residual standard error is about , , and in the three models. In comparison, the most negative regression residual is only about two residual standard errors below zero. At least one observation is much heavier than its fitted value, even after adjusting for sex and height.
A standardized regression residual is , so the regression leverage adjustment can make these ratios larger. The maximum is selected among 100 correlated regression residuals, however; it is not a prespecified single standard-normal observation. These summaries do not give a formal regression outlier test or identify which student is extreme. Ask to check the measurement and data entry, examine residual plots and a normal quantile-quantile plot, and inspect regression leverage and influential observations. A valid observation might reveal a heavier-tailed error distribution, an omitted predictor, or a nonlinear relation. Do not remove it solely because it is unusual, and do not infer from the three summaries alone that all three maxima belong to the same student.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 1 a Solution Created 2026-10-03 Updated 2026-10-07
Use the normal linear modelHere is the response random vector, is the known design matrix, contains the unknown regression coefficients, and is the common error variance. Conditional on , the errors have normal distributions and are independent random variables. Require for identifiability of and invertibility of . Usually is needed to estimate the error variance from the regression residuals. An intercept, when included, is represented by a column of ones in .
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 30 1 d Solution Created 2026-10-03 Updated 2026-10-07
Because both vectors are linear transformations of the same multivariate normal response, is jointly multivariate normal. Its cross-covariance matrix isZero cross-covariance implies independence for jointly multivariate normal vectors, including singular ones. Therefore the fitted values and the entire vector of regression residuals are independent. The fitted-residual orthogonality identity gives the zero covariance; the normal distribution assumption is what upgrades it to independence.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 1 e Solution Created 2026-10-03 Updated 2026-10-07
The simple linear regression assumes a straight conditional mean, , so that errors are centred at zero throughout the predictor range. The displayed regression residuals are predominantly positive at both ends and negative in the middle. This is a residual curvature diagnostic: the fitted straight line misses a curved conditional mean. The main concern is the shape of the mean function. The plot alone does not establish failure of the normal distribution assumption or a particular error variance model.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 1 f Solution Created 2026-10-03 Updated 2026-10-07
A natural next fit is quadratic regression, which remains a normal linear model in its unknown regression coefficients:The new design matrix has rows and must have matrix rank three; three distinct predictor values suffice. The curved regression residual pattern suggests trying a positive quadratic term, but its sign and adequacy should be checked after fitting. Inspect the new regression residuals to see whether the systematic curvature has disappeared.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 2 e Solution Created 2026-10-03 Updated 2026-10-07
The analysis of variance provides evidence of a chocolate effect both with day included (, p-value ) and with day omitted (, p-value ). Because every chocolate–day cell has the same replication, balanced factorial orthogonality separates the two main effects; the chocolate row is meaningful despite being entered first.
The chocolate-only fitted group means are approximately boards for A, B, C, D respectively. Thus A has the largest fitted lecturing speed and C the smallest. Relative to A, the fitted differences are boards. The printed individual Student t-tests give strong evidence for the A–C contrast (p-value ); B and D versus A have p-values and , respectively. Those latter contrasts are not significant at 5%, and the output does not test all other pairwise comparisons. Simultaneous claims would require accounting for multiple hypothesis testing.
There is little evidence of a day effect after adjusting for chocolate. A chocolate-only normal linear model is therefore a reasonable simpler summary, with residual standard deviation about boards and explained variation . This is an association under the additive statistical model; a causal claim would additionally require an appropriate assignment of chocolate and checks of the regression residuals and possible interaction terms.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 4 a Solution Created 2026-10-03 Updated 2026-10-07
Measurements from the same person share baseline strength and likely share an individual response to training. An ordinary linear model with independent errors treats all 600 readings as independent conditional on week; that fails to represent their within-person correlation. The regression residuals can remain associated even when the population mean is linear in time. A random intercept captures differences in baseline strength, and a random slope can additionally describe differences in progress.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 1 Solution Created 2026-10-03 Updated 2026-10-06
For the normal linear model, the log-likelihood isThe full column rank of the design matrix makes invertible. Differentiating in gives the normal equations . With the minimized residual sum of squares substituted, differentiation in givesThese are the maximum-likelihood estimators almost surely; almost surely when and . The linear transformation of the multivariate normal distribution yieldsDefine the hat matrix . The fitted values are , the regression residuals are , and . The orthogonal projection has rank and annihilates . By Cochran's theorem,Consequently , with bias . The unbiased estimator isIts square root, the reported residual standard error, estimates ; the assertion of unbiasedness applies to the variance, not generally to its square root.
For the paper-strength analysis, let be the measured percentage and . Both normal linear models use independent errors of common variance . Their mean functions are for
lm1, and for lm2, with separately fitted coefficients. The reported residual standard errors are and , respectively.For
lm1, the estimated conditional expectation at a new percentage isThe original data mean must be used for centering the new percentage; its numerical value is not supplied in the excerpt. Because , the two columns of this design matrix are orthogonal, and . Hence the coefficient standard errors in the output giveThis estimates uncertainty in the mean. Predicting an individual future batch would additionally require the new-error variance, estimated by .To compare the nested normal linear models, test against within the quadratic model. The Student t-test statistic isIts two-sided p-value is . Equivalently is a partial F-test statistic with null distribution . Reject the linear restriction and prefer
lm2 at the 5% level. Its residual spread is much smaller; the increase in the coefficient of determination from to supports the same conclusion, although the test is the relevant complexity-adjusted comparison.For regression diagnostics, inspect regression residuals against fitted means and hardwood percentage for omitted curvature, a scale-location plot for nonconstant variance, and a quantile-quantile plot against the normal distribution for departures from the error assumption. Check unusual observations using regression leverage and Cook's distance, and examine residuals in collection or batch order if dependence is plausible. Independence and a common variance require substantive justification as well as these plots; a small p-value for a polynomial term does not itself check the error model.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 32 1 Solution Created 2026-10-03 Updated 2026-10-06
With the centred data, no intercept is needed. Use the Lasso normalizationWrite and . The KKT conditions areIndeed, the subdifferential of the L1 norm consists of vectors with at nonzero coordinates and at zero coordinates. The subgradient optimality condition is . convexity makes these conditions sufficient as well as necessary. These are the Karush-Kuhn-Tucker conditions for the Lasso.
Here is a correlation-parameter version of least angle regression. Put , a Gram matrix, and initialize , , .
- Compute . For , keep . If , stop: all regression residual correlations already vanish. Otherwise add the uniquely maximizing variable to obtain .
- At step , put , , , and . These active signs have entries in . Solve , set , and follow the segment
- For each inactive variable set . Along the segment its correlation is , where . Its candidate hitting distances areDiscard undefined or nonpositive candidates. Choose the smallest remaining distance below , if one exists, and otherwise choose . Set . If , add the unique variable achieving the hit to form and repeat; if , stop.
The two hitting formulas come from . This is LAR hitting time. Active variables are not dropped if a coefficient crosses zero: that is the distinction between this algorithm and the modified Lasso path algorithm.
The active Gram matrix is an invertible matrix under the assumed unique positive hits. Inductively, a candidate column in the span of the current active columns would have equal to a fixed linear combination of their correlations, hence proportional to on the whole segment. Its ratio could not first reach one at a positive interior knot. Thus every uniquely entering column adds a new independent direction. This also allows more predictors than observations; the algorithm stops before a dependent direction needs to be added at zero correlation.
We now prove the requested invariant. At the first positive knot the newly active correlation has magnitude . At a later knot the old active correlations have that knot's magnitude by induction, and the entering correlation has the same magnitude by the hitting rule. Throughout the next segment,The first-hitting rule also ensures for every inactive . If no positive hit remains, this inequality continues to zero, where all correlations vanish. Consequently, on every printed closed segment,This is the LAR active correlation invariant.
If active nonzero coefficients have the same signs as their residual correlations, the active equalities are precisely the nonzero-coordinate Lasso KKT conditions. An active coefficient which is zero also satisfies the zero-coordinate KKT conditions, because its correlation is within . Inactive coefficients are zero and satisfy those same inequalities by construction. Thus every point of the least angle regression path is a Lasso minimizer for . Under the stated uniqueness assumption,This proves the desired implication, in fact under the weaker sign compatibility of LAR and Lasso condition requiring agreement only at nonzero coefficients.
There is an endpoint convention in the printed sufficient condition. With the standard , a newly entering coefficient is zero at a positive knot although its correlation is ; the displayed sign equality therefore cannot literally hold there. At the final zero knot the correlation signs are zero as well. Interpret sign compatibility on positive open segments, or in the nonzero-coefficient/subgradient sense just proved. The KKT conditions already handle zero coefficients at knots, and no equality of solution paths at is needed for the requested conclusion.
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 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 2015 ii Paper 3 4J Solution Created 2026-09-24 Updated 2026-10-06
The command fits the simple linear regressionusing ordinary least squares. The fitted conditional mean is a straight line in time. The regression residuals are mainly positive at the beginning and end and negative in the middle, so the mean function needs curvature.
A direct improvement is polynomial regression of degree two:The nested-model F-test tests against a nonzero quadratic coefficient. If measurements were used, its statistic isA small reported -value supports the quadratic term. The new regression residuals should then be checked for remaining systematic structure, changing variance and temporal dependence, because the F-test assumes independent errors of common variance. Radioactive decay also motivates an exponential mean, but the displayed curvature already justifies this simple nested comparison.
fit2 <- lm(Counts ~ Time + I(Time^2), data = geiger)
anova(fit1, fit2)