Order the simplex

Hey all -

I’m working with a mixture model and I want to order the simplex for identifiability. How can I use Stan modeling language to order the simplex?

Should I use ordered[N] pi and then at each iteration transform pi back to a simplex? If I do this in transformed parameters does this happen after each iteration in the sampler?

Is it worth adding this to the math library?

I know people cringe at mixture models…

You need positive_ordered[N] gamma; with independent Gamma(\alpha_n, 1) priors. Then, pi = gamma / sum(gamma); is distributed Dirichlet over the simplex with a Dirichlet(\mathbf{\alpha}) subject to the ordering constraint.


excellent thanks ben, solved!