Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2015/iii/paper-37/6/i/c/solution

For , put and . Removing all factors independent of from the posterior distribution gives, for ,
A stable implementation uses the difference of the log weights. The conditional log odds are
so , a logistic function. For very large , evaluate this logistic expression using the sign of to avoid exponential overflow.
For Gibbs sampling for a finite hidden spin field, initialize any spin configuration. At every step choose uniformly, draw a fresh uniform variable, set spin to with the probability above and to otherwise, and leave all remaining spins fixed. This Random-scan Gibbs sampler has the stated posterior distribution invariant by detailed balance of a random-scan Gibbs sampler. All conditional probabilities are strictly between zero and one. For the one-site case, the conditional probabilities are both .

New to topics? Read the docs here!