0% found this document useful (0 votes)
7 views2 pages

1 Computation Questions: Homework #5

Uploaded by

1992714521
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

1 Computation Questions: Homework #5

Uploaded by

1992714521
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

STA2002: Probability and Statistics II Fall 2024

Homework #5
This is the homework for week 5. The due date is 11:59 p.m., October 20. Late submission will
automatically result in “0” grade. Please include codes for the program part in your submission.

1 Computation Questions
(Question1): (20 points)
For a public opinion poll for a close presidential election, let p denote the proportion of voters
who favor candidate A. How large a sample should be taken if we want the maximum error
of the estimate of p to be equal to
(a) 0.03 with approximate 95% confidence?
(b) 0.02 with approximate 95% confidence?
(c) 0.03 with approximate 90% confidence?
(d) Since we do not know p in practice, please provide a valid upper bound for the number
of samples in aforementioned problems which is independent of p. (Hint: you may use the
fact that
p p+1−p 1
p(1 − p) ≤ = .
2 2
)
(Question2): (30 points)
Suppose X1 , X2 , · · · , Xn are i.i.d. Poisson random variables with parameter λ, i.e.,

λk
P rob(X1 = k) = exp(−λ) for k ≥ 0.
k!
1 Pn
Recall the MLE for λ is n i=1 Xi .

(a) Derive the Fisher information.


(b) Provide a valid estimator for the Fisher information. You do not need to prove the
consistency of your estimator.
(c) Derive an 1 − α confidence interval for λ.
(d) Suppose we want the maximum error of the estimate of λ to equal 0.01 with approximate
95% confidence, determine the sample size. Your result can include λ.
(Question3): (30 points)
Suppose X1 , · · · , Xn are i.i.d. normal random variables following N (0, a) distribution (mean
0, variance a).
(a) Derive the maximum likelihood estimator for a.
(b) Derive the Fisher information.

1
(c) Provide a valid estimator for the Fisher information. You do not need to prove the
consistency of your estimator.
(d) Derive an 1 − α confidence interval for a.

2 Programming Questions
(20 points)
Implement the following experiment using Jupyter or R:
i. Generate X1 , · · · , Xn satisfying Bernoulli distribution with parameter p = 0.3 and n = 40.
ii. Plot the 95% confidence interval for p, i.e.,
" p p #
pb(1 − pb) pb(1 − pb)
pb − √ × z2.5% , pb − √ × z97.5% ,
n n

where zα is the α upper quantile of a standard normal random variable.


iii. Repeat step i and ii for 100 times, see how many confidence intervals cover the real p. Your
result should look like this

Please ignore the x–axis and y–axis scales of the figure, we just show what the result should look
like.

You might also like