Part 1: The exponential distribution can be simulated in R with rexp(n, lambda) where lambda is the rate parameter. The mean of exponential distribution is 1/lambda and the standard deviation is also also 1/lambda. Set lambda = 0.2 for all of the simulations. In this simulation, you will investigate the distribution of averages of 40 exponential(0.2)s. Note that you will need to do a thousand or so simulated averages of 40 exponentials.

Illustrate via simulation and associated explanatory text the properties of the distribution of the mean of 40 exponential(0.2)s.

Show where the distribution is centered at and compare it to the theoretical center of the distribution

For the first part we will run the simulation a hundred times.

The mean of the distribution is: 4.9498

This is the histogram which is using the ggplot2 library.

plot of chunk unnamed-chunk-2

As we can see from the histogram the distribution of the means is centered around 5 which is the theoretical center.

Show how variable it is and compare it to the theoretical variance of the distribution

The variance of the distribution is: 0.718

Since the theorical variance is supposed to be 5, the variance of the means obtained is much smaller than the theorical variance.

Show that the distribution is approximately normal

plot of chunk unnamed-chunk-3

From this Q-Q Plot we can observed that the distribution is well approximated.

Evaluate the coverage of the confidence interval for 1/lambda

After applying the equation mean ± S*1.96/sqrt(n), we obtained a confidence interval of about 93%.