6
$\begingroup$

I'm defining a Multinomial-Dirichlet model in JAGS and want to assign some hyperpriors to the parameters of the Dirichlet distribution. In the WinBugs manual I read that "the parameters of Dirichlet and Wishart distributions and the order (N) of the multinomial distribution must be specified and cannot be given prior distributions. (There is, however, a trick to avoid this constraint for the Dirichlet distribution). What's this trick?

$\endgroup$
6
$\begingroup$

I don't know for sure what the trick is, but this is my guess. Using JAGS syntax to specify $\xi \sim \mathcal D(\alpha)$, you would normally do something like this:

xi ~ dirichlet(alpha[])

JAGS would then not allow you to assign a prior to $\alpha = (\alpha_1, \ldots, \alpha_J)$. Instead, let $\xi^\star_j \sim \mbox{Gamma}(\alpha_j, 1)$. Then it can be shown that $$ \xi \equiv \left(\frac{\xi^\star_1}{\sum_j \xi^\star_j}, \ldots, \frac{\xi^\star_J}{\sum_j \xi^\star_j}\right) \sim \mathcal D(\alpha_1, \ldots, \alpha_J). $$

Hence you can do the following:

for(j in 1:J) {
  xi_raw[j] ~ dgamma(alpha[j], 1)
}
for(j in 1:J) {
  xi[j] <- xi_raw[j] / sum(xi_raw[])
}
## Some prior for alpha follows...
$\endgroup$

protected by whuber Aug 22 '14 at 14:44

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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