I am trying to model a function of observed data in JAGS. For example

   x[i,t]/phi ~ dpois(mu)

where x is observed and phi is a parameter in the model. I can't seem to get this working and am wondering if I may be missing some larger issue in JAGS. I am pretty sure you can't have any transformation of the data in the model statement and need to use a data block but that doesn't seem to be dynamic, thus not allowing for me to fit phi.

Any ideas?

  • $\begingroup$ Can you please add the formulas for your model? $\endgroup$ – teucer Nov 7 '11 at 10:23
  • $\begingroup$ it is a pretty convoluted model and I think it will complicate the question. Is my question unclear? $\endgroup$ – scottyaz Nov 7 '11 at 11:24
  • 3
    $\begingroup$ I believe you cannot fit the model that you have described: to my knowledge in JAGS you are not able to scale a distribution. What distribution $\phi$ is supposed to follow? If it is simple enough, you can derive the distribution of $x$ directly and sample from it. $\endgroup$ – teucer Nov 7 '11 at 11:48
  • $\begingroup$ @teucer Feel free to convert your comment to a response, so that it can be voted up and perhaps get the green mark. $\endgroup$ – chl Nov 7 '11 at 17:53

So here the answer from the comment:

I believe there is no way to directly sample from a scaled distribution in JAGS, except the cases where the scaled distribution can be expressed as a standard distribution.

This being said there is trick, the so called "zero trick", but I have not used it so far. It might be useful in your case...


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.