I am doing a lot of Metropolis-Hastings Markov chain Monte Carlo (MCMC). Most codes I have in use, use Mersenne Twister (MT) as pseudo random number generator (PRNG).
However, I recently read, that MT is outdated and probably shouldn't be used anymore as it fails some tests and is relatively slow. So I am willing to switch.
Numpy now defaults to PCG (https://www.pcg-random.org/), which claims to be good. Other sites are rather critical. E.g. http://pcg.di.unimi.it/pcg.php. It seems everyone praises its own work.
There is some good information already here: Pseudo-random number generator But many answers are already a bit dated and I want to formulate my question a bit more specific.
As I said: the main use case is Metropolis-Hastings MCMC. Therefore, I need:
- uniformly distributed numbers in half-open and open intervals
- around 2^50 samples, apparently per rule of thumb the PRNG should have a period of at least 2^128
- sufficient quality of random numbers (whatever this might mean)
- a reasonable fast PRNG (for a fixed runtime faster code means more accuracy for MCMC)
I do not need
- cryptographically security
As I am by no means an expert, of course usability counts also. So I would welcome an available C++ implementation (this seems to be standard), which is sufficiently easy to use for the novice.
Aucun commentaire:
Enregistrer un commentaire