The exact transform used to map (K - 1) unconstrained
variables to a K-simplex is described in the transformations
chapter of the manual.
If you just declare a parameter as a simplex[K], then
its distribution is implicitly uniform over K-simplexes.
So yes, it's Dirichlet(1), where 1 is a unit K-vector, because
that's uniform on simplexes.
The sampling is carried out by adjusting for the Jacobian in the
tranform.
For instance, this model will just sample theta
uniformly at random from the space of valid K-simplexes:
data {
int<lower=2> K;
parameters {
simplex[K] theta;
}
model {
}
You can then add in a prior, which is just multiplied into the
total log probability (the uniform multiplies by a constant, so
has no effect). If you want to put a Dirichlet prior on theta, do
it explicitly in the model, as in:
model {
theta ~ dirichlet(alpha);
}
where alpha is defined to be a non-negative K-vector in the data (or
hierarchically as a parameter).
- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
stan-users+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.