jeudi 14 février 2019

Can you replicate matlab's older pseudo-random number generators in python?

I am trying to analyze random streams of random numbers in python. Specifically I am studying the following pseudo-random streams from matlab: mt19937ar (the Mersenne Twister), mcg16807 (an LCG), and swb2712 (a modified subtract with borrow generator). Here is the reference page for matlab's PRNGs.

I know that the Mersenne Twister is the default generator for randomness used in python and I believe in numpy, mcg16807 should also be replicable since it's an LCG, but I am unsure of how to replicate swb2712 in python as it may be proprietary to matlab and I cannot find the source code. Is what I'm trying to do possible or should I just resort to using matlab and call it a day?




Aucun commentaire:

Enregistrer un commentaire