Hi Kirsty (following on some off-list discussion),
The problem here is that the likelihood is not changing as the parameters change. The reason is that the way the model
is defined, `z[i,t]` says which row of `omega` is used for `y[i,t]`. As the MCMC proceeds, a given `z[i,t]` can only
be such that the observed `y[i,t]` is possible, and the probability vector for the `dcat` for `y` has a probability of one
in one position and zero in the others. So the probability density for y is always 1 (log probability density always 0) for
every MCMC iteration (i.e., regardless of the current parameter values) since values of z that don't make this be the case
would be rejected.
I started to think about the marginal version of WAIC, averaging over possible `z` values, but if one simulates `z` values
based on current parameter values in the MCMC but not conditioning on the data (as would happen with marginal WAIC),
one will produce `z` values that cause the likelihood to be 0. So I don't think that will work.
So ultimately, I think there's a statistical question in terms of how to apply WAIC to this model structure, not a nimble issue.
Also, this is perhaps a side note but perhaps relevant -- I'm not understanding how the model can give a valid (non-zero) likelihood for the y's that
are equal to 2. None of the rows of `omega` have positive probability on the second element. I must not be seeing/understanding
something.
As you may have noticed, the value of `pWAIC` that nimble is returning is 0 and the value of `lppd` is essentially zero
(seemingly up to some floating point numerical imprecision). This reflects the issue above and is the reason you get the same
"WAIC" for both models.
-chris