I’m just cutting my teeth on Turing. (BTW, thanks for this amazing software.) Does Turing support VI of mixture models? I attempted advi against a gaussian mixture model, but without success as below. The error occurred at ` Z[ii] ~ Categorical(wtrue)`

. Is it possible? Thanks!

```
using Distributions
using Turing, MCMCChains
# make causal distribution
ncomptrue = 3
mutrue = [1,2,3] # ground-truth component means
muprior = Normal(0, 3)
sigma = 0.1 # a-priori known
nsamples = 100
# components have equal probability
wtrue = [1,1,1]/ncomptrue
mixtrue = MixtureModel(Normal, [(mm, sigma) for mm in mutrue], wtrue)
Y = rand(mixtrue, nsamples)
# fit distribution with known # components
@model Mixmodel(x) = begin
N = length(x)
mu1 ~ muprior
mu2 ~ muprior
mu3 ~ muprior
mu = [mu1, mu2, mu3]
Z = Vector{Int}(undef, N)
for ii in 1:N
Z[ii] ~ Categorical(wtrue)
x[ii] ~ Normal(mu[Z[ii]], sigma)
end
end
model = Mixmodel(Y)
advi = ADVI(10, 1000)
q = vi(model, advi)
```