NegativeBinomial

NegativeBinomial()

Negative binomial distribution for failures before r successes.

Parameterized by positive integer number of successes r and per-trial success probability p. The support is {0, 1, 2, ...}, representing the number of failures observed before the r-th success.

Attributes

Name Description
mean Expected value.
support Distribution support.
variance Variance.
x_range Practical plotting range.

Methods

Name Description
cdf Cumulative distribution function.
elicit Elicit a negative binomial distribution from r and p.
fit Fit a negative binomial distribution to count data by moments.
pdf Probability mass function.
ppf Percent point function / inverse CDF.
sample Generate random samples.
validate_params Validate the r and p parameters.

cdf

NegativeBinomial.cdf(x)

Cumulative distribution function.

elicit

NegativeBinomial.elicit(r, p, name=None)

Elicit a negative binomial distribution from r and p.

fit

NegativeBinomial.fit(data, name=None)

Fit a negative binomial distribution to count data by moments.

pdf

NegativeBinomial.pdf(x)

Probability mass function.

ppf

NegativeBinomial.ppf(q)

Percent point function / inverse CDF.

sample

NegativeBinomial.sample(size=1, *, seed=None)

Generate random samples.

validate_params

NegativeBinomial.validate_params(params)

Validate the r and p parameters.