2
$\begingroup$

I have a small application of the central limit theorem:

"Take a sample of 40 exponentially distributed random numbers and calculate their mean. Repeat 1000 times, record each measured mean and calculate the mean of those 1000 means."

Here's my Rcode:

nsim   = 1000
nsamp  = 40
lambda = 0.2

clt <- data.frame(m=numeric(nsim), s=numeric(nsim))

for(s in 1:nsim)
{
    clt$v[s] <- mean(rexp(nsamp, lambda))
    clt$s[s] <- sd(rexp(nsamp, lambda))
}   

cat(mean(clt$v), "\n")
    cat(mean(clt$s), "\n")

I can observe that with increasing number of simulations (i.e. increasing the repetitions of the sampling event), the mean of means and mean of variance more closely agree with the theoretical values (1/lambda).

What I wonder is, does the Central-limit theorem only depend on the number of sampling events (1000) or is it just as much dependent on sufficiently large sample size (i.e. 40 in this example)?

$\endgroup$
  • 1
    $\begingroup$ What, in you own words, does the CLT actually say? You might enjoy reading some of our higher-voted threads on the CLT. $\endgroup$ – whuber Jan 18 '15 at 16:34
  • $\begingroup$ I don't see the Central Limit Theorem here, only the Law of Large Numbers. $\endgroup$ – Alecos Papadopoulos Feb 22 '17 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.