This report is for first part of the course project of the Coursera course “Statistical Inference” which is a part of specialization “Data Science”. In this first part, we perform simulation exercises using exponential distributions. Simulations
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 1/lambda. For these simulations, we set lambda to 0.2. We investigate the distribution of averages of 40 exponentials. For this purpose, we perform a thousand or so simulated averages of 40 exponentials.
## [1] 4.971972
## [1] 5
Therefore, the center of distribution of averages of 40 exponentials is close to the theoretical center of the distribution.
## [1] 0.7716456
## [1] 0.7905694
Therefore, the variability in distribution of averages of 40 exponentials is close to the theoretical variance of the distribution.
As evident from the Q-Q plot, the distribution of averages of 40 exponentials is very close to a normal distribution.
## [1] 3.459547 6.484397
Since, we consider the distribution of averages of exponentials, the standard deviation of this distribution already incorporates the \(\sqrt{n}\) term i.e. it is the standard error.
The confidence interval is given by [3.460, 6.484].