[Rd] reproducing Box-Muller numbers

Prof Brian D Ripley ripley@stats.ox.ac.uk
Wed, 23 Feb 2000 07:48:10 +0000 (GMT)


On Tue, 22 Feb 2000, Paul Gilbert wrote:

> >Users are not expected to set .Random.seed directly, period. set.seed()
> >sets one of 2^32 separate seeds: why do you need more?
> 
> I've been using the same random numbers since R 0.49, the last time the uniform
> RNG was modified. Before that I was using the same numbers since R 0.16. There
> was considerable discussion when the change was made in 0.49 and it was agreed
> that in future there would be an effort to make the numbers reproducible. I
> certainly agree with improvements, but if you mess up reproducibility you are on
> a very slippery slope.

If you use set.seed and then run, there is reproducibility, It is *not*
messed up.  What is not guaranteed is that user manipulation of
.Random.seed will work unless you stick to the previous options.
There is 100% backwards compatibility.

> My tests set "Wichmann-Hill", and mostly set the seed to c(979,1479,1542), which
> I previously
> could do with set.seed, but that has changed in 0.99.

There was no set.seed prior to 0.99.0!  If you set the .Random.seed to
c(0,979,1479,1542), you will get the same results as before, but without
the warning that has been there for a year now that you needed the zero.

> >I presume the numbers you want
> >to reproduce were not standard R before?
> 
> I'm not sure what you mean by standard R before, but I have been using my own
> version of Box-Muller so that I can be sure to be able to work around changes in
> rnorm. I can still do that but for obvious reasons I would prefer not to post a
> library that takes control of that part of R.

So, no change. Anything you could do in 0.63.1 you can do in 0.99.0.
If you want to take advantage of the new facilities, you need to heed the
current documentation.


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