Random Number Generation

Following typical practices, we refer to pseudorandom number generation and generators more generically as random number generation and random number generators (RNGs).

surmise code uses exclusively the scipy.stats code to sample all random numbers and for performing typical statistical computations. At any point in time the code uses only a single user-provided scipy.stats-compatible RNG to sample random numbers. Therefore, before calling surmise code, users must use the set_RNG() function to provide surmise with an RNG that is valid for their version of scipy as well as correctly created and managed for their application. Note that where possible all surmise code should reproduce the same results when the same task is run with an identical RNG setup.

surmise.set_RNG(scipy_stats_rng)[source]

Prior to using any surmise functionality, users should call this function to provide surmise with a single pseudo-random number generator for use with their version of scipy.

Parameters:

scipy_stats_rng – RNG that all surmise code uses to sample random numbers with scipy.stats

Please refer to the RNG examples in the Jupyter book for guidance using RNGs with surmise.