In JAGS, I am working with data that have missing observations of a count. I know two things about each missing observation: (1) All missing counts were observed by the CDC but numbered from 0 to 9. (2) On a given year, all of the missing counts total-up to some nationwide number.

In my code below, observations 1-419 are fully observed. Observations 420-456 are missing observations where I know they sum to 113. I used a multinomial distribution to do this. Observations 457-969 are also missing, but I use a truncated Poisson to force 0 to 9 counts.

Is there any way I can do both of these at once. A few ideas:

*Is there something like the T(,) function for dmulti()?

*Can I set a condition that would reject an iteration if it fails? E.g., if the maximum value of Deaths[420:456]>9, throw out that draw and try again?

*Can I use my truncated Poissons and impose that certain sums have to total up to a number, or else reject the draw?

*Is there another distributional setup that might work better.

Option #2 seems the post plausible to me, but I'm not sure. Ideas are welcome. Here's my code:

model {
for (i in 1:419){

for (i in 420:456){

for (i in 457:969){


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.