[R] Tested Random Number Generator
Wolfgang Viechtbauer
wviechtb at s.psych.uiuc.edu
Thu Jun 12 04:10:40 CEST 2003
Dear All,
The editor of a journal to which I had submitted a publication asked
whether R has a "tested random number generator." My paper included
Monte Carlo simulations generating random normal and random chi-square
values.
help(rnorm) lists
Wichura, M. J. (1988) Algorithm AS 241: The Percentage Points of
the Normal Distribution. Applied Statistics, 37, 477-484.
as a reference, but this algorithm does not discuss the generation of
random values.
help(RNG) indicates that the "Mersenne-Twister" is the default random
number generator with reference:
Matsumoto, M. and Nishimura, T. (1998) Mersenne Twister: A
623-dimensionally equidistributed uniform pseudo-random number
generator, ACM Transactions on Modeling and Computer Simulation,
8, 3-30.
I looked at the paper, but essentially I have no expertise in assessing
whether this random number generator is "good" (which is probably a
tricky concept in the first place when dealing with RNGs). I have almost
blind faith in the developers of R (at least when it comes to something
so fundamental as a RNG) that I feel confident that it is good, but I
guess I need something more substantial at this point to back of my
beliefs! Any suggestions on how I can "show" (without having to go
through a separate study just to make this claim) that the RNG is
"tested"? Any references?
Also, I am a little uncertain about how R generates random observations
from various distributions, such as in rnorm() or rchisq(). Does it
generate random uniforms u ~ U(0,1) and then solve for x in F(x) = u)? I
would imagine that this is rather slow compared to other specialized
methods for various distributions. Any information on this would be
appreciated as well.
I guess some of this relates to the "Validation of R" discussion that
occured a while ago on this list, so this info could be of general
interest.
Thanks!
--
Wolfgang Viechtbauer
More information about the R-help
mailing list