You are on page 1of 3

Comprobation of the Central Limit Theorem via

Simulation
Javier Santibaez
Friday, December 19, 2014
Summary
In this work we verify the Central Limit Theorem via simulation. We use 1000 rendom samples of size 40
from an Exp(0.2) distribution. We found that the sample means are centered so close to the theoretical
value, and have a variability very similar to the theoretical. Finally, we can verify normality with some minor
deviations.

Introduction
The exponential distribution has many applications in science and industry, it is used to model life times. A
random variable X has a exponential distribution with rata if the density function of X is
f (x) =

1 x/
e

and it is denoted as X Exp(). So, if X Exp(), it is easy to show that E[X] = 1/ and V ar(X) = 1/2 .
If we take a random sample of size n = 40 from an Exp(0.2) distribution, then the Central Limit Theorem
says that thepmean of that sample will have aproximately a normal distribution with = 1/0.2 = 5 y
= (1/0.2)/ (40) = 0.79.
In this work we adress the following facts:
1. Show where the distribution is centered at and compare it to the theoretical center of the distribution.
2. Show how variable it is and compare it to the theoretical variance of the distribution.
3. Show that the distribution is approximately normal.

Methodology
For this analysis we use the statictical package R. We simulated 1000 samples of size 40 from a exponential
random variable with = 0.2. We used the following code
set.seed(190991)
samples<-NULL
for (i in 1:1000)
{
samples<-rbind(samples,rexp(40,0.2))
}
means<-apply(samples,1,mean)
To prove normality we use a quantile-quantile, via the function qqnorm. If the data has a normal distribution,
then there will be placed along a streight line.
1

Results
Show where the distribution is located and compare it with the theoretical value.
The distribution is centered at 5.0033306, and the theroretical mean value is 5. We can see that there is
an insignificant difference between these two values. The histograms of means from the 1000 samples is the
following:
hist(means,col="steelblue")
abline(v=5,col="red",lwd=3)
abline(v=mean(samples),col="orange",lwd=3,lty=2)
legend("topright",legend=c("Sample","Theoric"),col=c("red","orange"),lwd=5)
box()

50

150

Sample
Theoric

Frequency

Histogram of means

means

Show how variable it is and compare it to the theoretical variance of the distribution.
To analyze the variability we compute a standard deviation of 0.8180943, and the theoretical value is 0.7905694,
the difference between these values is insignificant.
Show that the distribution is approximately normal.
Finally, to verify normality we make a QQ-plot of the data. The qqplot for our sample means is:
qqnorm(means,pch=16,cex=0.5)
qqline(means,col="red",lwd=2)

7
6
5
4
3

Sample Quantiles

Normal QQ Plot

Theoretical Quantiles
From the previous plot we con coclude that the data has approximately a normal distribution. There are
some deviations from normality at both tails, but wehave to remember that the CLT establishes a normal
distribution for n > 30, and for strongly asymmetric distribution n could be greater.

Conclusions
With the preceding results we can vertiy that:
The sample means are centered so close to the theoretical value.
The variability of the sample means is very similar to the theoretical one.
The distribution of the sample means is approximately normal, with some minor deviations, mainly
due to the sample size.

You might also like