关键词 > STAT3023/3923/4023

STAT3023/3923/4023: Statistical Inference Semester 2, 2022

发布时间:2022-09-19

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

Computer Lab Week 6

STAT3023/3923/4023: Statistical Inference

Semester 2, 2022

Report due Sunday 11:59 PM 18 September 2022. Submission instruction:

●  Please submit the report in HTML or PDF. The report has to be generated from Rmarkdown with all the codes embedded.

●  For the rst three questions, it is preferred that you type the solution from Rmarkdown, but you can also write them on the paper, scan it and submit as a separate le.

●  To make sure your code is replicable, set the seed for random number generation at the beginning of your code to be the last 5 digits of your student ID. Failure to do so will lead to a 10% deduction of your mark for this report.

Let X1 , . . . , Xn  be a random sample from a Poisson(λ) distribution. We will implement and compare three estimators for the parameter

θ = P (X = 0) = e λ .

We have seen the two following estimators in Question 3 of Tutorial 5:

●  The MLE estimator θˆMLE  = e , with  = n 1        Xi  being the MLE for λ .

●  The unbiased estimator θˆ2  = Y/n, where Y =      1(Xi  = 0) counts the number of zeros out of

the sample.

We will compare these two with the following estimator

θˆ3  = E (Y _ S) ,  S =       Xi .

1.  Recall that S =      Xi  _ Poisson(nλ).  Using a similar argument as in Question 2, Tutorial 2, show that the conditional distribution of (X1 , X2 . . . , Xn  _ S = s) is the multinomial distribution with s trials and cell probabilities (1/n, . . . , 1/n).

2.  Using the result from the previous question to show that, θˆ3  =  1 _ S .

3.  Show that the CRLB for estimating θ is given by n 1 λe 2λ .

4. In R, generate a random sample of size n = 50 that follows a Poisson(1) distribution, using rpois. Compute the true value of the parameter θ and three estimates for θ on the generated sample.

5.  Perform a loop to see how the three estimators perform over a range of λ values.  Following the same basic method as in the computer lab week 5, at each value of lbmdabNseq~,(  =(  lengt盖N已)|, generate aN=))) Poisson samples of size nN=) with that rate parameter.  Save the corresponding average squared errors for the three estimators.

6.  Plot the average squared errors of the three estimators as a function of λ on the same plot.  Dis- tinguishing these lines by using different colors or line types and adding appropriate legends. Out of the three estimators, which one does perform the worst?

7.  Excluding the estimator with the worst performance, plot the ratio of average squared errors of the two remaining estimators versus the CRLB as a function of λ on the same plot. Comment on the efficiency of the two estimators, and explain it.