2. \"Proof that for Poisson samples X is better than S2 2.1 If X1., Xn is a samp
ID: 3337397 • Letter: 2
Question
2. "Proof that for Poisson samples X is better than S2 2.1 If X1., Xn is a sample from the Poisson(A) distribution, X and S2 are both unbiased estimators of . Use simulations to confirm this and use the variance selection criterion to decide which is a better estimator, by doing the following. 2.2 Generate 200000 random numbers from the Poisson(A 2) distribution and arrange them in a matrix with 10000 columns. Thus you have 10000 samples of size 20. 2.3 Compute the 10000 sample means and sample variances and store them in objects means and vars, respectively. 2.4 Compute the average of the 10000 sample means and the average of the 10000 sample variances. Report the two averages? Do they support the claim that they are unbiased for = 2? 2.5 Compute the sample variance of the 10000 sample means and the sample variance of the 10000 sample variances. Report the two variances. Which estimator of is preferable?Explanation / Answer
#2.2
sample=rpois(200000,2)
#Drawing a random sample from poisson with mean 2
sample_matrix=matrix(sample,nrow=20,ncol=10000)
#arranging the random variables in a matrix with 10000 colums.
#Thus we will have 10000 sample observations with sample size 20.
#2.3
means=double(10000)
vars=double(10000)
#Creating means and vars vector to store the 10000 sample means and variance
for(i in 1:10000)
{
means[i]=mean(sample_matrix[,i])
vars[i]=var(sample_matrix[,i])
}
# Calculating the 10000 sample means and sample variances
#2.4
avg_sample_mean=mean(means)
avg_sample_mean
avg_sample_variance=mean(vars)
avg_sample_variance
#Computing average of sample mean and average of sample variances
#avg_sample_mean=2.001855(may change if you run the code in your system)
#avg_sample_variance=2.004485(may change if you run the code in your system)
#as both the averages are coming out to be very close to 2
#it supports the claim that xbar and S^2 both are unbiased estimators of lamda
#2.5
# We have to calculate sample variances of the sample means ans sample variances.
sample_variance_sample_means=var(means)
sample_variance_sample_means
sample_variance_sample_variances=var(vars)
sample_variance_sample_variances
#sample_variance_sample_means=.1003708(may change if you run the code in your system)
#sample_variance_sample_variances=.5140968(may change if you run the code in your system)
# since sample_varriance of the sample mean is smaller than the sample variance of the sample variances
# we can say that sample mean is more preferable.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.