Verifying the Central Limit Theorem with R

We know the mean and variance of an exponential distribution are \frac{1}{\lambda} and \frac{1}{\lambda^2}.

Given \lambda = 0.2 and n = 40, this implies our mean should be \frac{1}{0.2} = 5 = \mu and variance \frac{1}{0.2^2} = 25 = \sigma^2.

In a given sampling distribution of the mean we expect the mean to remain the same, and the variance to be \frac{\sigma^2}{n} = 0.625 in this case in a distribution similar to N(\mu,\frac{\sigma^2}{n}).

Using the code found below, we produce a plot of the sample means for 1000 simulations:

We can clearly see the sample mean is very near our population mean 5, and the sample variance is also in line with predictions, being very close to 0.625. It is also clear from the plot that the distribution approximately resembles a Normal distribution, having a general bell shape.
The coverage of the confidence interval, \bar{X} \pm 1.96 \frac{S}{\sqrt{n}}, where S is sample Standard Deviation and n = 40,
using calculated values seen in the plot is 3.4453, 6.4867.

Leave a Reply

Your email address will not be published. Required fields are marked *