Alex Z
Alex Z

Reputation: 367

How to generate a size 1000 random number list according to Poisson distribution and with a fixed mean(size)?

I want to generate a size 1000 random number list according to Poisson distribution and with a fixed mean. Since the size is fixed to 1000, so the sum is also fixed. The first idea I get is to use numpy.random.Poisson(lambda,size), but it can not set a fixed mean for the list. So I am really confused.

Upvotes: 1

Views: 1023

Answers (1)

S. Pellegrino
S. Pellegrino

Reputation: 81

So in a Poisson distribution lambda is the mean and variance at the same time. And if you draw infinitely often you will see it is true.

What you are asking for is like expecting to roll a dice 10 times and get an average of 3.5 since thats the expected mean.

Nevertheless you could generate a list with numpy.random.poisson, check if the mean is what you want or draw another 1000 times and check again.

Upvotes: 1

Related Questions