Curriculum
Course: NumPy
Login

Curriculum

NumPy

Text lesson

Difference Between Normal and Poisson Distribution

Normal distribution is continuous, while Poisson is discrete. However, like the binomial distribution, a large enough Poisson distribution will approximate a normal distribution with a specific mean and standard deviation.

Example

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot(random.normal(loc=50, scale=7, size=1000), hist=Falselabel=‘normal’)
sns.distplot(random.poisson(lam=50, size=1000), hist=Falselabel=‘poisson’)

plt.show()

Result

poisson2

Difference Between Binomial and Poisson Distribution

The binomial distribution has only two possible outcomes, while the Poisson distribution can have unlimited outcomes. However, when n is very large and p is near zero, the binomial distribution closely resembles the Poisson distribution, where n * p is approximately equal to λ.

Example

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot(random.binomial(n=1000, p=0.01, size=1000), hist=Falselabel=‘binomial’)
sns.distplot(random.poisson(lam=10, size=1000), hist=Falselabel=‘poisson’)

plt.show()

Result

poisson4