The central limit theorem states that the distribution of averages are centered around the population mean and the standard deviation is close to the standard error of the mean. The goal of this study is to check if it holds true for the exponential distribution. To perform such an analysis, 1000 random exponentials were simulated using rexp function in R (n, lambda) and the distrubution of the averages were examined. The shape of the distribution of the averages look approximately normal with means close to the mean \(1/lambda\) and sd close to the \(1/(lambda*sqrt(n))\)
set.seed(100)
n<-40
nsim <- 1000
lambda<-0.2
exp_frame=data.frame()
for (i in 1:nsim){
exp_rvs<-rexp(n, lambda)
exp_rvs<-as.data.frame(t(exp_rvs))
exp_frame<-rbind(exp_frame, exp_rvs)
}
mean_exponentials<- apply(exp_frame, 1, mean)
mean(mean_exponentials)
## [1] 4.999702
sd(mean_exponentials)
## [1] 0.8020251
theoritical_mean <- 1/lambda
theoritical_mean
## [1] 5
sample_mean <- mean(mean_exponentials)
sample_mean
## [1] 4.999702
The theoritical mean of a exponential distribution is 5
The sample mean of the averages of the simulated exponential distribution is 4.9997019
We see that the sample means of the averages of the simulated exponential distribution are close to the theoritical expected mean of a exponential distribution as stated by the central limit theorem
theoritical_standard_error <- 1/(lambda * sqrt(n))
theoritical_variance <- theoritical_standard_error^2
theoritical_variance
## [1] 0.625
sample_sd <- sd(mean_exponentials)
sample_variance <- sample_sd^2
sample_variance
## [1] 0.6432442
The theoritical variance of the mean with 40 samples is of a exponential distribution is 0.625
The sample variance of the averages of the simulated exponential distribution is 0.6432442
We see that the sample variance of the averages of the simulated exponential distribution is close to the theoritical variance (square of the standard error of the mean of averages) of the exponential distribution as stated by the central limit theorem
The distribution of 1000 random exponentials looks like below:
hist(rexp(1000, lambda))
The distribution of averages of simulated random exponentials looks like below:
hist(mean_exponentials)
The shape of the distribution of the averages is approximately normal with the characteristic bell shape as shown by the histogram of the averages above.This distribution of averages looks far more Gaussian than the original exponential distribution!
Additionally, we plot the theoritical quantiles vs the sample quartiles to see if it falls approximately in a straight line.
qqnorm(mean_exponentials)
qqline(mean_exponentials)
According to central limit theorem, we see that mean of averages of exponential distribution follow approximately a normal distribution with means centered around the population mean and standard deviation close to the standard error of the mean.