Multinomial(::Int, ::Vector{Any}) error in Turing doing LDA

In many cases, you can marginalize out the discrete parameters to get a continuous model amenable to sampling with NUTS (see 9.5 Latent Dirichlet allocation | Stan User’s Guide for LDA) and then recover exact discrete draws in post-processing (see [Turing] Using a random variable as an index - #2 by sethaxen for a Turing example). This often yields better inferences than sampling discrete parameters directly, but it takes some more work up-front, which is why Turing’s support of Gibbs samplers is useful. It’s still good to know though that easy-to-use samplers often are easy because they don’t error when they have problems, not because they don’t have them.

These two are equivalent. In Turing you specify which parameters will use which sampler. When that sampler is used, all other parameters are held fixed, i.e. the joint model is conditioned on them.

2 Likes