Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/iii/paper-219/4/d/solution

Every move can be drawn from a full conditional distribution, producing a Gibbs sampler with acceptance probability one. Write and . First update independently
and then
Let have rows and . Update the linear regression coefficients jointly by
and update
Finally, the flat positive variance priors give the following full conditionals, each an inverse-gamma distribution:
A systematic sweep in the displayed order, using the newly sampled values immediately, defines the chain. The shapes are positive for ; full column rank of is also required.

New to topics? Read the docs here!