Negative Binomial Distribution#

The negative binomial random variable with parameters n and p(0,1) can be defined as the number of extra independent trials (beyond n ) required to accumulate a total of n successes where the probability of a success on each trial is p. Equivalently, this random variable is the number of failures encountered while accumulating n successes during independent trials of an experiment that succeeds with probability p. Thus,

p(k;n,p)=(k+n1n1)pn(1p)kk0F(x;n,p)=i=0x(i+n1i)pn(1p)ix0=Ip(n,x+1)x0μ=n1ppμ2=n1pp2γ1=2pn(1p)γ2=p2+6(1p)n(1p).

Recall that Ip(a,b) is the incomplete beta integral.

Implementation: scipy.stats.nbinom