pymc.DirichletMultinomial#

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

Dirichlet Multinomial log-likelihood.

Dirichlet mixture of Multinomials distribution, with a marginalized PMF.

\[f(x \mid n, a) = \frac{\Gamma(n + 1)\Gamma(\sum a_k)} {\Gamma(n + \sum a_k)} \prod_{k=1}^K \frac{\Gamma(x_k + a_k)} {\Gamma(x_k + 1)\Gamma(a_k)}\]

Support

\(x \in \{0, 1, \ldots, n\}\) such that \(\sum x_i = n\)

Mean

\(n \frac{a_i}{\sum{a_k}}\)

Parameters
nint

Total counts in each replicate (n > 0).

afloat array

Dirichlet concentration parameters (a > 0). The number of categories is given by the length of the last axis.

Methods

DirichletMultinomial.__init__(*args, **kwargs)

DirichletMultinomial.dist(n, a, *args, **kwargs)

Creates a tensor variable corresponding to the cls distribution.

DirichletMultinomial.logp(n, a)

Calculate log-probability of DirichletMultinomial distribution at specified value.

DirichletMultinomial.moment(size, n, a)

Attributes

rv_class

rv_op