The negative binomial distribution
The negative binomial distribution, also called the Pascal distribution, generalizes the geometric distribution: it describes the number of independent trials needed to get r successes, each trial having the same probability of success p. How many free throws until the third basket? How many calls to close five sales? How many wells to drill before three strike oil?
The formulas
With X the number of trials needed for the r-th success:
- P(X = k) = C(k − 1, r − 1) × pʳ × (1 − p)^(k − r), for k ≥ r;
- P(X ≤ k) = probability of at least r successes in k trials, computed with the binomial distribution;
- mean r ÷ p, variance r(1 − p) ÷ p².
The term C(k − 1, r − 1) counts the ways to place the first r − 1 successes among the first k − 1 trials, since the last trial must be the r-th success.
Example
You need r = 3 successes, each trial succeeding with probability p = 0.4:
- third success exactly on trial 8: C(7, 2) × 0.4³ × 0.6⁵ = 21 × 0.064 × 0.0778 ≈ 0.105;
- three successes within 8 trials: ≈ 0.685;
- needing more than 8 trials: ≈ 0.315;
- mean of 7.5 trials, with 4.5 failures on average, and a variance of 11.25.
Two conventions
Some textbooks and software count the number of failures before the r-th success instead of trials. The two differ by r: failures = trials − r. Check which one your source uses. In R, for example, dnbinom counts failures.
Uses in statistics
Beyond waiting times, the negative binomial is the standard model for overdispersed count data: counts whose variance exceeds their mean, such as the number of doctor visits per person, accidents per driver or insects per plant. The Poisson distribution forces variance to equal the mean. The negative binomial adds a dispersion parameter, which is why negative binomial regression is widely used in epidemiology, ecology and insurance.
Related distributions
- With r = 1, the negative binomial reduces to the geometric distribution.
- The binomial distribution fixes the number of trials and counts successes; the negative binomial fixes the successes and counts trials.
- The sum of r independent geometric variables with the same p follows a negative binomial distribution.