From ripley@stats.ox.ac.uk  Wed Feb 23 21:59:37 2000
From: ripley@stats.ox.ac.uk (Prof Brian D Ripley)
Date: Wed, 23 Feb 2000 21:59:37 +0000 (GMT)
Subject: [Rd] RNG usability
In-Reply-To: <38B447EE.704A311@bank-banque-canada.ca>
Message-ID: <Pine.GSO.4.05.10002232158560.24977-100000@auk.stats>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] RNG usability
Prof Brian D Ripley