A beta-negative-binomial discrete random variable.
As an instance of the rv_discrete class, betanbinom object inherits from it
a collection of generic methods (see below for the full list),
and completes them with details specific for this particular distribution.
Methods
rvs(n, a, b, loc=0, size=1, random_state=None)
Random variates.
pmf(k, n, a, b, loc=0)
Probability mass function.
logpmf(k, n, a, b, loc=0)
Log of the probability mass function.
cdf(k, n, a, b, loc=0)
Cumulative distribution function.
logcdf(k, n, a, b, loc=0)
Log of the cumulative distribution function.
sf(k, n, a, b, loc=0)
Survival function (also defined as 1-cdf, but sf is sometimes more accurate).
logsf(k, n, a, b, loc=0)
Log of the survival function.
ppf(q, n, a, b, loc=0)
Percent point function (inverse of cdf — percentiles).
\[f(k) = \binom{n + k - 1}{k} \frac{B(a + n, b + k)}{B(a, b)}\]
for \(k \ge 0\), \(n \geq 0\), \(a > 0\),
\(b > 0\), where \(B(a, b)\) is the beta function.
betanbinom takes \(n\), \(a\), and \(b\) as shape parameters.
The probability mass function above is defined in the "standardized" form.
To shift distribution use the loc parameter.
Specifically, betanbinom.pmf(k,n,a,b,loc) is identically
equivalent to betanbinom.pmf(k-loc,n,a,b).
Alternatively, the distribution object can be called (as a function)
to fix the shape and location. This returns a "frozen" RV object holding
the given parameters fixed.
Freeze the distribution and display the frozen pmf: