Mersenne Twister

Mersenne Twister is a high quality random number generator. One of the many qualities is the huge period: 2^19937-1 (which incidently is a Mersenne prime.) I don’t see why one would use anything other than MT for all Monte Carlo simulations.

Recently I was brought to the attention of SFMT, which stands for SIMD-oriented Fast Mersenne Twister by the same folks. The authors claim it to be twice as fast as the original implementation. I remember using the implementation in AMD’s C Math Library: wonder how much faster this is compared to AMD’s.

A Monte Carlo engine I was writing for non-parametric statistical testing required upward of 40 million random numbers. I was happy to see that both Matlab as well as Python had native support for MT. I hope the faster version of MT is included with the next update to Python as it’s trivial to embed C code within Python.

Comments are closed.