8. Model Inference and Averaging
Note that we don’t need to know the explicit form of the conditional
densities, but just need to be able to sample from them. After the procedure
reaches stationarity, the marginal density of any subset of the variables
can be approximated by a density estimate applied to the sample values.
However if the explicit form of the conditional density Pr(Uk, |U`, ` 6= k)
is available, a better estimate of say the marginal density of Uk can be
obtained from (Exercise 8.3):
cPrUk (u) = 1 (M − m + 1) MX t=m Pr(u|U(t) ` , ` 6= k).
Here we have averaged over the last M −m+ 1 members of the sequence,
to allow for an initial “burn-in” period before stationarity is reached.
Now getting back to Bayesian inference, our goal is to draw a sample from
the joint posterior of the parameters given the data Z. Gibbs sampling will
be helpful if it is easy to sample from the conditional distribution of each
parameter given the other parameters and Z. An example—the Gaussian
mixture problem—is detailed next.