How to integrate out latent variables/ intermediate values in Turing model

I think you’re trying to do something like:

theta ~ MyPrior()
x = rand(MvNormal(0,theta))
xprime = transform(x)
inclp = sum(logpdf(Ydist(xp),y) for xp in xprime)
@addlogprob!(inclp)

Which you can definitely try… see what you think.

1 Like