# pymc.Multinomial#

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

Multinomial log-likelihood.

Generalizes binomial distribution, but instead of each trial resulting in “success” or “failure”, each one results in exactly one of some fixed finite number k of possible outcomes over n independent trials. ‘x[i]’ indicates the number of times outcome number i was observed over the n trials.

$f(x \mid n, p) = \frac{n!}{\prod_{i=1}^k x_i!} \prod_{i=1}^k p_i^{x_i}$
 Support $$x \in \{0, 1, \ldots, n\}$$ such that $$\sum x_i = n$$ Mean $$n p_i$$ Variance $$n p_i (1 - p_i)$$ Covariance $$-n p_i p_j$$ for $$i \ne j$$
Parameters
n

Total counts in each replicate (n > 0).

p

Probability of each one of the different outcomes (0 <= p <= 1). The number of categories is given by the length of the last axis. Elements are expected to sum to 1 along the last axis.

Methods

 Multinomial.__init__(*args, **kwargs) Multinomial.dist(n, p, *args, **kwargs) Creates a tensor variable corresponding to the cls distribution. Calculate log-probability of Multinomial distribution at specified value. Multinomial.moment(size, n, p)

Attributes

 rv_op