You are on page 1of 2

STA3002: Generalized Linear Models Spring 2023

Homework #4
This is the homework for week 5. The due date is midnight, March 7th , 2023. Late submission
will automatically result in “0” grade.

1 Computation Questions
(Question1): (25 points) Consider the exponential distribution with probability function
1
P (y; µ) = exp(−y/µ),
µ
for µ > 0 and y > 0. Consider estimating the mean µ for the exponential distribution based
on a sample y1 , . . ., yn .
(a) For H0 : µ = 1, vs. H1 : µ > 1. Calculate Wald, Score and LR test statistics.
(b) Suppose n = 3, and y1 = 1.5, y2 = 2.5, y3 = 5, compute the Pearson, deviance and
quantile residuals.
(Question2): (25 points) Suppose Y ∼ EDM with mean µ and dispersion ϕ, and A() is a contin-
uous and differentiable function.
A(y)−A(µ)
(a) Let rA = √ . rA is actually called Anscombe residual. Show that Var(rA ) = ϕ
A′ (µ) V (µ)
(Hint: you may consider Tayler expansion of A(y)).
(b) Let A(t) = V −1/3 (t)dt, where V (µ) is the variance function of an EDM. Hence show
R

that the Anscombe residuals for the Poisson distribution are


3(y 2/3 − µ2/3 )
rA = .
2µ1/6

(c) Compute the Anscombe residuals for the Gamma and Inverse Gaussian distributions.

2 Programming Questions
1. (25 points) Children were asked to build towers as high as they could out of cubical and
cylindrical blocks. The number of blocks used and the time taken were recorded (data set:
blocks, from package "GLMsData"). In this problem, only consider the number of blocks used
as y and the age of the child x. Fit a GLM for these data.
(a) Test model’s goodness of fit.
(b) Perform a diagnostic analysis, and determine if the model is suitable.

2. (25 points) The standardized deviance residual rD,i is approximately the reduction in the
residual deviance D(y, µ̂) when Observation i is omitted from the data. Demonstrate this in
R using the "trees" dataset (from package "GLMsData") as follows.
(a) Fit the model called as fit.all. Compute the residual deviance, the Pearson estimate of
ϕ, and the standardized deviance residuals from this model.

1
(b) Omit Observation 1 from trees, and refit the model. Call this model fit.omit1.
(c) Compute the difference between the residual deviance for the full model fit.all and for
model fit.omit1. Show that this differences divided by the Pearson estimate of ϕ is
approximately the standardized deviance residuals squared.

You might also like