samedi 11 avril 2020

Why the result of numpy.random.normal(0,1,N) doesn't add up to 0?

Why the result of numpy.random.normal(0,1,N) doesn't add up to 0? The actual mean of the generated distribution is not 0. I think it is not due to discretization because the offset of the mean from 0 doesn't seem to get smaller as N grows. I did try Ns that really challenge my machine. What am I missing?

I'm using it to generate a random noise to add to a simulated signal. I rely on the fact that the sum of all the noisy signal will approach the sum of only the signal because all the random values should add up to 0. Instead I get sum of signal plus the offset in the mean times the number of points.




Aucun commentaire:

Enregistrer un commentaire