R代写-STAT8310
时间:2021-05-15
STAT8310
Statistical Theory
Assignment. Due: 10pm Thursday 20th May 2021
Questions require computation and simulation using numerical software. It is required to use the R language
to compute these quantities. You are encouraged to write your assignment using R Markdown or MS Word
and submit a PDF for this part. Additional material is available on iLearn that demonstrates how to use R
markdown. However using R markdown to create your assignment is not required.
You may discuss the assignment in the early stages with your fellow students. However, the assignment
submitted should be your own individual work.
The R Markdown ‘Cheatsheet’ from the RStudio team is given here.
Question 1
Let X =
(
X1 X2 · · · Xn
)T and Xi i.i.d∼ N (θ, 1). Define
Yi =
{
1 Xi > 0,
0, otherwise.
Let ψ = P (Y1 = 1).
a. Find the maximum likelihood estimator (MLE) ψˆ of ψ.
b. Find an approximate 95% confidence interval for ψ.
c. Define
ψ˜ = 1
n
n∑
i=1
Yi.
Show that ψ˜ is a consistent estimator of ψ.
d. Derive the efficiency of the estimator ψ˜ relative to ψˆ.
Hint: Use the Fisher information to get the standard error of the MLE.
e. Which estimator would you prefer? Provide a reason.
f. Suppose that the data are not really normal. Show that in this case ψˆ is not consistent. Demonstrate
this result by generating in R 1000 samples of size 100 from an exponential distribution Exp(λ = 1) and
computing the estimates.
Question 2
Suppose Y =
(
Y1 Y2 · · · Yn
)T is a random sample, where Yi are i.i.d. random variables with probability
function given by
fY (y) = θ(1− θ)y, y = 0, 1, 2, . . . ,
where 0 < θ < 1.
a. Write down the likelihood function and the log-likelihood function for θ.
b. Derive the maximum likelihood estimator (MLE) θˆ of θ.
1
c. Provide an approximate 95% confidence interval for θ using the asymptotic properties of the MLE θˆ.
d. In R, generate a sample of size 1000 from this distribution. Compute the estimates in parts b and c
(that is, the maximum likelihood estimate of θ and the confidence interval).
e. Compute the method of moments estimate of θ.
f. Compute the maximum likelihood estimate for the population mean. Justify.
Question 3
LetX =
(
X1 X2 · · · Xn
)T denote a random sample where Xi are i.i.d. random variables with probability
density function,
fX(x) =
{
1
θ , 0 < x < θ,
0, otherwise.
.
a. Find the distribution of θˆ = max{X1, · · · , Xn}.
Hint: For any c, P (θˆ < c) = P (X1 < c,X2 < c, · · · , Xn < c) = P (X1 < c)P (X2 < c) · · ·P (Xn < c).
b. in R, generate a data set of size 50 with θ = 1. Compute m = 1000 nonparametric bootstrap estimates
of θ using the MLE estimate. Construct a histogram from the nonparametric bootstraps.
c. Compute m = 1000 parametric bootstrap estimates of θ using the MLE estimates. Construct a
histogram from the parametric bootstraps.
d. Compare the true distribution of the θˆ to the histograms from the parametric and nonparametric
bootstraps in parts b and c.
e. Using your parametric and nonparametric bootstrap estimates in parts b and c, compute a bias, variance,
the mean square error measures and 95% bootstrap confidence intervals for θ.
f. This is a case where nonparametric bootstrap does very poorly. Show that for the parametric bootstrap
P (θˆ? = θˆ) = 0, but for the nonparametric bootstrap P (θˆ?? = θˆ) ≈ 0.632.
Hint: Show that, P (θˆ?? = θˆ) = 1− (1− (1/n))n then take the limit as n gets large.
2













































































学霸联盟


essay、essay代写