pymc.Dirichlet#

class pymc.Dirichlet(name, *args, rng=None, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, **kwargs)[source]#

Dirichlet log-likelihood.

\[f(\mathbf{x}|\mathbf{a}) = \frac{\Gamma(\sum_{i=1}^k a_i)}{\prod_{i=1}^k \Gamma(a_i)} \prod_{i=1}^k x_i^{a_i - 1}\]

Support

\(x_i \in (0, 1)\) for \(i \in \{1, \ldots, K\}\) such that \(\sum x_i = 1\)

Mean

\(\dfrac{a_i}{\sum a_i}\)

Variance

\(\dfrac{a_i - \sum a_0}{a_0^2 (a_0 + 1)}\) where \(a_0 = \sum a_i\)

Parameters:
atensor_like of float

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

Methods

Dirichlet.dist(a, **kwargs)

Creates a tensor variable corresponding to the cls distribution.