R-code( Debugged with comments included)
#Random numbers
tmme=c()
tmle=c()
#Generating the Method of Moments estimator and Maximum Likelihood Estimator
for (i in 1:10000)
{
s<-runif(40,min = 0,max=6)
tmme[i]=2*mean(s)
tmle[i]=max(s)
}
# Histogram Colored (red and green)
hist(tmme, col="red",main="Overlapping Histogram",
xlab="Estimates of theta")
hist(tmle, col="green",xlim=c(0,10),add=T)
legend("topright",c("MLE","MME"),col=c("green","red"),lty=c(1,1))
box()
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 θ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 you'll get from θ when you draw...
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...