dirichlet
dirichlet(
options):Sampler<number[]>
Defined in: src/distribution/continuous/simplex.ts:24
Dirichlet: a point on the simplex, so the values are in (0, 1) and sum to 1. The usual prior over a categorical distribution.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Sampler<number[]>
Example
Section titled “Example”const d = dirichlet({ alpha: [1, 1, 1] });d.sample(); // [ 0.24, 0.51, 0.25 ]