Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 37 5 d 1 Solution Created 2026-10-03 Updated 2026-10-06
The algorithm is a Random-scan Gibbs sampler. Start at a point where the target is positive, with a proper normalizing integral and well-defined full conditional distributions. Its state is the entire coordinate vector. Choosing the initial point fixes the initial law; it need not already be the invariant law. The transition rule below preserves the target irrespective of this choice.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 37 5 d 3 i Solution Created 2026-10-03 Updated 2026-10-06
For the Random-scan Gibbs sampler, the correct transition kernel is a measure, since a one-coordinate update is singular with respect to full-dimensional Lebesgue measure when . Write for all coordinates except . ThenEach Dirac measure fixes an unupdated coordinate. Equivalently, , with placed in coordinate . Replacing this kernel by an ordinary density on the whole product space would omit those fixed-coordinate constraints.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 37 6 i c Solution Created 2026-10-03 Updated 2026-10-06
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 areso , 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 .
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 219 4 iii c Solution Created 2026-10-03 Updated 2026-10-05
Keeping the powers and exponentials of and in the joint kernel gives the two inverse-gamma distributions, using the printed shape–scale convention:Indeed their kernels are and . With positive measurement variances and generic continuously drawn latent values, the two scale parameters are positive almost surely. Together with (a),(b), these are all formal full conditional updates.
There is, however, no joint posterior probability distribution to sample under the stated priors. Integrate out the intrinsic first. For fixed , the observational marginal density iswhere is the centred normal density of variance . Substitute . Dominated convergence givesThe convergence is uniform on any compact interval and any compact positive interval, since the normal densities are uniformly bounded and continuous there. Hence some such region has for all sufficiently small , andIntegrating over those positive-measure intervals proves that the full normalizing constant is infinite. If all , the boundary also gives a positive marginal likelihood and a divergent integral at fixed . Thus , even though its generic full conditionals are proper. Apparent stability of a simulated chain cannot establish a nonexistent stationary probability law.
A valid repair that preserves direct sampling is to replace the two log-flat priors by independent proper and , with all four constants positive. The normal and truncated-normal updates remain as above, whileWith positive , the flat prior is then harmless: after integrating it out, the Gaussian measurement likelihood is bounded uniformly over the latent shifts and the scales, and the remaining proper priors integrate to one. A proper prior on is also possible.
For this repaired model, initialize , and finite . Repeatedly choose one of the coordinates with fixed positive probabilities and redraw from its full conditional using the latest values. This Random-scan Gibbs sampler preserves the proper target and satisfies detailed balance: for each coordinate, both forward and reverse flows equal the marginal density of the remaining coordinates times the product of the two conditional densities. A systematic full sweep is another invariant scheme, though it need not itself be reversible.
Run several dispersed chains; inspect traces of both scales, , representative latent values and the log posterior. Assess rank-normalized split , autocorrelation, and the effective sample size of a Markov chain, and extend runs until relevant Monte Carlo errors are sufficiently small. Scale–latent dependence can cause slow mixing, so diagnostics must include boundary exploration and alternative initializations. Keep post-warmup draws without automatic thinning. These are convergence checks for the repaired posterior; the printed model admits only the formal update algorithm, not a valid posterior-sampling interpretation.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 216 2 a Solution 2026-10-03
Given the current state , a Random-scan Gibbs sampler chooses uniformly from , leaves unchanged, and samples the new coordinate from the complete conditional distributionIts transition kernel isand it leaves invariant.