MATH3714 Jan 2024
MATH3714 Jan 2024
Calculator instructions:
Dictionary instructions:
• You are not allowed to use your own dictionary in this exam. A basic English dictionary
is available to use. Raise your hand and ask an invigilator if you need it.
Exam information:
• This is an Open Book Examination. You are allowed to bring one A4 sheet of notes with
you into the examination. You may write your notes on both sides of the paper. Your
notes may be printed or handwritten.
• There are four questions in this exam paper. You must answer all four questions.
• The numbers in brackets indicate the marks available for each question.
• You must write your answers in the answer booklet provided. If you require an additional
answer booklet, raise your hand so an invigilator can provide one.
• You must clearly state your name and Student ID Number in the relevant boxes on your
answer booklet. Other boxes may be left blank.
y = Xβ + ε
(a) Let H be the hat matrix. Give the definition of H and show that the fitted values [2]
satisfy ŷ = Hy.
(b) Show that H is idempotent. [2]
(c) Show that H is symmetric. [2]
(d) Show that the residuals satisfy ε̂ = (I − H)y. [2]
(e) Give a short proof of the fact that ε̂⊤ ŷ = 0. [3]
(f) State the distributions of y, ŷ and ε̂. (No proofs are required for this part.) [3]
(g) Let v ∈ Rn be a fixed vector. Determine the distribution of v ⊤ ε̂. [2]
(h) Determine the expectation E ŷ ⊤ ŷ . Explicitly state any results from lectures you
[4]
may use.
y = β0 + β1 x1 + β2 x2 + β3 x3 + β4 x4 + ε
to data:
Call:
lm(formula = y ~ x1 + x2 + x3 + x4)
Residuals:
Min 1Q Median 3Q Max
-2.2495 -0.6392 -0.1275 0.8969 1.9140
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.11799 0.55602 0.212 0.834
x1 -0.10824 0.07753 -1.396 0.176
x2 0.40373 0.33949 1.189 0.246
x3 3.32964 0.31410 10.601 2.51e-10 ***
x4 3.25805 0.08065 40.398 < 2e-16 ***
---
Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1
(a) Using the information from the R output, test the hypothesis H0 : β1 = −1 against [4]
H1 : β1 ̸= −1 at the 5% significance level. Clearly state your conclusion.
(b) Determine a 95% confidence interval for β2 . [4]
(c) Assume that we want to test
H0 : β2 = 1 and β3 = β4 against H1 : β2 ̸= 1 or β3 ̸= β4 .
3. A pack of food is taken from the freezer for thawing, and the temperature is repeatedly
measured, after 1, 2, . . . , 20 minutes. Some of the results are given in the following
table:
t [min] 1 2 3 ··· 20
y [°C] -16.2 -14.8 -13.9 · · · 2.9
(a) A linear model is fitted to these data. The following figure shows a residual plot [4]
(left) and a Q-Q plot (right) for the fitted model.
Sample Quantiles
0.5
0.5
resid(m)
−0.5
−0.5
−1.5
Discuss relevant features seen in these plots. Which problem with the model fit do
these plots indicate?
(b) In this model, how would the parameter estimate β̂ change if time was measured [4]
in hours (instead of minutes) and temperature in Fahrenheit (instead of Celsius)?
To transform between degrees Celsius and degrees Fahrenheit, note that c°C cor-
responds to f °F, when f = 1.8 c + 32.
(c) Based on results from physics, a good way to model the temperature might be to [4]
use the model
y = Troom − Ae−kt ,
where Troom is the known room temperature. How can a linear model be used to
estimate the unknown constants A and k from data?
We now return to the general linear regression problem, instead of the specific example
above. Let β̂ (i) ∈ Rp+1 be the estimate of β, computed from the data after removing
the ith observation. It can be shown that
ε̂i
β̂ (i) − β̂ = −(X ⊤ X)−1 xi ,
1 − hii
where xi is the ith row of the design matrix X and hii is the ith diagonal element of
the hat matrix H. (You don’t need to prove this.)
(i)
(d) Let ŷi be the fitted value for xi computed from the model fitted after removing [4]
the ith observation. Show that
(i) hii
ŷi − ŷi = −ε̂i .
1 − hii
4. (a) For a small dataset with n = 20 observations and p = 2 inputs, a linear model
with intercept is fitted using least squares regression. The following table shows the
diagonal elements of the hat matrix, Cook’s D values, residuals and studentized
residuals for each observation:
i hii Di epsi ri
1 0.065 0.001 0.075 0.227
2 0.126 0.000 -0.013 -0.040
3 0.245 0.011 -0.097 -0.324
4 0.205 0.004 0.064 0.208
5 0.150 0.000 -0.001 -0.004
6 0.083 0.011 0.199 0.605
7 0.837 1.371 -0.124 -0.895
8 0.054 0.008 0.213 0.639
9 0.060 0.015 -0.279 -0.837
10 0.051 0.040 0.495 1.479
11 0.069 0.046 0.452 1.365
12 0.145 0.555 -0.993 -3.130
13 0.052 0.019 -0.342 -1.023
14 0.118 0.030 -0.265 -0.821
15 0.128 0.003 -0.076 -0.236
16 0.086 0.025 0.291 0.887
17 0.101 0.014 0.197 0.606
18 0.074 0.007 0.166 0.501
19 0.159 0.006 -0.095 -0.302
20 0.189 0.014 0.133 0.429
i. Identify any outliers in this dataset. Justify your answer. [4]
ii. The studentized residual for the ith observation is defined as [4]
ε̂i
ri = p .
σ̂ 2 (1 − hii )
Explain the motivation of this definition and discuss the advantages of utilizing
studentized residuals over ordinary residuals, ε̂i .
(b) In a few sentences, explain what an M estimator is, and how M estimators address [3]
the issue of x-space and y-space outliers.
(c) Explain two reasons why robust statistical methods are often not used by default, [4]
and are instead only utilized when the presence of outliers is suspected in the data.
(d) For n data points (xi , yi ), the Theil-Sen estimator calculates the n(n − 1)/2 slopes
between all pairs of points (xi , yi ) and (xj , yj ) with i < j, and then takes the
median slope as a robust estimate of the slope of the regression line in simple
regression. We denote the median slope by β̂.
√
i. Show that by changing k := ⌈(1 − 1/ 2)n⌉ of the points, the value of β̂ [3]
can be made arbitrarily large. (The symbol ⌈x⌉ denotes the smallest integer
greater than or equal to x.)
ii. What does the result from part (i) mean for the breakdown point of the [2]
estimator β̂?
Table 1
0.00 0.5000 0.50 0.6915 1.00 0.8413 1.50 0.9332 2.00 0.9772 2.50 0.9938
0.05 0.5199 0.55 0.7088 1.05 0.8531 1.55 0.9394 2.05 0.9798 2.55 0.9946
0.10 0.5398 0.60 0.7257 1.10 0.8643 1.60 0.9452 2.10 0.9821 2.60 0.9953
0.15 0.5596 0.65 0.7422 1.15 0.8749 1.65 0.9505 2.15 0.9842 2.65 0.9960
0.20 0.5793 0.70 0.7580 1.20 0.8849 1.70 0.9554 2.20 0.9861 2.70 0.9965
0.25 0.5987 0.75 0.7734 1.25 0.8944 1.75 0.9599 2.25 0.9878 2.75 0.9970
0.30 0.6179 0.80 0.7881 1.30 0.9032 1.80 0.9641 2.30 0.9893 2.80 0.9974
0.35 0.6368 0.85 0.8023 1.35 0.9115 1.85 0.9678 2.35 0.9906 2.85 0.9978
0.40 0.6554 0.90 0.8159 1.40 0.9192 1.90 0.9713 2.40 0.9918 2.90 0.9981
0.45 0.6736 0.95 0.8289 1.45 0.9265 1.95 0.9744 2.45 0.9929 2.95 0.9984
0.50 0.6915 1.00 0.8413 1.50 0.9332 2.00 0.9772 2.50 0.9938 3.00 0.9987
Table 2. The inverse function Φ−1 (p) is tabulated below for various values of p.