Howard Tsang
May 28, 2017
This ShinyApp illustrate how the distribution of sample means becomes Gaussian with increasing sample size (n).
The arithmetic mean of a sufficiently large number of iterates of independent random variables, each with a well-defined (finite) expected value and finite variance, will be approximately normally distributed, regardless of the underlying distribution.
par(mfrow=c(2,2),mar=c(4,6,4,1), font.main=1)
curve(dnorm(x,0,1),xlim=c(-3,3),main='Normal Distribution')
curve(dunif(x,0,1,log = FALSE),xlim=c(0,1),main='Uniform Distribution')
curve(dlnorm(x, meanlog = 0, sdlog = 1, log = FALSE),xlim=c(0,4),main='Log-normal Distribution')
curve(dexp(x, rate = 1, log = FALSE),xlim=c(0,4),main='Exponential Distribution')Larger the size of sample, lower the standard deviation of the sample means.
Each sample drawing will generate one sample mean.