pangolin.interface.categorical#
- pangolin.interface.categorical(theta)#
Create a scalar categorical RV (Wikipedia).
thetamust be a one-dimensional vector of nonnegative probabilities that sum to one. The IR validates its shape; the probability constraints remain backend-level. The result is a scalar category index.Examples
>>> import pangolin.interface as pi >>> pi.categorical([0.2, 0.3, 0.5]).shape ()