Wishart prior in WinBUGS/OpenBUGS

For a multilevel model, we specify the random coefficients as a multivariate normal distribution such as \[ \left(\begin{array}{c} L_{i}\\ S_{i}\end{array}\right)\sim MN\left[\left(\begin{array}{c} \beta_{L}\\ \beta_{S}\end{array}\right),\Sigma^{-1}\right] \]

The prior for the precision matrix $\Sigma^{-1}$ is given a Wishart distribution in BUGS.

\[\Sigma^{-1}\sim W(R[1:2,1:2],m)\]

Here $m$ is the degrees of freedom (scalar) that is equivalent prior sample size and must be greater than or equal to dimension of matrix in order for Wishart to be proper. $m$ determines the degree of certainty you have about the mean.

In WinBUGS, the specification indicate that the mean of the covariance matrix (not the precision matrix) is

\[E(\Sigma^{-1})=mR^{-1}\]

In WinBUGS notation, if the precision matrix $P=\Sigma^{-1}$ follows a Wishart distribution $W(R,m)$, then

\[E(P_{ij})=mR_{ij}^{-1}\]

\[Var(P_{ij})=m(R_{ij}^{-2}+R_{ii}^{-1}R_{jj}^{-1})\]

\[Cov(P_{ij},P_{kl})=m(R_{ik}^{-1}R_{jl}^{-1}+R_{il}^{-1}R_{jk}^{-1})\]

An intuitive way to specify the Wishart prior