Reliable and fast pseudo random number generator (PRNG) for Monte Carlo simulation in .net

I use Monte Carlo pseudo random number generators (PRNGs) that simulate a queue system. I use System.Random because it is fast, but found that it has some strange correlation between subsequent draws, which interferes with the results (this is no coincidence).

Now I use the Mersenne Twister (http://takel.jp/mt/MersenneTwister.cs), which (so far) has turned out to be random enough for my purposes. It is 50% slower, but it is the price that I am willing to pay to get reliable results.

What is the best PRNG for .net for Monte Carlo simulation? I am looking for a reliable PRNG that is not too slow.

+4
source share
1 answer

The Mersenne Twister is optimized for use with Monte Carlo simulations in multiple fields, so I will stick with this.

If performance is a problem and the parralell transition is not an option, I would go for the XORshift generator. A very good (fast) random number generator from Gerog Marsalya.

Here's paper :

This is probably the best choice if you need a good and fast PRNG for some monte carlo or other statistical simulations, but not for cryptography.

On this SO post you can find a very simple port in JAVA, but you should not rewrite it or find a C # implementation on the network.

+4
source

Source: https://habr.com/ru/post/1446173/


All Articles