In: Statistics and Probability
Draw 1000 samples of size 10, 25, 40 from exponential distribution with mean 10 and threshold 0 and calculate mean for each sample. Now produce histogram for sample mean.
a. What do you notice in the shape of the distribution of sample mean as sample size increases? Also, what changes in the standard error of the sample mean?
b. As the sample size increases , the sample mean goes to what number?
The user-defined function 'simulation' draws 1000 samples of specified size n from the given distribution
Explanation:
1) Drawn sample
The commands s1[[1]] gives the matrix of order n*1000, where n is the sample size, n= 10, 25, 40
Its first column has first sample of size n, second column has second the second sample of size n, so on till column number 1000.
2) Mean of the samples
The command head(s1[[2]]), head(s2[[2]]) and head(s3[[2]]) give the first 6 sample means out of the n sample means, n= 10, 25, 40.
3) The histograms are as follows:
(a) As the sample size increases, the shape of the distribution of the Sample Mean becomes more and more symmetric.
In the code, th evariables std_error1, std_error2 and std_error3 give the standard error of the distribution of the sample means. These are more or less similar. Thus the standard error doesn't change much. This was also tried for sample of size 100 and it turned out to be 0.3007.
(b) As the sample size increases, the sample mean tends to 10, which is also the population mean.
This indicates that sample mean is an unbiased estimator of the population mean.
Hope hthis helps. Please leave back any comment.