Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Setting same seed, getting different random numbers.

From   Richard Gates <>
Subject   Re: st: Setting same seed, getting different random numbers.
Date   Fri, 02 Dec 2011 07:21:30 -0600

Patrick wrote:
> I encountered a strange problem. I tried running the same code on two
> different versions of Stata - one Stata/SE 12.0 on a server, and one
> Stata/SE 11.2 on my own computer. Both generate normal random numbers
> in mata with the same seed. But after a while the random numbers they
> generate differ! The code is as follows
> set seed 2
> mata
> f = rnormal(1000000,1,0,1)
> On the two machines, f[1,1] = .7005116833. But one one f[1000000,1] =
> -.5182349644, and on the other it is .7083750352.
> This strikes me as bizarre and impedes replication of my code across
> computers. Any ideas as to what's going on here?

We have been able to reproduce this issue.  We are looking into the cause, and
we will report back to statalist when we have more information.

Richard Gates
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index