Question

SOLVE the following in R code:iid Let X1, , Xn ~ U (0,0). We are going to compare two estimators for θ: 01-2X, the method of moments estimator -maxX.... X1

0 0
Add a comment Improve this question Transcribed image text
Answer #1

# Answer to question 1: generating 50,000 samples of size 50 from U(0,5)

rm(list=ls())
df <- data.frame(matrix(ncol = 2, nrow = 0))
colnames(df) <- c("theta1", "theta2")
for(i in 1:50000){
df1 <- data.frame(matrix(ncol = 2, nrow = 1))
colnames(df1) <- c("theta1", "theta2")
X <- runif(50,0,5)
df1["theta1"] <- 2*mean(X)
df1["theta2"] <- max(X)
print(df1)
df <- rbind(df,df1)
}

theta1 <- df$theta1
theta2 <- df$theta2

# Answer to question 2: ploting histogram og theta1 and theta2

hist(theta1)
hist(theta2)

# Answer to question 3: Calculating Bias and Variance for theta1 and theta2
# Answer 3 (a)
Bias_theta1 <- mean(theta1)-5
Bias_theta2 <- mean(theta2)-5
# Answer 3 (b)
Variance_theta1 <- var(theta1)
Variance_theta2 <- var(theta2)
# Answer 3 (c)
MSE_theta1 <- Bias_theta1^2 + Variance_theta1
MSE_theta2 <- Bias_theta2^2 + Variance_theta2
  

# Answer to question 4 : theta2 should be preffered based on MSE

Add a comment
Know the answer?
Add Answer to:
SOLVE the following in R code: iid Let X1, , Xn ~ U (0,0). We are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 3. (06.31) Let X1, ... , Xn iid N (1,02), and let 5 =** -)...

    Problem 3. (06.31) Let X1, ... , Xn iid N (1,02), and let 5 =** -) denote an estimator of o2. Find the bias, variance, and mean-squared error of this estimator.

  • Let X1,X2,...,Xn be iid exponential random variables with unknown mean β. (b) Find the maximum likelihood...

    Let X1,X2,...,Xn be iid exponential random variables with unknown mean β. (b) Find the maximum likelihood estimator of β. (c) Determine whether the maximum likelihood estimator is unbiased for β. (d) Find the mean squared error of the maximum likelihood estimator of β. (e) Find the Cramer-Rao lower bound for the variances of unbiased estimators of β. (f) What is the UMVUE (uniformly minimum variance unbiased estimator) of β? What is your reason? (g) Determine the asymptotic distribution of the...

  • 6.4.3. Let X1, X2, ..., Xn be iid, each with the distribution having pdf f(x; 01,...

    6.4.3. Let X1, X2, ..., Xn be iid, each with the distribution having pdf f(x; 01, 02) = (1/02)e-(2–01)/02, 01 < x <ao, -20 < 02 < 0o, zero elsewhere. Find the maximum likelihood estimators of 01 and 02.

  • Let X1, . . . , Xn ∼ iid N(θ, σ^2 ), where σ^2 is known....

    Let X1, . . . , Xn ∼ iid N(θ, σ^2 ), where σ^2 is known. We wish to estimate φ = θ^2 . Find the MLE for φ and the UMVUE for φ. Then compare the bias and mean squared error's of the two estimators

  • Suppose that X1, X2,., Xn is an iid sample from the probability mass function (pmf) given...

    Suppose that X1, X2,., Xn is an iid sample from the probability mass function (pmf) given by (1 - 0)0r, 0,1,2, 0, otherwise, where 001 (a) Find the maximum likelihood estimator of θ. (b) Find the Cramer-Rao Lower Bound (CRLB) on the variance of unbiased estimators of Eo(X). Can this lower bound be attained? (c) Find the method of moments estimator of θ. (d) Put a beta(2,3) prior distribution on θ. Find the posterior mean. Treating this as a fre-...

  • 2. Let X1,..., Xn be i.i.d. according to a normal distribution N(u,02). (a) Get a sufficient...

    2. Let X1,..., Xn be i.i.d. according to a normal distribution N(u,02). (a) Get a sufficient statistic for u. Show your work. (b) Find the maximum likelihood estimator for u. (c) Show that the MLE in part (b) is an unbiased estimator for u. (d) Using Basu's theorem, prove that your MLE from before and sº, the sample variance, are independent. (Hint: use W; = X1-0 and (n-1)32)

  • Please give detailed steps. Thank you. 5. Let {X1, X2,..., Xn) denote a random sample of...

    Please give detailed steps. Thank you. 5. Let {X1, X2,..., Xn) denote a random sample of size N from a population d escribed by a random variable X. Let's denote the population mean of X by E(X) - u and its variance by Consider the following four estimators of the population mean μ : 3 (this is an example of an average using only part of the sample the last 3 observations) (this is an example of a weighted average)...

  • PROBLEM 3 Let X1, X2,L , X, be iid observations from a distribution with pdf given...

    PROBLEM 3 Let X1, X2,L , X, be iid observations from a distribution with pdf given by f(xl0)=0x0-, 0<x<1, 0<O<00. a) Find the maximum likelihood estimator of O. b) Find the moment estimator of 0. c) (Extra credit) Compare the mean squared error of the two estimators in (a) and (b). Which one is better? (5 points)

  • Let X1 , . . . , xn be n iid. random variables with distribution N (θ, θ) for some unknown θ > 0....

    Let X1 , . . . , xn be n iid. random variables with distribution N (θ, θ) for some unknown θ > 0. In the last homework, you have computed the maximum likelihood estimator θ for θ in terms of the sample averages of the linear and quadratic means, i.e. Xn and X,and applied the CLT and delta method to find its asymptotic variance. In this problem, you will compute the asymptotic variance of θ via the Fisher Information....

  • Consider X1,X2, , Xn be an iid random sample fron Unif(0.0). Let θ = (끄+1) Y where Y = max(X1, x...

    Consider X1,X2, , Xn be an iid random sample fron Unif(0.0). Let θ = (끄+1) Y where Y = max(X1, x. . . . , X.). It can be easily shown that the cdf of Y is h(y) = Prp.SH-()" 1. Prove that Y is a biased estimator of θ and write down the expression of the bias 2. Prove that θ is an unbiased estimator of θ. 3. Determine and write down the cdf of 0 4. Discuss why...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT