程序代写案例-MAST20005/MAST90058-Assignment 1

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
MAST20005/MAST90058: Assignment 1
Due date: 11am, Friday 27 August 2021
Instructions: See the LMS for the full instructions, including the submission pol
icy and how
to submit your assignment. Remember to submit early and often: multiple submission are
allowed, we will only mark your final one. Late submissions will receive zero marks.
Problems:
1. (R) In week 1 we did a ‘fun quiz’ to predict how long the border between NSW and
Victoria will be closed. The (anonymised) responses to this are in the file quiz.txt.
Please answer the following questions using the data in that file.
(a) Give basic descriptive statistics for these data and produce a box plot. Briefly
comment on the center, spread and shape of the distribution.
(b) Assuming a gamma distribution for these data, compute maximum likelihood esti-
mates for the parameters.
(c) Draw a density histogram and superimpose a pdf for a gamma distribution using
the estimated parameters.
(d) Draw a QQ plot to compare the data against the fitted gamma distribution. Include
a reference line. Comment on the fit of the model to the data.
2. A discrete random variable X has the following pmf:
x 1 2 3
p(x) θ2 2θ(1− θ) (1− θ)2
A random sample of size n = 20 produced the following observations:
1, 1, 2, 3, 1, 2, 1, 3, 2, 2, 2, 1, 3, 1, 3, 1, 1, 2, 1, 2.
For each of the following quantities, derive a general formula and, where applicable,
calculate it using the given data.
(a) i. Find E(X) and var(X).
ii. Find the method of moments estimator and estimate of θ.
iii. Find the standard error of this estimate.
(b) Let F1, F2 and F3 denote the sample frequencies of 1, 2 and 3, respectively.
i. Find the likelihood function in terms of F1, F2 and F3.
ii. Find that the maximum likelihood estimator and estimate of θ.
iii. Find the variance of this estimator.
(Hint: write the estimator in terms of the sample mean.)
3. Let X ∼ Unif(0, θ), a continuous uniform distribution with an unknown endpoint θ.
(a) Suppose we have a single observation on X.
i. Find the method of moments estimator (MME) for θ and derive its mean and
variance.
ii. Find the maximum likelihood estimator (MLE) for θ and derive its mean and
variance.
1
(b) The mean square error (MSE) of an estimator is defined as MSE(θˆ) = E
[(
θˆ − θ
)2]
.
i. Let bias(θˆ) = E(θˆ)− θ. Show that,
MSE(θˆ) = var(θˆ) + bias(θˆ)2.
ii. Compare the MME and MLE from above in terms of their mean square errors.
iii. Find an estimator with smaller MSE than either of the above estimators.
(c) Suppose we have a random sample of size n from X.
i. Find the MME and derive its mean, variance and MSE.
ii. Find the MLE and derive its mean, variance and MSE.
iii. Consider the estimator aθˆ where θˆ is the MLE. Find a that minimises the MSE.
Some information that might be useful:
E
(
X(1)
)
=
θ
n+ 1
, E
(
X2(1)
)
=
2θ2
(n+ 1)(n+ 2)
, E
(
X(n)
)
=

n+ 1
, E
(
X2(n)
)
=
nθ2
n+ 2
4. (R) We have a random sample of size 10 from a normal distribution. We wish to estimate
the population mean. Damjan suggests taking the average of the sample minimum and
sample maximum. Julia proposes using the sample median. Martina thinks we should
use the sample mean instead. Do a simulation in R to compare these three estimators
in terms of their bias and variance. Include a side-by-side boxplot that compares their
sampling distributions.
5. Let X1, X2, X3, X4 be iid rvs with E(Xi) = µ and var(Xi) = σ2 > 0, for i = 1, 2, 3, 4.
Consider the following four estimators of µ:
T1 =
1
3
(X1 +X2) +
1
6
(X3 +X4) T2 =
1
6
(X1 + 2X2 + 3X3 + 4X4)
T3 =
1
4
(X1 +X2 +X3 +X4) T4 =
1
3
(X1 +X2 +X3) +
1
4
X24
(a) Which of these estimates are unbiased? Show your working.
(b) Among the unbiased estimators, which one has the smallest variance?
2

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468