Centred simple linear regression Created 2026-10-14 Updated 2026-10-25
In simple linear regression written as , the constant and centred predictor columns are orthogonal. Differentiating the sum of squared residuals gives the displayed ordinary least squares estimators, provided . For independent mean-zero errors of common variance , both estimators are unbiased, their variances are and , and their covariance is zero. The uncentred intercept is .
Past exam of the mathematics course of the University of Cambridge 2007 ib Paper 4 19C i Solution Created 2026-09-24 Updated 2026-10-14
Write and . For an identifiable two-parameter linear regression assume ; for the variance estimate and test below also assume . The least-squares normal equations areUsing givesThe residual sum of squares has positive-definite quadratic part , so these equations give its unique minimum. The normal distribution of the independent errors gives the log-likelihoodFor every fixed positive , maximizing this over is exactly minimizing the same residual sum of squares. Thus the ordinary least squares estimators are also the maximum-likelihood estimators.
The printed hypotheses do not explicitly require or . If , all vanish and is unidentifiable; this is an intercept-only model with residual degrees of freedom. For its residual is identically zero, so the likelihood has no finite maximizer with positive variance. If but , the fit is saturated, leaving no residual variance estimate or Student test with positive degrees of freedom. The following nondegenerate formulas use and .
Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 1 13J Solution Created 2026-09-24 Updated 2026-10-14
Use a normal linear modelThe distance and climb are treated as fixed predictors; the assumptions are a linear conditional mean, independent errors with common variance, and normal errors for the exact tests. Fit by ordinary least squares using
hills.lm1 <- lm(time ~ dist + climb, data = hills)The overall null hypothesis is , against at least one nonzero slope. The intercept-only and full models have respectively 34 and 32 residual degrees of freedom. Under the null, the F-test statistic isThe displayed residual sums are rounded; use the reported statistic for the test. Its upper-tail p-value is below , so reject the no-relationship hypothesis overwhelmingly. At least one predictor adds information beyond a constant mean.
In the coefficient table, Estimate gives one of the ordinary least squares estimators, Std. Error is the estimated standard deviation of that estimator, t value is the estimate divided by its standard error, and the last column is the two-sided p-value for a zero coefficient. Under the corresponding null, the statistic has a Student's t-distribution with 32 degrees of freedom. The fitted mean isAt fixed climb, an extra mile predicts about 6.22 extra minutes; at fixed distance, an extra foot of climb predicts about 0.01105 extra minutes. Both slopes have strong evidence of being positive. Specifically the climb test uses and , so climb remains significant after controlling for distance. The intercept differs from zero at the 5% level, but extrapolating to a zero-distance, zero-climb race has no useful physical interpretation.
The regression diagnostics show a very large positive residual for Knock Hill and a smaller positive outlier for Bens of Jura. The Q-Q plot has a pronounced upper tail, contradicting the assumed normal-error pattern. These observations can distort both the fitted coefficients and the estimated error variance. Check the source records, units, transcription and any unusual race conditions first, especially for Knock Hill; correct a demonstrated data error and refit. If the records are valid, consider omitted terrain effects, nonlinear distance/climb effects, a suitable response transformation or robust regression, and compare fits with and without influential observations. A diagnostic outlier alone is not a reason to silently delete a valid record.
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 4 10J Solution Created 2026-09-24 Updated 2026-10-06
Write . Minimizing the residual sum of squares first over the coefficients of reduces the problem to minimizing . Full column rank ensures . Thus the partial regression formula and its variance areThis uses and the isotropic error covariance matrix .
Since the span of is contained in the column space of , orthogonal projection onto the latter removes at least as much squared norm. Consequentlyand inversion proves the requested lower bound. Full rank makes the denominator positive.
Adding to column leaves the column space unchanged. Every old fitted vector is reproduced by keeping all slopes unchanged and replacing the regression intercept by . Uniqueness of the ordinary least squares estimators then proves that slope is unchanged. In particular all columns can be centered by such changes. Applying the previous projection argument to the centered design proves the bound with and ; the normalized inner product is now the usual sample correlation.
Each reported coefficient test is the two-sided Student's t-test of against , conditional on the other predictors. Under the null, has a Student's t-distribution with degrees of freedom. At five percent the intercept is significant, but neither individual test slope is. The final F-test compares the full model against an intercept-only model: . It has degrees of freedom and rejects at five percent, since its -value is . Thus the predictors jointly explain variation, without strong evidence separating their individual conditional effects.
The two test predictors have sample correlation , although each has only moderate correlation with the final exam response. The variance inflation factor is . Their nearly shared direction produces substantial multicollinearity, inflating the individual slope standard errors. The joint F-test can detect this common predictive direction even though either coefficient, given the other, has a large -value.
Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 2 5J a Solution Created 2026-09-24 Updated 2026-10-05
Use the usual normal linear model , with fixed full-column-rank design , , and . These Gaussian distribution and constant-variance hypotheses are necessary for an exact finite-sample Student's t-test. Put and . The vector of ordinary least squares estimators satisfiesWith , the test statistic isUnder the null hypothesis, has Student's t-distribution with degrees of freedom. A two-sided level- Student's t-test rejects when . If the intended test is one-sided against , it rejects when ; the statistical power conclusion below holds for either convention.
Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 3 5J Solution Created 2026-09-23 Updated 2026-09-25
Assume has full column rank. The log-likelihood, up to constants, isThe ordinary least squares normal equations giveand maximizing over the variance gives the maximum-likelihood estimatorBecause is an orthogonal projection of rank ,Writing for the -quantile, a confidence interval of level is
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 30J a Solution Created 2026-09-24 Updated 2026-10-03
A regression tree chooses a threshold and constant predictions to minimize the squared-error criterionwhere ranges over thresholds producing two nonempty groups. For a fixed split, the least-squares minimizers are the two sample means,Thus the first split is the candidate threshold with the smallest sum of the two within-node residual sums of squares.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 4 30J c Solution Created 2026-09-24 Updated 2026-09-25
WriteThe ordinary least squares estimators givewhereThe denominator is positive because the sorted inputs are distinct and .
Past exam of the mathematics course of the University of Cambridge 2024 ib Paper 4 17H a Solution Created 2026-09-24 Updated 2026-09-25
LetDifferentiating the Gaussian log-likelihood, equivalently minimizing the residual sum of squares, gives the ordinary least squares estimatorsassuming .