From edd at debian.org  Sun Feb  8 15:33:26 2015
From: edd at debian.org (Dirk Eddelbuettel)
Date: Sun, 8 Feb 2015 08:33:26 -0600
Subject: [Rd] Which function can change RNG state?
In-Reply-To: <1423367536855-4702935.post@n4.nabble.com>
References: <1423367536855-4702935.post@n4.nabble.com>
Message-ID: <21719.29622.348898.779301@max.nulle.part>


On 7 February 2015 at 19:52, otoomet wrote:
| random numbers.   For instance, can I be sure that
| set.seed(0); print(runif(1)); print(rnorm(1))
| will always print the same numbers, also in the future version of R?  There

Yes, pretty much.

I've been lurking here over fifteen years, and while I am getting old and
forgetful I can remember exactly one such change where behaviour was changed,
and (one of the) generators was altered---if memory serves in the earlier
days of R 1.* days . [ Goes digging...] Yes, see `help(RNGkind)` which
details that R 1.7.0 made a change when "Buggy Kinderman-Ramage" was added as
the old value, and "Kinderman-Ramage" was repaired.  There once was a similar
fix in the very early days of the Mersenne-Twister which is why the GNU GSL
has two variants with suffixes _1998 and _1998.

So your issue seems like pilot error to me:  don't attach the parallel package
if you do not plan to work in parallel.  But "do if you do", and see its fine
vignette on how it provides you reproducibility for multiple RNG streams.

In general, you can very much trust R (and R Core) in these matters. 

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



[Rd] Which function can change RNG state?
Dirk Eddelbuettel