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
We know that the true value of is 6.
From the graph we can say the following
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. 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...