This answer provided a brief introduction on scipy.stats.norm.rv.
To seed this function, I did the following and got the following results.
>>> norm.rvs(size=10, random_state=12345)
array([-0.20470766, 0.47894334, -0.51943872, -0.5557303 , 1.96578057,
1.39340583, 0.09290788, 0.28174615, 0.76902257, 1.24643474]
Questions:
For NumPy v1.19, is this function using NumPy's
SeedSequenceor the legacy seeding algorithm to seed the generator? If the former, how do I pass thechild_seedsof theSeedSequenceto it?How do I get
scipy.stats.norm.rvto usenumpy.random.default_rng()or the BitGenerator (PCG64) instead of the MT19937 BitGenerator. According to NumPy's documentation, I understand thatRandomStaterefers to NumPy's Legacy Random Generation which is the MT19937 BitGenerator. I did the following and got an exception:>>> from scipy.stats import norm >>> from numpy.random import default_rng >>> rg = default_rng( 12345 ) >>> norm.rvs(size=10, random_state=rg) ValueError: Generator(PCG64) at 0x7F19E528D228 cannot be used to seed a numpy.random.RandomState instance