rjags

Creating a user defined distribution in jags


Normally, the model is generated based on some available distributions in JAGS, what if we need the parameters to be sampled from other specific distributions.

Is it possible to create a new distribution in JAGS


Solution

  • Depends on what you need the new distribution for. If you want a new distribution to calculate the likelihood, you could use the zeros or ones trick. If you need a new prior distribution, or something else that JAGS does not already have, you this paper gives a good tutorial if you have the requisite C++ experience.