Subject: Re: [boost] [Random] reproducing numbers generated by R.
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-08-05 16:32:07
Ronan Trépos wrote:
> For validity concerns, I'm trying to reproduce pseudo random numbers
> generated by the sofware R with boost::random library.
> The R default number generator is the Mersenne-Twister with period
> 2^19937 -1 .
> 1. In R I tried :
> > set.seed(13)
> > runif(1)
> 2. With boost I tried :
> boost::mt19937 rng(13);
> boost::uniform_01<boost::mt19937> zeroone(rng);
> std::cout << zeroone() << std::endl;
> Has someone already experienced that ? Is it possible to reproduce the
> same numbers ?
> Maybe the mismatch comes from the fact that generated integers are
> translated into [0;1)..
I don't think so. I think the difference is that R uses its own
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk