Given a deviance function \(D(\theta) = -2 log(p(y|\theta))\), and an estimate
\(\theta* = (\sum \theta_i) / N\) of the posterior mean
\(E(\theta|y)\), where \(y\) denote the data, \(\theta\) are the unknown
parameters of the model, \(\theta_1, ..., \theta_N\) are MCMC samples from the posterior
distribution of \(\theta\) given \(y\) and \(p(y|\theta)\) is the likelihood function,
the (form 1 of) Deviance Infomation Criterion (DIC) is defined as
$$DIC = 2 ( (\sum_{s=1}^N D(\theta_s)) / N - D(\theta*) )$$
The second form for DIC is given by
$$DIC = D(\theta*) - 4 \hat{var} \log p(y|\theta_s)$$
where for \(i = 1, ..., n\), \(\hat{var} \log p(y|\theta)\) denotes the estimated variance
of the log likelihood based on the realizations \(\theta_1, ..., \theta_N\).
Like AIC and BIC, DIC is an asymptotic approximation for large samples, and
is only valid when the posterior distribution is approximately normal.