[R] Random Nos
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sat Feb 3 22:03:32 CET 2001
On 3 Feb 2001, Saptarshi The Dude Guha wrote:
> I know the algo for Laplace generation, but arent there any packages available.
It's one line in R! Or at least, one algorithm is, for there are many.
> Also, i'm trying to check for the Bernoulli sums obey the CLT, but though i calculate 2000 values of
> for p=.5 and n=45, this fails both KS test and shapiro test.
Maybe because the CLT is a limit for large n? Or maybe you did not use
the correct distribution theory for those tests? That for the KS test
applies to samples from a continuous distribution, and yours is quite
discrete. I'll leave you to look this up. The rate of divergence from
the CLT is known almost exactly in this case, and I suspect that the
distribution of the Smirnov statistic is too.
At its simplest, if you take a large enough sample you will reject
any null hypothesis outside the realm of theory. Even if you had
generated using rnorm() in R, the distribution is slightly non-normal
(and slightly non-independent between samples).
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help