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:
ntensor_like of int

Total counts in each replicate (n > 0).

atensor_like of float

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

Methods

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

Creates a tensor variable corresponding to the cls distribution.