[Numpy-discussion] On the quality of the numpy.random.normal() distribution

Pauli Virtanen pav@iki...
Wed Dec 10 13:23:00 CST 2008


Wed, 10 Dec 2008 14:03:39 -0500, Michael Gilbert wrote:
>  I have been reading that there may be potential issues with the
>  Box-Muller transform, which is used by the numpy.random.normal()
>  function.  Supposedly, since f*x1 and f*x2 are not independent
>  variables, then the individual elements (corresponding to f*x1 and f*x2
>  ) of the distribution also won't be independent.  For example, see
>  "Stochastic Simulation" by Ripley, pages 54-59, where the random values
>  end up distributed on a spiral.  Note that they mention that they only
>  looked at "congruential generators."  Is the random number generator
>  used by numpy congruential?

I'm not an expert, but the generator used by Numpy is the Mersenne 
twister, which should be quite good for many uses. I'd guess what you 
mention is a way to illustrate that the output of linear congruental 
generators has serial correlations. At least according to wikipedia, 
these are negligible in Mersenne twister's output.

-- 
Pauli Virtanen



More information about the Numpy-discussion mailing list