hw1_sol (3)

pdf

School

University of Illinois, Urbana Champaign *

*We aren’t endorsed by this school

Course

374

Subject

Statistics

Date

Feb 20, 2024

Type

pdf

Pages

4

Uploaded by DukeHornetMaster829

Report
STAT 426 Assignment 1 Due Wednesday, January 25, 11:59 pm. Submit through Moodle. Name: SOLUTIONS Netid: (insert) Submit your computational work both as an R markdown (*.Rmd) document and as a pdf, along with any files needed to run the code. Embed your answers to each problem in the document below after the question statement. If you have hand-written work, please scan or take pictures of it and include in a pdf file, ideally combined with your pdf output file from R Markdown. Be sure to show your work. Problem 1 (10 pts) An exam has 40 multiple choice questions. Each question has 5 choices for the answer, exactly one of which is correct. Suppose for each question a student guesses one of the answers at random. (a) (2 pts) Specify the distribution (type, parameter values) of the student’s number of correct answers. Answer: Let Y = number of correct answers. Then Y Binomial(40, 0.20). In other words, the total number of correct answers is a binomial random variable with n = 40 independent trials and success probability p = 1 / 5 = 0 . 20 for each trial. (b) (2 pts) Find the mean and standard deviation of the distribution in (a). Answer: μ = E ( Y ) = 40 * 0 . 20 = 8 . 0 σ = V ar ( Y ) = (40 * 0 . 20 * 0 . 80) = 6 . 4 = 2 . 53 . (c) (2 pts) Compute the probability that the student gets at least 15 correct answers. (Hint: the R function “pbinom” may be helpful) Answer: 1
We want P ( Y 15) = 1 - P ( Y 14) . The exact numerical calculation is as follows: 1 - pbinom ( 14 , size= 40 , prob= 0.20 ) ## [1] 0.007915854 (Partial credit for using the normal approximation instead) (d) (2 pts) Suppose for each question the choices are labeled 1, 2, 3, 4, and 5. Specify the distribution of ( n 1 , n 2 , n 3 , n 4 , n 5 ) , where n j is the number of questions for which the student selected choice j , for j = 1 , 2 , 3 , 4 , 5 (What kind of distribution, and what are the parameter values?). Answer: Each guess is a multinomial trial. Since each choice is equally likely and mutually exclusive the cell probabilities add to 1, so each equals 1 / 5 = 0 . 20 . Therefore ( n 1 , n 2 , n 3 , n 4 , n 5 ) Multinomial (40 , { 0 . 20 , 0 . 20 , 0 . 20 , 0 . 20 , 0 . 20 } ) . (e) (2 pts) Using formulas from the notes, find E ( n j ) , var ( n j ) , cov ( n j , n k ) and corr ( n j , n k ) for j = k . Answer: E ( n j ) = 40 * 0 . 20 = 8 var ( n j ) = 40 * 0 . 20 * 0 . 80 = 6 . 4 cov ( n j , n k ) = - 40 * 0 . 20 * 0 . 20 = - 1 . 6 corr ( n j , n k ) = cov ( n j , n k ) var ( n j ) var ( n k ) = - 1 . 6 6 . 4 = - 0 . 25 Problem 2 (10 pts) Let Y 1 , Y 2 , . . . , Y n be independent observations from the Poisson distribution with mean μ , which is unknown. Let Y = n i =1 Y i , and recall that this sum has a Poisson distribution with mean . (a) (2 pts) Given Y 1 , Y 2 , . . . , Y n , and under the model assumptions in (a), find mathematical expressions for the likelihood, ( μ ) and log-likelihood, L ( μ ) , simplifying the expressions as much as possible. Answer: 2
Because of independence, the joint probability mass function for Y 1 , Y 2 , . . . , Y n is n i =1 P ( Y i = y i ; μ ) = n i =1 e - μ μ y i y i ! = e - μ n i =1 y i n i =1 y i ! = e - μ n ¯ y n i =1 y i ! We can ignore the constant multiplier 1 / n i =1 y i ! , so the kernel of the likelihood is ( μ ) = e - μ n ¯ y . Applying the natural log to both sides gives L ( μ ) = n ¯ y log( μ ) - nμ. (b) (2 pts) Show that the maximum likelihood estimator is ˆ μ = ¯ Y = Y/n . Answer: The score function is ∂μ L ( μ ) = n ¯ Y μ - n = n ( ¯ Y - μ ) μ . Therefore, solving the likelihood equation 0 = ∂μ L ( μ ) μ μ = n ( ¯ Y - ˆ μ ) ˆ μ gives ˆ μ = ¯ Y = Y/n , where Y = n i =1 Y i . (c) (2 pts) Find an expression for the exact variance of ˆ μ . Answer: var μ ) = var ( ¯ Y ) = var ( Y/n ) = 1 n 2 var ( Y ) = 1 n 2 * = μ/n (d) (2 pts) Obtain the Fisher Information and use it to find the large sample (asymptotic) variance of ˆ μ . Is it the same as the variance in (c)? Answer: i ( μ ) = E - 2 2 μ L ( μ ) = E - ∂μ n ¯ Y μ - n = E n ¯ Y μ 2 = μ 2 = n μ So the asymptotic variance is 1 i ( μ ) = μ n , which equals the exact variance found above. 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
(e) (2 pts) Consider data consisting of the following counts: (6, 5, 9, 8, 12, 9, 8, 9, 6, 5). The model is that these are independent observations from the Poisson distribution with mean μ . Compute the p-value for a two-sided score test of the null hypothesis H 0 : μ = 5 . Answer: The score test is based on the statistic Z = u (5) i (5) = 10( ¯ Y - 5) 5 * 5 10 = 2( ¯ Y - 5) Now let’s calculate the sample mean, statistic and p-value (will use two methods): y <- c ( 6 , 5 , 9 , 8 , 12 , 9 , 8 , 9 , 6 , 5 ) z <- sqrt ( 2 ) * ( mean (y) - 5 ) pval.z <- 2 *pnorm ( -abs (z)) pval.zsq <- 1 - pchisq (z * z, 1 ) data.frame (z, pval.z, zsq= z * z, pval.zsq) ## z pval.z zsq pval.zsq ## 1 3.818377 0.0001343327 14.58 0.0001343327 So p-value = 0.000134 by either method. 4