Synopsis

The experiment simulates 1000 exponential distributions, plot the distribution of average of exponentials, obtain the sample mean and sample standard distribution and finially compare them with the expected mean and standard deviation.

1- In this simulation, the number of observations is 40. The rate parameter lambda is 0.2. The number of simulation is 1000.
2- According to the Central Limit Theorem, the arithmetic mean of a sufficiently large number of iterates of independent random variables, each with a well-defined expected value and finite variance, will be approximately normally distributed, regardless of the underlying distribution. So, we expect a normal distribution of mean of 40 exponentials.

Experiment Simulation

n=40; lambda=0.2;mns=NULL;
set.seed(521)
for (i in 1:1000) mns=c(mns,mean(rexp(n,lambda)))

Plot the histogram

1- There is a histogram of the distribution of the 40 exponentials’ mean, which is approximately normal.
2- There is also a density function plot for normal distribution with sample mean and sample standard deviation.

h<-hist(mns,xlab="the average of 40 exponentials",main="The histogram of average
        of 40 exponentials")
abline(v=mean(mns),col="red")
abline(v=5,col="blue")
legend("topright",c("Sample mean=4.984","Expected mean=5"),col=c("red","blue"),lwd=3)
xfit<-seq(min(mns),max(mns),length=1000)
yfit<-dnorm(xfit,mean=mean(mns),sd=sd(mns))
yfit<-yfit*diff(h$mids[1:2])*length(mns)
lines(xfit,yfit,col="red",lwd=3)

Compare the sample mean and expected mean

The mean of exponential distribution is 1/lambda, which is 5. So the expected mean of distribution is 5.

mean(mns)
## [1] 4.984376

The sample mean is 4.984.

Compare the sample and expected variance

1- Due that the variance of exponential is (1/lambda)^2=25, the expected sample variance is (1/lambda)^2/n=0.625
2- The Standard deviation of exponential distribution is 1/lamda, which is also 5. So the expected sample standard deviation is 5/(n^0.5), which is 0.791.

var(mns)
## [1] 0.6217492
sd(mns)
## [1] 0.7885107

1- The Sample variance is 0.622, which is very close to the expected variance 0.625.
2- The sample standard deviation is 0.789, which is very close to the expected standard deviation 0.791.