What do you need it for? The generated quantities block has a categorical_rng.
There's no way to sample discrete parameters (other than hacks we don't
recommend) in the model.
If you need the parameters for inference, you want to marginalize
them out.
I don't know what you mean by belonging to the set {100, 200, 500}.
Our categorical outcomes are always 1:K for some K. If you need
other numbers, you'll have to multiply or map them back again, say
using an array:
int values[3];
values[1] <- 100;
values[2] <- 200;
values[3] <- 500;
c <- categorical_rng(rep_vector(1.0 / 3.0, 3));
r <- values[c];
- 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/d/optout.