pymc.dims.Categorical#
- class pymc.dims.Categorical(name, *dist_params, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, default_transform=UNSET, model=None, **kwargs)[source]#
Categorical distribution.
- Parameters:
- p
xtensor_like
, optional Probabilities of each category. Must sum to 1 along the core dimension. Must be provided if logit_p is not specified.
- logit_p
xtensor_like
, optional Alternative parametrization using logits. Must be provided if p is not specified.
- core_dims
str
The core dimension of the distribution, which represents the categories. The dimension must be present in p or logit_p.
- **kwargs
Other keyword arguments used to define the distribution.
- p
- Returns:
XTensorVariable
An xtensor variable representing the categorical distribution. The output does not contain the core dimension, as it is absorbed into the distribution.
Methods
Categorical.dist
([p, logit_p, core_dims])