[Rd] RNG usability

Prof Brian D Ripley ripley@stats.ox.ac.uk
Wed, 23 Feb 2000 21:59:37 +0000 (GMT)


On Wed, 23 Feb 2000, Paul Gilbert wrote:

> >It does not
> >necessarily save the state of other generators, and in particular
> >does not save the state of the Box-Muller normal generator.
> 
> I thought Box-Muller just transformations uniform numbers? Does its
> state just refer to whether an even or odd number of numbers have been
> produced, and in the later case keep the last one for using the next
> time?

Yes.

> >If you want to reproduce work later, call `set.seed' rather than set
> `.Random.seed'.
> 
> But then I'm back to the original problem (which fortunately does not
> seem to be a problem for the uniform generator): Using B-M for rnorm I
> can't query the state at any given time and then reliably reset to that
> state?

Yes. So use a more reliable option for norm_rand.


-- 
Brian D. Ripley,                  ripley@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-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._