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+n−1n−1)pn(1−p)kk≥0F(x;n,p)=⌊x⌋∑i=0(i+n−1i)pn(1−p)ix≥0=Ip(n,⌊x⌋+1)x≥0μ=n1−ppμ2=n1−pp2γ1=2−p√n(1−p)γ2=p2+6(1−p)n(1−p).
Recall that Ip(a,b) is the incomplete beta integral.
Implementation: scipy.stats.nbinom