Up to normalization, the joint posterior is
A Gibbs sampler cycle consists of:
  • independently draw every from the normal conditional in part a;
  • draw ;
  • draw
Each proposal is the exact full conditional and is therefore accepted. If the cycle begins with density , integrating the product of the current posterior and successive conditional kernels over all overwritten coordinates leaves
so a full Gibbs sweep preserves the joint posterior.
A Gibbs sampler draws each variable from its full conditional distribution, so every proposed update is accepted. At the start of a sweep define , , and
First update the reddenings independently as
Recompute and , then make the Gaussian updates
and
With
the remaining full conditionals, in the parameterization given in the question, are the scaled inverse chi-squared laws
Repeating these updates in the displayed order gives a complete Gibbs sweep. The formulas assume and nondegenerate sampled predictors; posterior propriety must be checked because the hyperpriors are improper.
Put . The Weighted graph Laplacian of the tree is defined by
Multiplication of the Gaussian likelihood by the prior shows that, conditionally on the precision parameter ,
Completing the square therefore gives
As a function of , the posterior density is
so, in shape-rate notation,
The precision matrix has the sparsity pattern of a tree. A sparse Cholesky decomposition and its triangular solves have cost and storage on this graph, while the gamma update also costs . Hence each systematic-scan Gibbs sampler iteration costs .
Bayes theorem turns the categorical distribution prior probabilities and the component multivariate normal densities into
These probabilities define the label update in the Gibbs sampler.
Choose an initial value . One sweep of the Gibbs sampler consists of
After a burn-in period, the pairs are retained as approximate samples. Standard irreducibility and recurrence conditions are needed for convergence from the chosen starting point.
The transition density from to is
Suppose currently has density . The density after one sweep is
This proves the stationarity of the two-coordinate Gibbs sampler: