Negative binomial distribution
In probability theory and statistics, the negative binomial distribution, also called the Pascal distribution, is a discrete probability distribution. It models the number of failures that happen in a row of independent and identically distributed Bernoulli trials before a set, fixed number of successes, called r, occurs. Sometimes the roles are swapped, so the number of failures is fixed and the number of successes is modeled instead. For example, we can count rolling a 6 on a die as a success and any other number as a failure. We can then ask how many failed rolls will happen before the third success (r = 3). The number of failures in this case follows a negative binomial distribution.
Another way to look at it is to model the total number of trials instead of the failures. When the number of successes is fixed, the number of failures is random, because the total number of trials is random too. For example, the distribution can be used to model the number of days a certain machine works before it breaks down, where the number of breakdowns is set in advance.
The negative binomial distribution has a variance of μ/p, where p is the success probability of each Bernoulli trial. As failures become increasingly rare, the distribution becomes identical to the Poisson distribution. This makes it useful as an overdispersed alternative to the Poisson distribution, for example in a robust version of Poisson regression. In epidemiology, it has been used to model the spread of infectious diseases, where the number of new infections caused by each person may vary a lot from person to person and from place to place. It can also fit situations where events are positively correlated, which makes the variance larger than it would be if the events were independent, because of a positive covariance term.
The term "negative binomial" likely comes from the fact that a certain binomial coefficient appearing in the formula for the probability mass function of the distribution can be written more simply using negative numbers.
Definitions
Imagine a series of Bernoulli trials, where each trial has two possible results, called "success" and "failure." The chance of success on each trial is p, and the chance of failure is 1−p. We keep going until a set number r of successes has happened. The random number of failures we see along the way, X, follows the negative binomial distribution, written as X∼NB(r,p).
The chance of seeing exactly k failures can be worked out with a formula that uses a binomial coefficient. For real-valued r, the formula uses the gamma function. Some sources define the distribution a little differently, such as counting the total number of trials instead of the failures, or swapping the roles of successes and failures.
| X is counting... | Probability mass function | Formula | Alternate formula (using equivalent binomial) | Alternate formula (simplified using: n=k+r) | Support | |
|---|---|---|---|---|---|---|
| 1 | k failures, given r successes | f(k;r,p)≡Pr(X=k)= | (k+r−1k)pr(1−p)k | (k+r−1r−1)pr(1−p)k | (n−1k)pr(1−p)k | for k=0,1,2,… |
| 2 | n trials, given r successes | f(n;r,p)≡Pr(X=n)= | (n−1r−1)pr(1−p)n−r | (n−1n−r)pr(1−p)n−r | for n=r,r+1,r+2,… | |
| 3 | n trials, given r failures | f(n;r,p)≡Pr(X=n)= | (n−1r−1)pn−r(1−p)r | (n−1n−r)pn−r(1−p)r | (n−1k)pk(1−p)r | |
| 4 | k successes, given r failures | f(k;r,p)≡Pr(X=k)= | (k+r−1k)pk(1−p)r | (k+r−1r−1)pk(1−p)r | for k=0,1,2,… | |
| - | k successes, given n trials | f(k;n,p)≡Pr(X=k)= | This is the binomial distribution not the negative binomial: (nk)pk(1−p)n−k=(nn−k)pk(1−p)n−k=(nk)pk(1−p)r | for k=0,1,2,…,n | ||
Properties
The expected number of trials needed to get r successes is rp, so the expected number of failures is r(1 − p)/p. You can picture repeating the experiment many times and finding the average number of failures each time. The variance is r(1 − p)/p2 when counting failures before the r-th success, and rp/(1 − p)2 when counting successes before the r-th failure.
The distribution is linked to the binomial distribution, which is shown using Newton's binomial theorem and the binomial coefficient. The source also notes that r can be a non-whole number in the generalized form, though the sum is only a probability distribution when r is a whole number (integer). Adding two such distributions with the same p gives another one, so the distribution is infinitely divisible. Its probabilities and averages also follow recurrence relations, which are rules that connect each value to the one before it.
Related distributions
The negative binomial distribution is closely linked to several other distributions. The geometric distribution is a special case of it, and it is also a special case of the discrete phase-type distribution and the discrete compound Poisson distribution. When the stopping number becomes very large and the chance of success becomes close to one, the negative binomial converges to the Poisson distribution, which makes it a sturdy alternative to the Poisson. It can also be seen as a Poisson distribution whose rate is itself random and follows a gamma distribution, so it is a compound probability distribution. In this sense, it is the "inverse" of the binomial distribution. A sum of negative binomial values with the same chance of success is also negative binomial, and for large numbers of values, the result is close to a normal curve, as described by the central limit theorem. The distribution is infinitely divisible, meaning it can be split into smaller pieces that follow the same pattern.
The negative binomial can be written as a compound Poisson distribution, using independent and identically distributed random variables that follow a logarithmic series distribution. Its behavior can be studied with a probability generating function. It appears in a table alongside the hypergeometric distribution and the negative hypergeometric distribution, which are related counting patterns. The negative binomial, together with the Poisson and binomial distributions, belongs to the (a, b, 0) class of distributions, and all three are members of a natural exponential family.
Statistical inference
When an experiment keeps going until a set number of successes (r) is found, the number of failures (k) gives the most useful information for estimating the chance of success, p. The best unbiased estimate of p uses both r and k in a simple formula. This is called the minimum variance unbiased estimator, and the number of failures is the sufficient statistic for the experiment.
When r is known, the maximum likelihood estimate of p is also simple to write down, but it is a biased estimate. Its inverse is an unbiased estimate of 1/p. When r is also unknown, finding the best estimates is harder. The likelihood function for a set of independent, identically distributed observations leads to equations that cannot be solved exactly for r, involving the digamma function. Instead, a numerical method such as Newton's method or the expectation–maximization algorithm can be used to find an answer step by step, since there is no closed form solution.
The negative binomial distribution looks at a series of Bernoulli trials, which are yes-or-no tries where each try has the same chance of success. It describes how many successes happen before a set number of failures occurs. Its probability distribution is the same as that of the number of successes before the r-th failure in a Bernoulli process. For example, if we throw a die and count a 1 as a failure, the chance of success on each throw is 5/6. The number of successes before the third failure follows a negative binomial distribution. When there is only one failure, the result is a geometric distribution.
The distribution can also be used instead of the Poisson distribution for counting data. It works well when the variance of the data is larger than its average, a situation called overdispersed. The extra setting lets scientists adjust the spread of the results separately from the average. This is useful for counting North Atlantic tropical cyclones, or extratropical cyclones over Europe. It is also common in ecology and in studies of count data, where clustering in nature makes overdispersion common. In genetics, it helps with DNA and RNA sequence counts. In studies of infectious diseases, it models the number of secondary infections caused by one sick person better than the Poisson distribution. See Cumulants of some discrete probability distributions for more.
In physics, the negative binomial distribution has been the most effective statistical model for many counts in particle collision experiments. It has also been described as a scale-invariant property of matter, and it fits astronomical observations, such as the number of galaxies in a region of space. For fifty years after it was first seen in 1973, no one knew why it worked so well. In 2023, Scott V. Tezlaf showed, from first principles, that it comes from symmetries in the dynamical equations of a canonical ensemble of particles in Minkowski space. Its equations can be matched, one to one, with those for a relativistic current density of massive particles, which uses the mean square speed of the particles and the speed of light. A separate, rigorous proof also came through quantum mechanics using the Feynman path integral.
History
This distribution was first studied in 1713 by Pierre Remond de Montmort in his Essay d'analyse sur les jeux de hazard. He looked at the number of tries needed in an experiment to get a certain number of successes. It had been mentioned earlier by Pascal.

Quiz time!
5 questions about Negative binomial distribution
What does the negative binomial distribution count?
Keep exploring
This article is a child-friendly adaptation of the Wikipedia article on Negative binomial distribution, available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.