Showing content from http://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html below:
NegativeBinomialDistribution—Wolfram Language Documentation
WOLFRAM Consulting & Solutions
We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
- Data & Computational Intelligence
- Model-Based Design
- Algorithm Development
- Wolfram|Alpha for Business
- Blockchain Technology
- Education Technology
- Quantum Computation
WolframConsulting.com
BUILT-IN SYMBOL
NegativeBinomialDistribution Details Background & Context
- NegativeBinomialDistribution[n,p] represents a discrete statistical distribution defined for integer values and determined by the positive real parameters n and p (where ). The negative binomial distribution has a probability density function (PDF) that is discrete and unimodal. Depending on context, the Pascal and Pólya–Aeppli distributions (PascalDistribution and PolyaAeppliDistribution, respectively) may each be referred to as negative binomial distributions, though each is distinct from the negative binomial distribution discussed above.
- When n is a positive integer, NegativeBinomialDistribution[n,p] gives the distribution of the number of failures in a sequence of trials with success probability p before n successes occur. This is closely related to the Pascal distribution (PascalDistribution) and dates back to Pascal's work in the 17century. For noninteger parameter n, the negative binomial distribution is also known as the Pólya distribution. For general n, several distributions dating to the 1940s have been proposed and referred to as negative binomial distributions, though the above-stated NegativeBinomialDistribution (which was proposed considerably later) is the most widely used in modern applications. The negative binomial distribution has played an increasingly significant role in probability and stochastics since the 1990s and has also been used to model phenomena including accident statistics, birth-and-death processes, consumer expenditure, biometrics, and retail inventory management.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a negative binomial distribution. Distributed[x,NegativeBinomialDistribution[n,p]] , written more concisely as xNegativeBinomialDistribution[n,p], can be used to assert that a random variable x is distributed according to a negative binomial distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
- The probability density and cumulative distribution functions for negative binomial distributions may be given using PDF[NegativeBinomialDistribution[n,p]] and CDF[NegativeBinomialDistribution[n,p]]. The mean, median, variance, covariance, raw moments, and central moments may be computed using Mean, Median, Variance, Covariance, Moment, and CentralMoment, respectively.
- DistributionFitTest can be used to test if a given dataset is consistent with a negative binomial distribution, EstimatedDistribution to estimate a negative binomial parametric distribution from given data, and FindDistributionParameters to fit data to a negative binomial distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic negative binomial distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic negative binomial distribution.
- TransformedDistribution can be used to represent a transformed negative binomial distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a negative binomial distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving negative binomial distributions.
- NegativeBinomialDistribution is related to a number of other distributions. It is a univariate case of the more general NegativeMultinomialDistribution in the sense that the PDF of NegativeBinomialDistribution[n,p] with respect to a variable x is precisely the same as that of NegativeMultinomialDistribution[n,{1-p}] written in terms of the vector {x}. NegativeBinomialDistribution[1,p] is identically GeometricDistribution[p], while NegativeBinomialDistribution can be obtained as a transformed distribution (TransformedDistribution) of both PascalDistribution and GeometricDistribution. Using a parameter mixture distribution (ParameterMixtureDistribution), NegativeBinomialDistribution can be realized from PoissonDistribution, GammaDistribution, BetaDistribution, and BetaPrimeDistribution, while also being related to CompoundPoissonDistribution via more complex transformations. NegativeBinomialDistribution is also related to BinomialDistribution, MultinomialDistribution, BernoulliDistribution, BetaBinomialDistribution, HypergeometricDistribution, and PoissonDistribution.
Examplesopen allclose all Basic Examples (3)
Probability mass function:
Cumulative distribution function:
Mean and variance:
Scope (8)
Generate a sample of pseudorandom numbers from a negative binomial distribution:
Compare its histogram to the PDF:
Distribution parameters estimation:
Estimate the distribution parameters from sample data:
Compare the density histogram of the sample with the PDF of the estimated distribution:
Skewness:
For large n, the distribution becomes more symmetric:
Limiting values:
Kurtosis:
For large values of n, kurtosis gets close to the kurtosis of the standard NormalDistribution:
Limiting values:
Different moments with closed forms as functions of parameters:
Moment:
CentralMoment:
FactorialMoment:
Closed form for symbolic order:
Cumulant:
Hazard function:
Quantile function:
Use dimensionless Quantity to define NegativeBinomialDistribution:
Applications (7)
The CDF of NegativeBinomialDistribution is an example of a right-continuous function:
The number of tails before getting 4 heads with a fair coin:
Plot the distribution of tail counts:
Compute the probability of getting at least 6 tails before getting 4 heads:
Compute the expected number of tails before getting 4 heads:
A coin was flipped 10 times and the 8 head occurred at the 10 flip. Find the probability of such an event if the coin is fair:
Assuming the coin may not be fair, find the most likely value for :
A basketball player shoots free throws until he hits 4 of them. His probability of scoring in any one of them is 0.7. Simulate the process:
Find the number of shots the player is expected to shoot:
Find the probability that the player requires 4 shots:
Assume the probability of fouling for each minute interval is 0.1 independently. Simulate the fouling process for 30 minutes:
A basketball player fouls out after 6 fouls. Find the expected playing time until foul out:
A shipment of products is inspected in batches of 60 and each batch is inspected up to rejection when the 10 defective item is found. Find the probability of a batch being rejected if 20% of the items are defective:
Alternatively, compute the same result by truncating the distribution:
Simulate the number of non-defective products in rejected batches:
Illustrate the ratio in each batch:
Find the average ratio of non-defective to defective products in rejected batches:
A data stream containing data packets is repeatedly sent without order information. Find the distribution of the number of unordered data stream arrivals until all the packets arrive in the right order for the second time:
Find the probability that packets will arrive the second time in the correct order after at most 18 fails:
Find the average number of fails until the second ordered data stream:
Simulate the number of fails until the second ordered data stream:
Properties & Relations (11) Wolfram Research (2007), NegativeBinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html (updated 2016). Text
Wolfram Research (2007), NegativeBinomialDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html (updated 2016).
CMS
Wolfram Language. 2007. "NegativeBinomialDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html.
APA
Wolfram Language. (2007). NegativeBinomialDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html
BibTeX
@misc{reference.wolfram_2025_negativebinomialdistribution, author="Wolfram Research", title="{NegativeBinomialDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html}", note=[Accessed: 12-July-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_negativebinomialdistribution, organization={Wolfram Research}, title={NegativeBinomialDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/NegativeBinomialDistribution.html}, note=[Accessed: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4