Concept map / Poisson distribution
Share
The Poisson distribution
Vary the event rate and the window length, read cumulative probabilities, and check by simulation that a Poisson count's variance equals its mean.
1How many requests land in a window?
Requests reach a help desk at a steady average rate, each independent of the others. The number that arrive in a fixed window then has a Poisson distribution with mean λ, the rate times the window length. It is what a binomial count becomes when time is cut into many tiny slices, each with a small chance of an arrival.
At 2 requests per minute, how likely is a 2-minute window with 3 or fewer? Change the rate and the window, move the cut c, and simulate windows to compare their counts with the bars.
At 2.0 requests per minute over 2 minutes, the mean count is λ = 4.0. The chance of 3 or fewer requests is 43.3%. The variance also equals 4.0, so the standard deviation is 2.00.
More controls
2A window four times as long: how much more spread?
Requests arrive at 2 per minute. A 2-minute window has a mean count of 4. An 8-minute window has a mean count of 16, four times as many. Compared with the short window, how spread out is the count in the long window?
3One parameter for the mean and the variance
The Poisson distribution has one parameter, the mean count λ = rate × window length. That same λ is the variance, so a larger mean always brings a larger spread. Point at λ or k and the mean line or the cut bar in section 1 lights up.
Now: P(X = 3) = e−4.0 × 4.03 / 3! = 0.195, and adding the bars from 0 to 3 gives P(X ≤ 3) = 0.433. The 95th percentile of the count is 8.
4Check yourself
The tasks use the sliders and buttons in section 1 and tick themselves when you meet them.
- Find a rate and window where the chance of zero requests is below 1%.Now: λ = 4.0, P(X = 0) = 1.8%
- Set the cut to the smallest count c with P(X ≤ c) of at least 95%.Now: c = 3, P(X ≤ 3) = 43.3%
- Simulate at least 200 windows and get the sample variance within 10% of the sample mean.Now: no windows simulated yet
5Poisson counts in R
dpois() gives P(X = k), ppois() adds the bars up to a cut, and qpois() finds the smallest count whose cumulative probability reaches a target. At the page’s default λ = 4 the snippet prints 0.195 and 0.433, a 95th percentile of 8, and 200 simulated windows with mean 4.14 and variance 4.22.
Poisson counts in a windowShow the code
# 2 requests per minute over a 2-minute window
rate <- 2
minutes <- 2
lambda <- rate * minutes
# P(X = 3) and P(X <= 3), as on the page
round(c(exactly = dpois(3, lambda),
at_most = ppois(3, lambda)), 3)
# Smallest count c with P(X <= c) of at least 95%
qpois(0.95, lambda)
# Simulate 200 windows: mean and variance are both near 4
set.seed(4)
counts <- rpois(200, lambda)
round(c(mean = mean(counts), variance = var(counts)), 2)
# Quadrupling the mean doubles the standard deviation
round(sqrt(c(short = 4, long = 16)), 2)Uses base R only.
What one rate decides
- At a constant rate the mean count is λ = rate × window length, so doubling the window doubles the expected count.
- Counts start at 0 and have no upper limit. The chance of no events at all is e−λ, 1.8% at λ = 4.
- The variance equals the mean, so the standard deviation is √λ. Taking the mean from 4 to 16 only doubles the standard deviation, from 2 to 4.
- Counts that vary well beyond their mean are called overdispersed. The events cluster or the rate drifts, and a Poisson model understates the uncertainty. The waits between events of a constant-rate process are exponential.
- Reading errors in a passage and words recalled in a minute are often modeled as Poisson counts, as in Rasch’s Poisson model for reading errors. Real counts are often overdispersed, which leads to negative binomial and mixed-effects count models.
Recommended reading
- Introductory Statistics 2eBarbara Illowsky and Susan Dean§4.6, Poisson counts and rate