[Numpy-discussion] Right behavior

Paul F Dubois paul at pfdubois.com
Sat Mar 30 19:02:04 CST 2002

About random number generation with Numeric:

a. IMHO, RNG is the right choice if you are picky about the quality of
the generator. This generator has a long history of heavy use.
RandomArray is in the core because someone put it there early, not
because it is the best. I do not claim to be an authority on this but
that is my understanding.

b. The suggestion made by one correspondent, that a generator should
generate and throw away one value when the seed is set, sounds correct
if viewed from the point of view of the initial set of a single stream.
But many users need multiple streams that are independent and
reproducible. This is done by saving the state of the generator and then
restoring it later. It is important that this save/restore not change
the results compared to not doing it. The presence or absence of another
computation, or frequency of dump/restarts, that require a save/restore,
must not affect the result. 

Thus a decision to throw away a result must come from the application

More information about the Numpy-discussion mailing list