Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Negative binomial distribution
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Related distributions== * The [[geometric distribution]] on {{math|{{mset|0, 1, 2, 3, ... }}}} is a special case of the negative binomial distribution, with ::<math>\operatorname{Geom}(p) = \operatorname{NB}(1,\, p).\,</math> * The negative binomial distribution is a special case of the [[discrete phase-type distribution]]. * The negative binomial distribution is a special case of discrete [[compound Poisson distribution]]. ===Poisson distribution=== Consider a sequence of negative binomial random variables where the stopping parameter {{mvar|r}} goes to infinity, while the probability {{mvar|p}} of success in each trial goes to one, in such a way as to keep the mean of the distribution (i.e. the expected number of failures) constant. Denoting this mean as {{mvar|λ}}, the parameter {{mvar|p}} will be {{math|1=''p'' = ''r''/(''r'' + ''λ'')}} : <math> \begin{align} \text{Mean:} \quad & \lambda = \frac{(1-p)r}{p} \quad \Rightarrow \quad p = \frac{r}{r+\lambda}, \\ \text{Variance:} \quad & \lambda \left( 1 + \frac{\lambda}{r} \right) > \lambda, \quad \text{thus always overdispersed}. \end{align} </math> Under this parametrization the probability mass function will be : <math> f(k; r, p) = \frac{\Gamma(k+r)}{k!\cdot\Gamma(r)}(1-p)^k p^r = \frac{\lambda^k}{k!} \cdot \frac{\Gamma(r+k)}{\Gamma(r)\;(r+\lambda)^k} \cdot \frac{1}{\left(1+\frac{\lambda}{r}\right)^r} </math> Now if we consider the limit as {{math|''r'' → ∞}}, the second factor will converge to one, and the third to the exponent function: : <math> \lim_{r\to\infty} f(k; r, p) = \frac{\lambda^k}{k!} \cdot 1 \cdot \frac{1}{e^\lambda}, </math> which is the mass function of a [[Poisson distribution|Poisson-distributed]] random variable with expected value {{mvar|λ}}. In other words, the alternatively parameterized negative binomial distribution [[convergence in distribution|converges]] to the Poisson distribution and {{mvar|r}} controls the deviation from the Poisson. This makes the negative binomial distribution suitable as a robust alternative to the Poisson, which approaches the Poisson for large {{mvar|r}}, but which has larger variance than the Poisson for small {{mvar|r}}. : <math> \operatorname{Poisson}(\lambda) = \lim_{r \to \infty} \operatorname{NB} \left(r, \frac{r}{r + \lambda}\right). </math> ===Gamma–Poisson mixture=== The negative binomial distribution also arises as a continuous mixture of [[Poisson distribution]]s (i.e. a [[compound probability distribution]]) where the mixing distribution of the Poisson rate is a [[gamma distribution]]. That is, we can view the negative binomial as a {{math|Poisson(''λ'')}} distribution, where {{mvar|λ}} is itself a random variable, distributed as a gamma distribution with shape {{mvar|r}} and scale {{math|1=''θ'' = (1 − ''p'')/''p''}} or correspondingly rate {{math|1=''β'' = ''p''/(1 − ''p'')}}. To display the intuition behind this statement, consider two independent Poisson processes, "Success" and "Failure", with intensities {{mvar|p}} and {{math|1 − ''p''}}. Together, the Success and Failure processes are equivalent to a single Poisson process of intensity 1, where an occurrence of the process is a success if a corresponding independent coin toss comes up heads with probability {{mvar|p}}; otherwise, it is a failure. If {{mvar|r}} is a counting number, the coin tosses show that the count of successes before the {{mvar|r}}-th failure follows a negative binomial distribution with parameters {{mvar|r}} and {{mvar|p}}. The count is also, however, the count of the Success Poisson process at the random time {{mvar|T}} of the {{mvar|r}}-th occurrence in the Failure Poisson process. The Success count follows a Poisson distribution with mean {{math|''pT''}}, where {{mvar|T}} is the waiting time for {{mvar|r}} occurrences in a Poisson process of intensity {{math|1 − ''p''}}, i.e., {{mvar|T}} is gamma-distributed with shape parameter {{mvar|r}} and intensity {{math|1 − ''p''}}. Thus, the negative binomial distribution is equivalent to a Poisson distribution with mean {{math|''pT''}}, where the random variate {{mvar|T}} is gamma-distributed with shape parameter {{mvar|r}} and intensity {{math|(1 − ''p'')}}. The preceding paragraph follows, because {{math|1=''λ'' = ''pT''}} is gamma-distributed with shape parameter {{mvar|r}} and intensity {{math|(1 − ''p'')/''p''}}. The following formal derivation (which does not depend on {{mvar|r}} being a counting number) confirms the intuition. : <math>\begin{align} & \int_0^\infty f_{\operatorname{Poisson}(\lambda)}(k) \times f_{\operatorname{Gamma}\left(r,\, \frac{p}{1-p}\right)}(\lambda) \, \mathrm{d}\lambda \\[8pt] = {} & \int_0^\infty \frac{\lambda^k}{k!} e^{-\lambda} \times \frac 1 {\Gamma(r)} \left(\frac{p}{1-p} \lambda \right)^{r-1} e^{- \frac{p}{1-p} \lambda} \, \left( \frac p{1-p} \, \right)\mathrm{d}\lambda \\[8pt] = {} & \left(\frac{p}{1-p}\right)^r \frac{1}{k!\,\Gamma(r)} \int_0^\infty \lambda^{r+k-1} e^{-\lambda \frac{p+1-p}{1-p}} \;\mathrm{d}\lambda \\[8pt] = {} & \left(\frac{p}{1-p}\right)^r \frac{1}{k!\,\Gamma(r)} \Gamma(r+k) (1-p)^{k+r} \int_0^\infty f_{\operatorname{Gamma}\left(k+r, \frac{1}{1-p}\right)}(\lambda) \;\mathrm{d}\lambda \\[8pt] = {} & \frac{\Gamma(r+k)}{k!\;\Gamma(r)} \; (1-p)^k \,p^r \\[8pt] = {} & f(k; r, p). \end{align}</math> Because of this, the negative binomial distribution is also known as the '''gamma–Poisson (mixture) distribution'''. The negative binomial distribution was originally derived as a limiting case of the gamma-Poisson distribution.<ref name="Greenwood1920">{{cite journal |last1=Greenwood |first1=M. |last2=Yule |first2=G. U. |year=1920 |title=An inquiry into the nature of frequency distributions representative of multiple happenings with particular reference of multiple attacks of disease or of repeated accidents |journal=[[Journal of the Royal Statistical Society|J R Stat Soc]] |volume=83 |issue=2 |pages=255–279 |doi=10.2307/2341080 |jstor=2341080 |url=https://zenodo.org/record/1449492 }}</ref> ===Distribution of a sum of geometrically distributed random variables=== If {{math|''Y''{{sub|''r''}}}} is a random variable following the negative binomial distribution with parameters {{mvar|r}} and {{mvar|p}}, and support {{math|{{mset|0, 1, 2, ...}}}}, then {{math|''Y''{{sub|''r''}}}} is a sum of {{mvar|r}} [[statistical independence|independent]] variables following the [[geometric distribution]] (on {{math|{{mset|0, 1, 2, ...}}}}) with parameter {{mvar|p}}. As a result of the [[central limit theorem]], {{math|''Y''{{sub|''r''}}}} (properly scaled and shifted) is therefore approximately [[normal distribution|normal]] for sufficiently large {{mvar|r}}. Furthermore, if {{math|''B''{{sub|''s''+''r''}}}} is a random variable following the [[binomial distribution]] with parameters {{math|''s'' + ''r''}} and {{mvar|p}}, then : <math> \begin{align} \Pr(Y_r \leq s) & {} = 1 - I_p(s+1, r) \\[5pt] & {} = 1 - I_{p}((s+r)-(r-1), (r-1)+1) \\[5pt] & {} = 1 - \Pr(B_{s+r} \leq r-1) \\[5pt] & {} = \Pr(B_{s+r} \geq r) \\[5pt] & {} = \Pr(\text{after } s+r \text{ trials, there are at least } r \text{ successes}). \end{align} </math> In this sense, the negative binomial distribution is the "inverse" of the binomial distribution. The sum of independent negative-binomially distributed random variables {{math|''r''{{sub|1}}}} and {{math|''r''{{sub|2}}}} with the same value for parameter {{mvar|p}} is negative-binomially distributed with the same {{mvar|p}} but with {{mvar|r}}-value {{math|''r''{{sub|1}} + ''r''{{sub|2}}}}. The negative binomial distribution is [[Infinite divisibility (probability)|infinitely divisible]], i.e., if {{mvar|Y}} has a negative binomial distribution, then for any positive integer {{mvar|n}}, there exist independent identically distributed random variables {{math|''Y''{{sub|1}}, ..., ''Y''{{sub|''n''}}}} whose sum has the same distribution that {{mvar|Y}} has. ===Representation as compound Poisson distribution=== The negative binomial distribution {{math|NB(''r'', ''p'')}} can be represented as a [[compound Poisson distribution]]: Let <math display=inline> (Y_n)_{n\,\in\,\mathbb N} </math> denote a sequence of [[independent and identically distributed random variables]], each one having the [[logarithmic distribution|logarithmic series distribution]] {{math|Log(''p'')}}, with probability mass function : <math> f(k; r, p) = \frac{-p^k}{k\ln(1-p)},\qquad k\in{\mathbb N}.</math> Let {{mvar|N}} be a random variable, [[independence (probability theory)|independent]] of the sequence, and suppose that {{mvar|N}} has a [[Poisson distribution]] with mean {{math|λ {{=}} −''r'' ln(1 − ''p'')}}. Then the random sum : <math>X=\sum_{n=1}^N Y_n</math> is {{math|NB(''r'', ''p'')}}-distributed. To prove this, we calculate the [[probability generating function]] {{math|''G''{{sub|''X''}}}} of {{mvar|X}}, which is the composition of the probability generating functions {{math|''G''{{sub|''N''}}}} and {{math|''G''{{sub|''Y''{{sub|1}}}}}}. Using :<math>G_N(z)=\exp(\lambda(z-1)),\qquad z\in\mathbb{R},</math> and : <math>G_{Y_1}(z)=\frac{\ln(1-pz)}{\ln(1-p)},\qquad |z|<\frac1p,</math> we obtain : <math> \begin{align}G_X(z) & =G_N(G_{Y_1}(z))\\[4pt] &=\exp\biggl(\lambda\biggl(\frac{\ln(1-pz)}{\ln(1-p)}-1\biggr)\biggr)\\[4pt] &=\exp\bigl(-r(\ln(1-pz)-\ln(1-p))\bigr)\\[4pt] &=\biggl(\frac{1-p}{1-pz}\biggr)^r,\qquad |z|<\frac1p, \end{align} </math> which is the probability generating function of the {{math|NB(''r'', ''p'')}} distribution. The following table describes four distributions related to the number of successes in a sequence of draws: {| class="wikitable" |- ! !! With replacements !! No replacements |- | Given number of draws || [[binomial distribution]] || [[hypergeometric distribution]] |- | Given number of failures || negative binomial distribution || [[negative hypergeometric distribution]] |} ===(''a'',''b'',0) class of distributions=== The negative binomial, along with the Poisson and binomial distributions, is a member of the [[(a,b,0) class of distributions|{{math|(''a'', ''b'', 0)}} class of distributions]]. All three of these distributions are special cases of the [[Panjer distribution]]. They are also members of a [[natural exponential family]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)