0
$\begingroup$

I am trying to create a hierarchical model in BUGs. I am actually attempting to implement this is Nimble, but I suspect that a JAGs implementation will be informative.

To attempt to reduce my problem to the bare minimum: I have some a priori knowledge about conditional independence between two variables that I would like to incorporate into my model. So, the following equations hold for the joint distribution:

$f(x,y,z) = f(x,y|z) * f(z)$ (Bayes' rule)

$f(x,y,z) = f(x | y, z) * f(y | z) * f(z)$ (Bayes' rule again)

$f(x,y,z) = f(x | y) * f(y | z) * f(z)$ (My a priori knowledge about conditional independence of $x$ and $z$ given $y$.)

It so happens that I also know the marginal distributions for $f(x,y)$, $f(y,z)$ and $f(z)$. In my case, they are all multivariate Gaussian.

One naive attempt to apply this by simply encoding each of the three marginal distributions listed above would be:

xy[1:2] ~ dmnorm(...)
yz[1:2] ~ dmnorm(...)
z ~ dnorm(...)

However, this neglects the fact that yz[1] is the same variable as xy[2], and that yz[2] is z.

I could also simply:

xyz[1:3] ~ dmnorm(...)

But this neglects my knowledge that x and z are conditionally independent given y.

How can I define my joint distribution of xyz in BUGs given my knowledge about the marginal distributions and this conditional independence assumption?

$\endgroup$

0