pangolin.interface.Interface.categorical#
- Interface.categorical(theta)[source]#
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 ()