That's a very good question. Issue filed:
https://github.com/JuliaLang/julia/issues/17918.

On Tue, Aug 9, 2016 at 6:02 AM, James Douglas <[email protected]> wrote:

> Hi All,
>
> I have a question about how Julia handles the seed given to the random
> number generator through the function srand(seed). I am doing Monte Carlo
> simulations using Julia, where I have some code that depends on the output
> from the rand() function and then I run this code with many different
> initial seeds. Naively I have set the seed specifically for each run of the
> code as the integer corresponding to the run, i.e., I run the code starting
> with srand(1), srand(2), etc. up to srand(N) for N runs. My primary
> motivation for this is that I would like to reproduce a particular run if I
> see anything strange. However, I recently saw that at least in C++ (
> http://www.pcg-random.org/posts/cpp-seeding-surprises.html), seeding the
> Mersenne Twister with integers like this is a bad idea. So I would like to
> know if there is a problem with seeding Julia's random number generator in
> this way? Will it bias my sample or does Julia somehow avoid this in the
> way it processes the seed given to srand()? And finally, if it is a bad
> idea, what would be the best way to seed so that I can reproduce everything
> at a later stage?
>
> Thanks in advance,
> James
>

Reply via email to