clt.ani {animation} | R Documentation |
First of all, a number of obs
observations are generated from a certain distribution for each variable Xi (i = 1, 2, ..., n), then the sample means are computed, and at last the density of these sample means is plotted as the sample size increases.
clt.ani(obs = 100, FUN = runif, control = ani.control(interval = 0.1), ...)
obs |
the number of sample points to be generated from the distribution |
FUN |
the function to generate n random numbers from a certain distribution |
control |
control parameters for the animation; see ani.control |
... |
other arguments passed to ani.control |
As long as the conditions of the Central Limit Theorem (CLT) are satisfied, the distribution of the sample mean will be approximate to the Normal distribution when the sample size n
is large enough no matter what is the original distribution. The largest sample size is defined by control$nmax
.
None.
Yihui Xie
E. L. Lehmann, Elements of Large-Sample Theory. Springer-Verlag, New York, 1999.
clt.ani() ## Not run: # HTML animation page ani.start() clt.ani(saveANI = TRUE, height = 500, width = 600) ani.stop() ## End(Not run) # other distributions: Chi-square with df = 5 f = function(n) rchisq(n, 5) clt.ani(FUN = f)