Discrete distribution · also called ZIP
Zero-inflated Poisson distribution
Counts with more zeros than a Poisson allows, because some units can never produce an event: cigarettes smoked per day when many people do not smoke, insurance claims when some policies are never used, purchases per visitor when most visitors only browse. With probability the count is a "structural" zero; otherwise it is Poisson(), which can also be zero.
Zero-inflated Poisson probability calculator
P(X ≤ 3) = 0.603429
At the parameters set by the sliders. The shaded region on the plot is the probability; the dots on the CDF mark F at its ends. For a discrete distribution, < and ≤ differ.
PMF
CDF
mean 2.8 · variance 6.16 · sd 2.482
Formulas
| Parameters |
|
|---|---|
| Support | |
| PMF | |
| CDF | |
| Mean | |
| Variance | |
| MGF |
The variance exceeds the mean whenever . The mean of the counts is not : it is shrunk by the share of structural zeros. A hurdle model is the related alternative in which all zeros come from one process and the positive counts from a zero-truncated distribution.
Worked example
On a shop's website 40% of visitors only browse and never buy; the others buy a Poisson(2) number of items. What fraction of visitors buy nothing?
A plain Poisson with the same mean, , would put only at zero. answer checked by code
How it relates to others
- Special case→ Poisson: A zero-inflated Poisson with is Poisson(). checked by code
- Mixture← Poisson: Mixing Poisson() with weight and a point mass at 0 with weight gives the zero-inflated Poisson(). checked by code
All the relationships, as a diagram →
In Python
import numpy as np
rng = np.random.default_rng(0)
from scipy import stats
pi, lam = 0.3, 4
def pmf(k):
return pi * (k == 0) + (1 - pi) * stats.poisson.pmf(k, lam)
np.where(rng.random(size=10) < pi, 0, rng.poisson(lam=lam, size=10))SciPy has no ready-made version of this distribution, so this samples it directly. pmf(0) is π + (1 − π)e^{−λ}; for the CDF, add π to (1 − π) × stats.poisson.cdf.
Choosing between this and its neighbours? Which distribution for count data?