Central Limit Theorem for Exponential Distribution with R

Report 7 Downloads 62 Views
Central Limit Theorem for Exponential Distribution with R Karasmani Nikoletta 8/20/2016 Overview This project examines the Central Limit Theorem (CLT) for the distribuiton of means of exponentially distributed variables, using R. Our analysis begins with the simulation of the distribution of averages. The CLT is verified through three steps: 1. The mean of the distribution is compared to the theoretical mean. 2. The variance of the distribution is compared to the theoretical variance. 3. It is shown that the distribution of means approximates the normal distribution.

Central Limit Theorem The CLT states that the distribution of averages of a large number of independent and identically distributed (iid) variables will be approximately normal, regardless of the underlying distribution, in our case the exponential distribution. So, let X1 , X2 , ..., Xn the iid variables where Xi ∼ Exp(λ), i = 1, ..., n, n is the sample size and λ is the rate parameter. 1 λ

and the variance is σ 2 = V ar[Xi ] = ¯ ∼ N (µ, σ2 ) where X ¯ = Pn Xi . According to CLT, X i=1 n n The mean of Xi is µ = E[Xi ] =

1 λ2 .

Simulations The seed is set so that the results are reproducible in case of any code verification. The exponential distribution is simulated in R with the command rexp(n, lambda), where n is the sample size and lambda (denoted by λ) is the rate parameter. We do 1000 simulations of 40 exponentials1 with lambda set to 0.2 and store the mean of each of 1000 simulations in a vector. set.seed(1) # initialize variables nosim