Poisson Distribution

📊 Poisson Distribution in Python

The Poisson Distribution models the number of events occurring in a fixed interval of time or space, assuming the events happen independently at a constant rate.

It’s widely used in traffic flow, call center arrivals, and natural event counts.


 1. Characteristics of Poisson Distribution

  • λ (lam) → expected number of events per interval

  • size → number of random samples

  • Values are non-negative integers: 0,1,2,…

  • Probability Mass Function (PMF):

P(X=k)=e−λλkk!P(X=k) = \frac{e^{-\lambda} \lambda^k}{k!}

Where k=0,1,2,…k = 0,1,2,…


2. Generate Poisson Data Using NumPy


 

Output (example):

[5 4 3 7 6 5 2 6 4 5]

 3. Visualize Poisson Distribution


  • Peaks near λ

  • Discrete integer values


 4. Change λ to See Effect


 

  • Smaller λ → peak closer to 0

  • Larger λ → distribution spreads and peak moves right


5. Compute Mean and Variance


Theoretical property of Poisson:

  • Mean = Variance = λ


🎯 Practice Exercises

  1. Model number of calls per hour with λ=3 for 1000 hours.

  2. Generate Poisson data with λ=7 and plot histogram.

  3. Compare λ=2, λ=5, λ=10 in one plot.

You may also like...