Question

R1. Now that youve seen both MME and MLE, we might begin comparing the two worlds. In class, we studied X Uni (0.0) and showed the MLE is θMLE max Xi. One can show the MME for this set up is all -2 . X. As seen in HW2, these estinators are RVs, and each will have its own (sampling) distribution. The sampling distribution gives a good sense of what types of values youll get from θ when you draw a random sample. Use the internet to learn how to create overlapping histograms in R. Then, on the same set of axes, make a red histogram that shows 10000 values of θΜΜΕ based on 10000 random samples of size 40, Next, overlay a green histogram that shows 10000 values of θΜΙΕ based on 10000 new random samples of size 40 Draw from the Unif(0,6) distribution. Include your code and a sketch of the overlapping histograms.R2. List a strength and a weakness of OIME based on what you see. Then, list a strength and a weakness of θMLE.

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

R code to get the histograms is below (all statements starting with # are comments)

#set the random seed
set.seed(123)

#set the sample size
n<-40
#set the number of samples
r<-10000
#draw n*r samples from uniform (0,6)
x<-runif(n*r,0,6)
#convert into a matrix of size rxn
x<-matrix(x,nrow=r,ncol=n)
#get r MME estimates of theta, which is 2*mean(x)
thetaMME<-2*apply(x,1,mean)

#draw a new n*r samples from uniform (0,6)
x<-runif(n*r,0,6)
#convert into a matrix of size rxn
x<-matrix(x,nrow=r,ncol=n)
#get r MLE estimates of theta, which is max(x)
thetaMLE<-apply(x,1,max)

#histograms
hist(thetaMME,col="red",ylim=c(0,5000),xlab=expression(hat(theta)),main="Histograms of MME and MLE estimates")
hist(thetaMLE,col="green",add=TRUE)
box()
legend("topleft",c("MME Estimates","MLE Estimates"),col=c("red","green"),lty=c(1,1),lwd=5)

#get this plot

Histograms of MME and MLE estimates -MME Estimates 1-MLE Estimates 4

We know that the true value of heta is 6.

From the graph we can say the following

θΜΜΕ

  • Strength. The mean of the histogram is around 6. Hence θΜΜΕ is an unbiased estimator of heta
  • Weakness: The spread of the histogram, (that is variance of the estimator) seems to be high. This means that a randomly selected sample of size 40 may give us an estimate which is far away from the true value of heta.

MLE

  • Strength: The spread of the estimates is lower than the estimates obtained using MME. That means given a sample of size 40, we are more likely to get a value close to the true value of heta
  • Weakness: The estimator is biased. The mean of the histogram is under estimated and is less than 6.
    • Of course we know that the unbiased estimator is n + 1 ー × maxx, where n is the sample size
Add a comment
Know the answer?
Add Answer to:
R1. Now that you've seen both MME and MLE, we might begin comparing the two worlds....
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
  • R1. Now that you've seen both MME and MLE, we might begin comparing the two worlds....

    R1. Now that you've seen both MME and MLE, we might begin comparing the two worlds. In class, we studied X Uni (0.0) and showed the MLE is aMLE = max Xi One can show the MME for this setup is θΜΜΕ 2 X. As seen in HW2, these estimators are RVs, and each will have its own (sampling) distribution. The sampling distribution gives a good sense of what types of values you'll get from θ when you draw a...

  • R1. Now that you've seen both MME and MLE, we might begin comparing the two worlds....

    R1. Now that you've seen both MME and MLE, we might begin comparing the two worlds. In class, we studied XUnif(0,0) and showed the MLE is OSILE-max Xi. One can show the MME for this setup is OMME -2 X. As seen in HW2, these estimators are RVs, and each will have its own (sampling) distribution. The sampling distribution gives a good sense of what types of values you'll get from θ when you draw a random sample. Use the...

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
ADVERTISEMENT