For example, every cryptographically secure pseudo-random number generator (CSPRNG) is required to satisfy the next-bit test and withstand "state compromise extensions". This makes me wonder what properties must a RNG have to be used in a Monte Carlo simulation.

It appears that most people just use runif or sample.int in R, but are they really good enough? Please note that I expect the answer to be language-agnostic, as I might switch to C, Clojure or even SQL at some time.

I find this question interesting because such a RNG must be random enough to produce quality result, and at the same time not as CPU-expensive as CSPRNGs due to performance concerns.

  • $\begingroup$ In addition to Xi'an's observations, you might have a glance at section 4.2 of this paper. $\endgroup$
    – pjs
    Mar 10, 2019 at 23:54

1 Answer 1


Similar questions have been asked on X validated. Assuming they pass statistical tests of randomness, a main issue with RNGs in Monte Carlo simulation is their use in parallel computation, where special libraries must be used to prevent correlations between the threads. There are aso a few studies in the literature about the impact of dependencies in the RNGs, as in Murray and Elliott (2012), who report potential biases when using ran3 from Numerical Recipes and the baseline Unix drand48. The paper is discussed by Radford Neal in great details. See also this discussion of PCG on X validated.

As a side note, I attended a session at MCM 2017 in Montréal, where one talk was pointing out at discrepancies between GPU RNGs, although a toy experiment of mine did not reveal any on the banana target of Haario et al. (1999):

$\qquad\qquad$ enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.