liveBook · Manning

Poisson distribution

As explained in Grokking Statistics

The Poisson distribution is a discrete probability distribution for the number of events occurring in a fixed interval under a constant-rate independent-event assumption.

The Poisson distribution estimates how likely different event counts are within a fixed interval, such as views in one minute. Its parameter μ, also written λ, is the average number of events in that interval. section 3.9

Use the distribution to:

  • Estimate probabilities for specific counts, such as 0 through 20 views. section 3.9
  • Expect values near the average to be more likely; with μ = 10, 9 and 11 are plausible while 20 is unlikely. section 3.9
  • Treat sustained changes in the observed average as evidence that the underlying distribution may have changed. section 3.9

A video's views per minute

Suppose a new video averages 10 views per minute. scipy.stats.poisson.pmf can calculate the probability of each count, while matplotlib can display those probabilities as a bar chart. numpy.random.poisson can generate simulated counts; each run varies, as real event counts do. section 3.9

import numpy as np
from scipy.stats import poisson

mean = 10  #1

x = np.arange(0, 21, 1)  #2

y = poisson.pmf(x, mu=mean)  #3

for _x, _y in zip(x, y):  #4
    print(f"The probability of {_x} views within 1 minute is {_y:.4f}")  #5

Shows Python code that calculates probabilities for 0–20 views using scipy.stats.poisson.pmf. section 3.9

from numpy.random import poisson

sample = poisson(lam=10, size=20)

print(sample)

# Your answer will differ:
# array([ 8,  9, 12,  5,  7,  7, 13,  8, 13,  6, 11,
# 5,  9, 11,  4, 12, 12, 6, 10, 10])

Shows how NumPy generates simulated event counts from a Poisson distribution. section 3.9

How Grokking Statistics covers it

How deep it goes
Defines the distribution, interprets its average parameter, demonstrates probabilities and simulation, but does not derive the formula.
Examples
Uses YouTube views per minute, probability tables, bar charts, and generated NumPy samples.
What you can do after
Apply it via SciPy and NumPy to calculate probabilities and generate simulated event counts.
How it connects
Connects discrete probability distributions, exponential distributions, and Monte Carlo simulations.

Also explained in

Compare how 7 books explain Poisson distribution →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Statistics. The section links point to the parts of the book it draws on.