In helping a couple of people today, I realized that I mistyped my hint last night. This is how it should read.
a[1:3} ~ dmulti(x.a[], N.a) N.a <- sum(n.a[])
# priors
y.a[1] ~ dexp(1)
y.a[2] ~ dexp(2)
y.a[3] ~ desp(3)
x.a[1] <- y.a[1]/sum(y.a[])
x.a[2] <- y.a[2]/sum(y.a[])
x.a[3] <- y.a[3]/sum(y.a[])
The difference is in the last three lines. x.a[] is just calculated from the y.a[], so you connect the two with a "<-" instead of a "~". You only use the "~" when you're talking about observations on the left side of the equation having a particular probability distribution.
Sorry for the confustion. That's what I get for typing hints late (for me) at night.

Leave a comment