Random Number Generators

During a simulation, @RISK will generate a large number of random numbers. @RISK provides an array of random number generators (RNGs) that support this process. Each RNG has its own set of characteristics, as described below, but for almost all intents and purposes it is not necessary to change @RISK to use a different RNG than the default setting.

  • Mersenne Twister - This is the default generator in @RISK. For more information on its characteristics, visit http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html.
  • MRG32k3a - This is a robust generator from Pierre L’Ecuyer. For more information on its characteristics, visit http://www.iro.umontreal.ca/~lecuyer/myftp/papers/streams00s.pdf.
  • MWC - The MWC generator concatenates two 16-bit multiply-with-carry generators, x(n)=36969x(n-1)+carry, y(n)=18000y(n-1)+carry mod 2^16, has period about 2^60 and seems to pass all tests of randomness. A favorite stand-alone generator, it is faster than KISS.
  • KISS - The KISS generator (Keep It Simple Stupid) is designed to combine the two multiply-with-carry generators in MWC with the 3-shift register SHR3 and the congruential generator CONG, using addition and exclusive-or. Period about 2^123.
  • LFIB4 - A lagged Fibonacci generator: x(n)=x(n-r) op x(n-s), with the x values in a finite set over which there is a binary operation op, such as +,- on integers mod 2^32, * on odd such integers, xor on binary vectors.
  • SWB - SWB is a subtract-with-borrow generator developed to give a simple method for producing extremely long periods:
    x(n)=x(n-222)-x(n-237)- borrow mod 2^32
    The 'borrow' is 0, or set to 1 if computing x(n-1) caused overflow in 32-bit integer arithmetic. This generator has a very long period, 2^7098(2^480-1), about 2^7578. It seems to pass all tests of randomness, except for the birthday spacings test, which it fails badly, as do all lagged Fibonacci generators using +,- or xor.
  • KISS_SWB - KISS+SWB has period >2^7700 and is highly recommended. Subtract-with-borrow (SWB) has the same local behavior as lagged Fibonacci using +,-,xor- -- the borrow merely provides a much longer period. SWB fails the birthday spacings test, as do all lagged Fibonacci and other generators that merely combine two previous values by means of =,- or xor. Those failures are for a particular case: m=512 birthdays in a year of n=2^24 days. There are choices of m and n for which lags >1000 will also fail the test.
  • RAN3I - This is the RNG used in earlier versions of @RISK. It is based on a portable “subtractive” random number generator by Donald Knuth.

The MWC, KISS, LFIB4, SWB, and KISS+SWB generators are all from George Marsaglia at Florida State University. Visit http://www.lns.cornell.edu/spr/1999-01/msg0014148.html for more information.