The University of British Columbia MATH 605G/STAT 410/STAT 538/STAT 9924 Practice Test 2 1. Suppose y is a random variable whose distribution is a member of the exponential family having probability function f (y; θ) = eω(yθ−b(θ))/φ+c(y,φ) where b(θ) = − log(−θ). Assume that ω = 1 and φ = 0.5. (a) Find the expected value, µ, of y, as a function of θ. (b) Find the variance of y as a function of θ as well as a function of µ. (c) Find the canonical link function g(µ). (d) Suppose two covariates x1 and x2 were used to predict y using a generalized linear model and the canonical link function. If the respective coefficient estimates were 0.5 and -0.25 (assume there is no intercept), calculate the expected value of y, when x1 = 3 and x2 = 7. (e) Calculate the variance of y under the conditions of part (d). 2. Suppose y is a random variable whose probability density function is ( f (y; λ) = λ e−yλ , 1−e−λ 0, y ∈ (−1, 1) otherwise (a) Show that the distribution of y is a member of the exponential family, identifying the canonical parameter θ and the function b(θ). (b) Find the expected value of y in terms of θ. (c) Find the variance of y in terms of θ. (d) Show that the canonical link function is implicitly defined by the equation g(µ) = (g(µ) + 1 + µ)eg(µ) − µ. (e) Use the above result to show that the variance of y can be expressed as a function of µ. 3. Suppose that y1 , . . . , yn are independent counts which follow a Poisson distribution with probability function µy e−µ f (y) = y! (a) Show that the Poisson distribution is a member of the exponential family, identifying the canonical parameter, θ, in terms of µ. (b) Write out the log likelihood function, `(µ). (c) Find a formula for the maximum likelihood estimator for θ in terms of the y’s. (d) Use the weak law of large numbers to show that ∂` (µ) ∂µ converges in probability to 0, as n → ∞. 1 (e) Show that ∂ 2` (µ) ∂µ2 converges in probability to −1/µ. (f) Identify the approximate large sample distribution of the maximum likelihood estimator for θ. 4. Suppose that y1 , . . . , yn are independent counts which follow Poisson distributions with probability function µj yj e−µj f (yj ) = yj ! and suppose x1 , x2 , . . . , xn are values of a covariate that has been measured in correspondence with the y’s. (a) Supposing the canonical link function is used, write out an equation which relates the expected value of yj to a linear function of xj . Do not include an intercept in the model. (b) Show that the maximum likelihood estimator for the coefficient (β) of x in the above model is the solution of n X (yj − eβxj )xj = 0. j=1 (c) On the other hand, show that one step of iteratively re-weighted least-squares, starting from a guess βbk is accomplished by the formula P βb k+1 =P xj yj? x2j eβbk xj where y ? = yj − eβbk xj + xj βbk eβbk xj . Hint: start from minimizing n X (yj − eβxj )2 j=1 eβbk xj with respect to β, remembering to Taylor expand eβxj about βbk before carrying out the minimization. 5. Consider the following output from the fitting of a generalized linear model to 9 independent observations on a response variable y and a predictor x. clotting.glm <- glm(y ~ x, family = Gamma(link = ’log’), data = clotting) summary(clotting.glm) ## ## ## ## ## ## ## ## Call: glm(formula = y ~ x, family = Gamma(link = "log"), data = clotting) Deviance Residuals: Min 1Q Median -0.39803 -0.31078 -0.18855 3Q 0.02734 2 Max 0.72388 ## ## ## ## ## ## ## ## ## ## ## ## ## ## Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.205057 0.232677 18.072 3.93e-07 *** x -0.016098 0.004578 -3.516 0.00977 ** --Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 (Dispersion parameter for Gamma family taken to be 0.185469) Null deviance: 3.5128 Residual deviance: 1.0642 AIC: 75.539 on 8 on 7 degrees of freedom degrees of freedom Number of Fisher Scoring iterations: 7 (a) On the basis of the output, write out the fitted model. (b) Is there strong evidence that the coefficient of x is nonzero? Explain. (c) Provide an estimate of the expected value of y when x = 50. (d) In order to answer the above questions, have you made any assumptions that would need to be checked? Explain. 3
© Copyright 2025 Paperzz