dimanche 31 mai 2020

What is the behavior of calling np.random.multinomial many times?

When called, np.random.multinomial and other sampling functions give a certain number of independent samples from the chosen probability distribution. For instance,

np.random.multinomial(20, [1/6.]*6, size=2)

represents throwing a die 20 times, and then 20 times again.

However, what happens if you call np.random.multinomial(1, [1/6.]*6, size=1) a thousand times in succession? Will I get a thousand independent die rolls, i.e. does np.random.multinomial guarantee independent samples and correct distributions between successive calls? Empirically, it looks like there is some significant correlation between calls. Is it better to reset np.random.RandomState before every call? This seems wrong somehow.




Aucun commentaire:

Enregistrer un commentaire