RuiFilipeCampos / MontyCarlo

The Django of particle simulators.
https://ruicampos.org/projects/monty-carlo/
MIT License
9 stars 2 forks source link

`.tools.CubicInverseTransform` is using wrong pRNG. #27

Open RuiFilipeCampos opened 3 years ago

RuiFilipeCampos commented 3 years ago

https://github.com/RuiFilipeCampos/MontyCarlo/blob/224a821b4e84992928e22d31bbfed25f7db50393/MontyCarlo/tools/CubicInverseTransform.pyx#L234-L269

Using old pRNG.

RuiFilipeCampos commented 2 years ago

Currently using rand from std lib.

https://github.com/RuiFilipeCampos/MontyCarlo/blob/224a821b4e84992928e22d31bbfed25f7db50393/MontyCarlo/tools/CubicInverseTransform.pyx#L37

I'm inclined to believe that using two completely independent random number generators, using completely different algorithms, generating numbers that essentially do not interact, should not affect the results. Except for the part that the quality of the pRNG in stdlib does not compare to MIXMAX. It likely affects results in this way, but likely not in an catastrophic manner.

Regardless, MontyCarlo simulates billions of particles, so this change is important because stdlib prng will fail.

This change should be done after MVP and only when I decide on the final structure of MontyCarlo, otherwise it's just lost time compiling on a low level matrix from hell.