Docsity

Homework Assignment 1 - Generalized Linear Models | STA 7249, Assignments of Biostatistics

Toggle sidebar
bg1
STA 7249: Generalized Linear Models
Homework Assignment 1: Spring 2004
1. Suppose Y∼Gamma(µ, φ). Note that Yhas an exponential distribution when the
φ= 1, and that the density of Y /µ does not depend on the value of µ. This is
important in parts (a), (c), and (d).
(a) Evaluate the normal approximation to the distribution of Yby plotting the
density of (Y−µ)/√φµ for various values of φ.
(b) Derive the moment generating function of X= log Yand hence find formulas
for E(X) and var(X).
(c) Plot the density of (X−E(X))/pvar(X) for the values of the dispersion pa-
rameter considered in part (a). Hence evaluate the normal approximation to the
distribution of X.
(d) Plot the density of the signed (and scaled) likelihood root statistic
r= sign(Y−µ)s2
φ−log Y
µ+Y−µ
µ
for the values of the dispersion parameter considered in part (a). Hence evaluate
the normal approximation to the distribution of r.
2. Let X1, . . . , Xnbe an i.i.d. sample from the negative binomial distribution, NB(µ, α),
i.e., with common probability mass function
f(y;µ, α) = Γ(α+y)
y! Γ(α)α
α+µα1−α
α+µy
, y = 0,1,2, . . . .
Note: if αis a positive integer, then this is just the usual negative binomial with sucess
probability p=α/(α+µ), i.e., the distribution of the number of failures prior to the
αth success in a sequence of independent Bernoulli trials with sucess probability p.
(a) Assuming that αis known, show that f(y;µ, α) is an exponential dispersion
family and identify the canonical parameter θas a function of µand α. (Note
that when αis unknown, NB(µ, α) is not an exponential dispersion family.)
(b) Find the MLE for θwhen αis known.
(c) Derive the ML estimating equation for αwhen θis known.
(d) Describe an algorithm for finding the m.l.e. ( ˆ
θ, ˆα).
(e) The number of species of fish in 70 lakes around the world are given in the
dataset “Fish counts” available from the class website. Test the goodness-of-fit
of a Poisson distribution to these counts.
(f) Write a computer program to fit a negative binomial distribution to the counts.
Email your program to the course TA in a form that he can run. The output
from the program should include the results of each iteration.
1
pf2

Partial preview of the text

Download Homework Assignment 1 - Generalized Linear Models | STA 7249 and more Assignments Biostatistics in PDF only on Docsity!

STA 7249: Generalized Linear Models

Homework Assignment 1: Spring 2004

  1. Suppose Y ∼ Gamma(μ, φ). Note that Y has an exponential distribution when the φ = 1, and that the density of Y /μ does not depend on the value of μ. This is important in parts (a), (c), and (d).

(a) Evaluate the normal approximation to the distribution of Y by plotting the density of (Y − μ)/

φμ for various values of φ. (b) Derive the moment generating function of X = log Y and hence find formulas for E(X) and var(X). (c) Plot the density of (X − E(X))/

var(X) for the values of the dispersion pa- rameter considered in part (a). Hence evaluate the normal approximation to the distribution of X. (d) Plot the density of the signed (and scaled) likelihood root statistic

r = sign(Y − μ)

φ

− log

Y

μ

Y − μ μ

for the values of the dispersion parameter considered in part (a). Hence evaluate the normal approximation to the distribution of r.

  1. Let X 1 ,... , Xn be an i.i.d. sample from the negative binomial distribution, NB(μ, α), i.e., with common probability mass function

f (y; μ, α) = Γ(α + y) y! Γ(α)

α α + μ

)α( 1 − α α + μ

)y , y = 0, 1 , 2 ,....

Note: if α is a positive integer, then this is just the usual negative binomial with sucess probability p = α/(α + μ), i.e., the distribution of the number of failures prior to the αth success in a sequence of independent Bernoulli trials with sucess probability p.

(a) Assuming that α is known, show that f (y; μ, α) is an exponential dispersion family and identify the canonical parameter θ as a function of μ and α. (Note that when α is unknown, NB(μ, α) is not an exponential dispersion family.) (b) Find the MLE for θ when α is known. (c) Derive the ML estimating equation for α when θ is known. (d) Describe an algorithm for finding the m.l.e. (θ,ˆ αˆ). (e) The number of species of fish in 70 lakes around the world are given in the dataset “Fish counts” available from the class website. Test the goodness-of-fit of a Poisson distribution to these counts. (f) Write a computer program to fit a negative binomial distribution to the counts. Email your program to the course TA in a form that he can run. The output from the program should include the results of each iteration.

  1. This problem concerns the Inverse Gaussian distribution. Let Φ denote the standard normal CDF and consider the function

F (y) =

0 , y ≤ 0 , Φ

λ y

−1 + (^) μy

  • e^2 λ/μΦ

λ y

1 + (^) μy

, y > 0.

(a) Show that F has density f given by

f (y) =

0 , y ≤ 0 , ( λ 2 πy^3

exp

− λ(y−μ)

2 2 μ^2 y

, y > 0.

(b) Show that the density can be written in exponential dispersion form. Identify the cumulant function, b(θ), the canonical link, and the variance function for this model.

  1. Write a computer program to fit the logistic regression model

logit π = β 0 + β 1 x

to the space shuttle data available from the class website using the IRLS algorithm described in class. In this model x denotes the temperature at launch time and π = P (number of damaged o-rings > 0) (in the data set, the variable “ndo” denotes number of damaged o-rings).

(a) Email your program to me in a form that I can run. The output from the program should include the results of each iteration and the Wald and LR statistics for testing Ho : β 1 = 0. (b) Explain the criterion you used to determine convergence. (c) Plot the fitted value of π as a function of temperature and mark the estimated value for x = 32o^ (the temperature the morning of the Challenger disaster).

  1. Let X 1 ∼ Bin(m 1 , π 1 ) and X 2 ∼ Bin(m 2 , π 2 ) be independent binomial random vari- ables. Derive the score test of the null hypothesis π 1 = π 2 and show that it is equivalent to the usual Pearson chi-square test.