[R] unexpected behaviour of rnorm()

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue Nov 26 23:04:02 CET 2002


That's the maximum of 5000 normals, right?  That's pushing the accuracy of
some internal calculations too hard.

If you want to do this, you should use

RNGkind(, "Inversion")

That's not the default for back-compatibility reasons.

On Wed, 27 Nov 2002, Robin Hankin wrote:

> Hello everyone.
>
> If I do
>
> f <- function(n){max(rnorm(n))}
> plot(sapply(rep(5000,4000),f))   #[this takes my PC about 30 seconds]
>
> then I get something quite unexpected: gaps in the distribution.  For
> me, the most noticable one is at about 3.6.
>
> Do others get this?  Is it an optical illusion?  It can't be right,
> can it?  Or maybe I just don't understand the good ol' Gaussian very
> well.
>
> anyone got an explanation?
>
>
> [linux redhat 7.1; R-1.6.1]
>
>
>
> --
>
> Robin Hankin, Lecturer,
> School of Geography and Environmental Science
> Tamaki Campus
> Private Bag 92019 Auckland
> New Zealand
>
> r.hankin at auckland.ac.nz
> tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042
>
> as of: Wed Nov 27 09:15:00 NZDT 2002
> This (linux) system up continuously for:  454 days, 14 hours, 57 minutes
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
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 mailing list