pangolin.interface.Interface.dirichlet

pangolin.interface.Interface.dirichlet#

Interface.dirichlet(alpha)[source]#

Create a simplex-valued Dirichlet RV (Wikipedia).

alpha must be a one-dimensional vector of positive concentrations. The result has the same shape and lies on the corresponding simplex. The IR validates the shape; positivity remains a backend-level constraint.

Parameters:

alpha (RVLike) – Concentration vector.

Return type:

RV

Examples

>>> import pangolin.interface as pi
>>> pi.dirichlet([1, 2, 3]).shape
(3,)