randomgen icon indicating copy to clipboard operation
randomgen copied to clipboard

Difference in .jumped() behavior between numpy and randomgen PCG64

Open gahtan-syarif opened this issue 1 year ago • 1 comments

It seems .jumped() when applied to PCG64 bitgenerator advances the state by different amounts when using numpy and randomgen's implementation. This is true even when numpy_seed parameter is set to True. Looking at numpy documentation and randomgen code it seems that numpy has a more sophisticated jump mechanism where it advances the state based on a value derived from the golden ratio to reduce correlation between streams, while randomgen jumps by multiples of 2^64. Now is this deviation from numpy's jump implementation intentional? Or is it possible to make randomgen's behavior the same as that of numpy's?

gahtan-syarif avatar Nov 15 '24 09:11 gahtan-syarif

I think that is right. I put the golden ratio in based on feedback from the PCG author. Forgot to backport it. Should update randomgen to match.

bashtage avatar Nov 15 '24 09:11 bashtage