|
Format: VoseNegBin(s, p, U)
The Negative Binomial distribution estimates the number of failures there will be before s successes are achieved where there is a probability p of success with each trial. Examples of the Negative Binomial distribution are shown below:

The NegBin distribution has two applications for a binomial process:
The number of failures in order to achieve s successes = NegBin(s,p);
The number of failures there might have been when we have observed s successes = NegBin(s+1,p)
The first use is when we know that we will stop at the sth success. The second is when we only know that there had been a certain number of successes.
For example, a hospital has received a total of 17 people with a rare disease in the last month. The disease has a long incubation period. There have been no new admissions for this disease for a fair number of days. The hospital knows that people infected with this problem have a 65% chance of showing symptoms. It is also known that all people with symptoms will turn up at the hospital. They are worried about how many people there are infected in the outbreak who have not turned up in hospital and may therefore infect others. The answer is NegBin(17+1,65%). IF we knew (we don't) that the last person to be infected was symptomatic, the answer would be NegBin(17,65%). The total number infected would be 17+NegBin(17+1,65%).
The Negative Binomial distribution is frequently used in accident statistics and other Poisson processes because the Negative Binomial distribution can be derived as a Poisson random variable whose rate parameter lambda is itself random and Gamma distributed, i.e.:
Poisson(Gamma(a,b)) = NegBin(a, 1/(b+1))
The Negative Binomial distribution therefore also has applications in the insurance industry, where for example the rate at which people have accidents is affected by a random variable like the weather, or in marketing. This has a number of implications: it means that the Negative Binomial distribution must have a greater spread than a Poisson distribution with the same mean; and it means that if one attempts to fit frequencies of random events to a Poisson distribution but find the Poisson distribution too narrow, then a Negative Binomial can be tried and if that fits well, this suggests that the Poisson rate is not constant but random, and can be approximated by the corresponding Gamma distribution (see here ).
The Negative Binomial distribution is affected by the same restrictions as those described for the Geometric i.e. p remains constant and cannot be altered by knowledge or skill gained in the tries and the distribution assumes that as many tries will be made as are found necessary to achieve s successes: it makes no allowance for those who would cut their losses and give up. The Pascal distribution, or Binomial Waiting-Time distribution, is a Negative Binomial distribution shifted s units along the x-axis, i.e. a distribution that runs from s to infinity.
The NegBin is often a good approximation to the Inverse Hypergeometric (s<<D), and is itself sometimes approximated by a Normal (s large) or a Gamma distribution (p very small).
The Negative Binomial distribution gets its name because the equation that is produced from an expansion of the expression [Q-P]-s equates to its terms.
An alternative formulation of the Negative Binomial distribution has the distribution modeling the total number of trials to observe s successes (instead of total number of failures). In this formulation, the probability mass function is given by:

This video discusses the derivation of the standard
probability mass function for the Negative Binomial.
The Beta-Negative Binomial is an extension of the Negative Binomial distribution where there the probability p is itself a random variable.
When modeling or analyzing counting data, it is often desirable to modify probability of zero of the discrete distribution we use, to more accurately model the probability of "no event occurring". We can make two types of modifications to our distribution for this:
Zero-inflated model - we increase the probability of zero. (equations)
Zero-truncated model - we entirely remove the probability of zero events occurring. (equations)
See also: Zero-modified counting distributions
VoseNegBinom generates values from this distribution or calculates a percentile
VoseNegBinomObject constructs a distribution object for this distribution
VoseNegBinomProb returns the probability density or cumulative distribution function for this distribution
VoseNegBinomProb10 returns the log10 of the probability density or cumulative distribution function
VoseNegBinomFit generates values from this distribution fitted to data, or calculates a percentile from the fitted distribution
VoseNegBinomFitObject constructs a distribution object of this distribution fitted to data
VoseNegBinomFitP returns the parameters of this distribution fitted to data