Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 33 5 Solution Created 2026-10-03 Updated 2026-10-14
The Metropolis–Hastings algorithm proposes and moves from the current state with acceptance probabilityOn rejection it retains . The target need only be known up to its normalizing constant, but it must define a proper probability distribution. The accepted off-diagonal probability flow iswhich is symmetric in and proves detailed balance. This permits considerable flexibility in proposals, including joint moves when a posterior distribution has strongly correlated parameters, but requires proposal tuning and can waste computation on rejections.
A Gibbs sampler instead updates a coordinate or block from its exact full conditional distribution, holding the other coordinates fixed. This is a special Metropolis–Hastings algorithm update with acceptance probability one: the joint density factors into the unchanged marginal density and the proposed conditional density, which cancel in the acceptance ratio. The coordinate update preserves the target; composing such updates therefore preserves it too, although an entire deterministic sweep need not itself be reversible.
Use Gibbs sampling when the conditional laws are easy to simulate and suitably chosen blocks mix well. Scalar updates can mix poorly under strong posterior distribution correlation, whereas a blocked Gibbs sampler can alleviate that dependence. Prefer a flexible Metropolis proposal when conditional draws are difficult or a well-tuned joint proposal is more effective. Variations include random or systematic coordinate scans, Random-walk Metropolis algorithms, independence proposals, and using Metropolis updates for difficult blocks inside a Gibbs scheme. Both methods generate dependent draws; usable long-run estimates require an appropriate irreducible, aperiodic chain and assessment of mixing, not merely a formal update rule.
For the change-point calculation, put andMultiplication of the Gaussian likelihood function by the specified prior distribution gives the formal posterior distribution kernel, with respect to and counting measure on ,
There is an empty component under an improper prior at . The sum is independent of , whose prior distribution is flat on all of . For every fixed finite and , the kernel is a strictly positive constant in , henceThe configuration has positive prior probability . Integrating over, for example, a bounded interval of and already makes the joint normalization infinite. Thus the printed prior distribution does not produce a posterior probability distribution. This failure is present for every data set, not just for a special arrangement of observations.
The formal full conditionals expose exactly where the requested sampler breaks. For , completing the two mean squares givesThe variance kernel is that of when , and the discrete conditional probabilities are proportional to . At the conditional kernel for is constant and cannot be normalized; it is not a normal distribution with an infinite variance. Therefore no valid Gibbs sampler, and no value of , exists for the model as printed. A chain that simply substitutes an arbitrary distribution for this missing conditional would be sampling a different model.
Here is a fully specified proper-prior repair retaining the no-change configuration. Choose fixed hyperparametersindependently, with . Its Gaussian change-point posterior with proper priors isIt is normalizable even for degenerate data: the likelihood function is at most , and its integral against the variance prior distribution is bounded byThe normal mean priors integrate to one, and the normalizing constant is positive. This proves posterior propriety for the repaired model.
Completing the conditional squares gives the Gaussian change-point Gibbs updates. DefineThe four updates areAt , , giving its proper prior distribution unchanged. Starting from any finite means, positive variance and allowed , cycle through these four updates using the latest values. The sum-of-squares terms can be evaluated from cumulative data sums; normalize the discrete log weights after subtracting their maximum to avoid numerical underflow. The proper positive conditionals allow movement among all split values and throughout the continuous parameter support.
Under this specified repair, is the posterior probability of no change within the observed sequence: all data points belong to the first mean regime. For retained draws after initialization has ceased to affect the estimates, its Markov chain Monte Carlo estimator isAlternatively average the displayed conditional probability of at the sampled continuous parameters, giving an estimate by Rao-Blackwellization. Autocorrelation must be accounted for in its Monte Carlo uncertainty. These are probabilities and estimators for the explicitly repaired model; the original unnormalizable kernel supplies neither.