Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

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 les 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 le, ideally combined with your pdf output le 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

σ =Var (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:

We want P (Y > 15) = 1 - P (Y s 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 (n1 , n2 , n3 , n4 , n5 ), where nj  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

(n1 , n2 , n3 , n4 , n5 ) ~ Multinomial(40, {0.20, 0.20, 0.20, 0.20, 0.20}).

(e) (2 pts) Using formulas from the notes, find E (nj ), var(nj ), cov(nj , nk ) and corr(nj , nk ) for j  k .

Answer:

E (nj ) = 40 * 0.20 = 8

var(nj ) = 40 * 0.20 * 0.80 = 6.4

cov(nj , nk ) = -40 * 0.20 * 0.20 = -1.6

corr(nj , nk ) =  =  = -0.25

Problem 2 (10 pts)

Let Y1 , Y2 , . . . , Yn  be independent observations from the Poisson distribution with mean µ , which is unknown. Let Y =     Yi , and recall that this sum has a Poisson distribution with mean nµ .

(a) (2 pts) Given Y1 , Y2 , . . . , Yn , and under the model assumptions in (a), find mathematical expressions for the likelihood, l(µ) and log-likelihood, L(µ), simplifying the expressions as much as possible.

Answer:

Because of independence, the joint probability mass function for Y1 , Y2 , . . . , Yn  is

i1 P (Yi  = yi ; µ) = i1   =  = 

We can ignore the constant multiplier 1/    yi !, so the kernel of the likelihood is

l(µ) = e nµ µny¯ .

Applying the natural log to both sides gives

L(µ) = ny¯log(µ) - nµ .

(b) (2 pts) Show that the maximum likelihood estimator is  =  = Y/n.

Answer:

The score function is                L(µ) = n - n = n( - µ)

Therefore, solving the likelihood equation

0 = L(µ)µ=  = 

gives  =  = Y/n, where Y =     Yi .

(c) (2 pts) Find an expression for the exact variance of  .

Answer:

var() = var() = var(Y/n) = var(Y) =  * nµ = µ/n

(d) (2 pts) Obtain the Fisher Information and use it to nd the large sample (asymptotic) variance of  . Is it the same as the variance in (c)?

Answer:

i(µ) = E - L(µ)\ = E -  - n\ = E \ =  =

So the asymptotic variance is

 =  ,

which equals the exact variance found above.

(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 H0  : µ = 5.

Answer:

The score test is based on the statistic

Z =  =10( *  =^2( - 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.