pymc.BetaBinomial#

class pymc.BetaBinomial(name, *args, **kwargs)[source]#

Beta-binomial log-likelihood.

Equivalent to binomial random variable with success probability drawn from a beta distribution. The pmf of this distribution is

\[f(x \mid \alpha, \beta, n) = \binom{n}{x} \frac{B(x + \alpha, n - x + \beta)}{B(\alpha, \beta)}\]

(Source code, png, hires.png, pdf)

../../../_images/pymc-BetaBinomial-1.png

Support

\(x \in \{0, 1, \ldots, n\}\)

Mean

\(n \dfrac{\alpha}{\alpha + \beta}\)

Variance

\(n \dfrac{\alpha \beta}{(\alpha+\beta)^2 (\alpha+\beta+1)}\)

Parameters
ntensor_like of int

Number of Bernoulli trials (n >= 0).

alphatensor_like of float

alpha > 0.

betatensor_like of float

beta > 0.

Methods

BetaBinomial.__init__(*args, **kwargs)

BetaBinomial.dist(alpha, beta, n, *args, ...)

Creates a tensor variable corresponding to the cls distribution.

BetaBinomial.logcdf(n, alpha, beta)

Compute the log of the cumulative distribution function for BetaBinomial distribution at the specified value.

BetaBinomial.logp(n, alpha, beta)

Calculate log-probability of BetaBinomial distribution at specified value.

BetaBinomial.moment(size, n, alpha, beta)

Attributes

rv_class

rv_op