> On Feb 4, 2016, at 9:33 AM, Martin <
wel...@gmail.com> wrote:
>
> Hi,
>
> I'm looking for example code of a finite mixture of two (e.g. Gamma/Normal) GLMs in STAN:
> f_mix = pi * Gamma(x | a,b) + (1-pi) * Normal(x | m, s)
>
> where p, a, b, m, s, and all parameters beta are estimated.
Works the same way as other mixtures. See the manual
chapter on mixture models.
> Furthermore, is it possible in STAN to model _infinite_ mixtures where the number of components pi_i is unknown
> but limited to a maximum value (so not really infinite ;))? I heard this can be done with a dirichlet stick-breaking process,
> but I don't know how.
Yes, the Dirichlet process is the limit of the finite Dirichlet
case as the number of components goes to infinity. Just use a standard
Dirichlet and set the number of components above your max. You don't
need to code up the stick-breaking process yourself!
> I would also appreciate some example code for that.
We don't have that. I think there's a recent BUGS example
that'd be easy to translate, but it's literally just a matter of
using a large-K, low-alpha Dirichlet prior.
- Bob