Deviance residual 2026-10-06
A deviance residual is the signed square root of an observation's contribution to fitted-model deviance. For a Poisson regression, , with . Its squared sum is the Poisson deviance. Leverage and estimated dispersion can further standardize these residuals; a normal quantile-quantile plot is a diagnostic approximation, not a requirement that count errors have a normal distribution.
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 2016 iii Paper 206 1 b Solution Created 2026-10-03 Updated 2026-10-06
Let , , , and . The horizontal axis of the residual-versus-fitted plot is , the fitted values, and the vertical axis is , the regression residual, in millimetres. Under the normal linear model, , where is the regression leverage.
In the quantile-quantile plot, the vertical values are the ordered standardized regression residualsand the horizontal values are corresponding theoretical quantiles of the standard normal distribution, with plotting positions such as . The exact plotting-position convention has little practical effect here. Under Gaussian errors these points should approximately follow a straight line; they are not independent because fitting induces residual correlations.
The main visible concern is curvature in the conditional mean. The red smooth in the residual-versus-fitted plot descends from positive residuals at low fitted values, becomes negative in the middle, and rises again at high fitted values. This suggests the strictly linear time effects may be inadequate. There is no clear monotone widening of the residual scatter, so strong heteroscedasticity is not apparent. The quantile-quantile plot has modest tail deviations and a few labelled observations, but does not show a dramatic departure from normality. These plots cannot establish independence across days or laboratories; check residuals against day, laboratory, and sampling order as well. A large coefficient of determination does not remove the visible mean-model concern.
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 2016 iii Paper 206 3 e Solution Created 2026-10-03 Updated 2026-10-06
The residual smooth rises from negative values, arches above zero, then falls at high fitted values. This suggests a nonlinear altitude effect on the log mean. Since the fitted log mean in the linear model increases with altitude, the horizontal fitted-value axis is also an increasing rescaling of altitude. A generalized additive model with Quasi-Poisson regression is therefore a reasonable candidate:The centering constraint identifies the intercept. Here
bs="cr" uses a penalized cubic regression spline. The plotted count residuals are deviance residuals, with the Q-Q panel using leverage-standardized versions. The quantile-quantile plot also shows tail discrepancies, but normality of count residuals is not a distributional assumption of this model: its main requirements are an adequate mean, variance relation, and independence. Investigate the labelled islands and possible excess variation as well.The estimated smooth in the second plot increases fairly rapidly at low altitude, flattens around altitude 20 to 25, and is nearly level at the upper end. The pointwise bands widen where there are fewer observations. A penalized spline can describe a rise followed by a plateau without forcing a global parabola. A quadratic log mean has slope , so negative curvature eventually forces a decline and its curvature is constant everywhere. A cubic regression spline allows different curvature over different ranges, with a penalty controlling unnecessary wiggles and natural linear tails outside its boundary knots. The displayed smooth supports this greater flexibility, but it is not by itself a formal rejection of every quadratic model. Select complexity and compare predictive performance using cross-validation, then reassess residuals and the Pearson dispersion estimator.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 6 a Solution Created 2026-10-03 Updated 2026-10-06
Write for stirring rate of observation in furnace . The independent random-intercept and random-slope model isErrors and random effects are independent. The separate R terms
(1 | furnace) and (0 + stir | furnace) impose independent random intercepts and random slopes; (1 + stir | furnace) would instead estimate their covariance as well. The estimates areThe corresponding estimated standard deviations are , , and ; they are not additional parameters.For a furnace with predictor vector , the marginal formulation, obtained by integrating the Gaussian random effects, isindependently across furnaces. In particular,In stacked notation , , giving the Gaussian linear mixed model marginal law with .
The residual-versus-fitted plot on page 17 has residuals of both signs over the fitted range, with no convincing smooth curvature or clear fan shape. Its quantile-quantile plot is roughly straight in the central region, with some tail departures and a few large negative residuals. There is no decisive visible violation, but investigate those observations. These plots mainly address conditional observation errors; they do not validate the distribution of furnace random effects or independence within furnaces. With only three furnaces, normality and the variance of the random effects are especially difficult to assess.
Regression diagnostics 2026-10-06
Regression diagnostics check assumptions and influential observations in a fitted regression function. Residual-versus-fitted plots can reveal omitted mean structure or nonconstant variance; a quantile-quantile plot checks a specified error distribution. Regression leverage measures unusual predictor configurations, and Cook's distance combines leverage and residual size to measure coefficient sensitivity. Independence may require checking collection order and the study design in addition to residual plots.