Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 6 b Solution Created 2026-10-03 Updated 2026-10-06
For the off-diagonal moves, the Metropolis–Hastings acceptance probability givesThis expression is unchanged by interchanging and . The rejected-move measure is supported on the diagonal and is also symmetric. Therefore the whole transition measure satisfieswhich proves detailed balance, including the atom that an off-diagonal density alone would omit. Consequently the Metropolis–Hastings algorithm kernel preserves the normalized target measure.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 6 c Solution Created 2026-10-03 Updated 2026-10-06
For coordinate , keep the other coordinates fixed and propose from the full conditional . This is a Metropolis–Hastings algorithm proposal on that coordinate fibre, with deterministic equality . Its acceptance ratio isThus the coordinate update has acceptance probability one and is exactly a single-coordinate Gibbs sampler update.
A systematic sweep through coordinates is the composition of these kernels. Its joint transition density isThe already updated coordinates are new values, and the not-yet-updated coordinates are old values. Each coordinate kernel preserves , so their composition also preserves it. Systematic Gibbs sampling need not be reversible: each individual coordinate kernel is reversible, but their ordered composition need not be reversible; invariance is the property needed here. A random-scan mixture of the coordinate kernels is reversible.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 208 6 d Solution Created 2026-10-03 Updated 2026-10-14
Use the ergodic theorem for a positive Harris recurrent Markov chain: for an invariant distribution and an integrable function , the time average converges almost surely to under the usual ergodicity conditions. This is the relevant theorem for correlated Metropolis–Hastings algorithm output, rather than the strong law of large numbers. Here is integrable. Indeed, puttingwe have , which bounds the unnormalized density by a constant times an integrable Gaussian density and also gives finite first moments.
For a proposal scale , initialize anywhere in . At each step draw independent random variables with the standard normal distribution and an independent uniform , propose , and accept whenOtherwise set . The normal proposal is symmetric, so its density cancels; the target normalizing constant also cancels. Include every state in the average, including repeated states after rejection. The ergodic theorem for a positive Harris recurrent Markov chain then givesA fixed discarded initial segment does not change this limit.
Small proposal variance gives high acceptance but tiny moves and strong serial dependence. Large variance gives more ambitious moves, but many proposals enter very low-density regions and are rejected, creating long runs at one state. An intermediate scale should be assessed by exploration and effective sample size of a Markov chain, not acceptance rate alone.
This density has two modes, at and their interchange. To see this, stationary points satisfy , implying either or . The unequal solutions have and are local minima of ; the equal solution is a saddle. Mode switching is therefore a material part of proposal-scale selection: a chain confined to one mode can have high acceptance and a misleading finite-run estimate.
Two modes of the quartic target density, with the diagonal saddle between them, explaining slow mode switching in random-walk Metropolis-Hastings
. Details. Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 216 5 Solution Created 2026-10-03 Updated 2026-10-05
Let be the standard multivariate normal density. Independence gives the proposal distribution densityFor an orthogonal matrix ,The isotropic Gaussian density is unchanged by this transformation. Since has the same distribution as ,Thus this is an orthogonal-mixture Metropolis proposal with a symmetric density; inversion invariance, rather than any assumption of a uniform distribution on orthogonal matrices, is what is needed.
With , the accepted off-diagonal transitions satisfyThe rejection part is supported on the diagonal and satisfies detailed balance automatically. Values of the acceptance rule at starting points where can be specified separately; they do not affect stationarity under . Therefore the Metropolis–Hastings algorithm kernel is reversible with invariant density , proving
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 219 2 v Solution Created 2026-10-03 Updated 2026-10-05
Let be the normalized density in the transformed coordinates of (iv). Its fixed Gaussian increment gives a symmetric proposal distribution: . For distinct states, the accepted transition density is , where . ThenThe rejection probability gives a mass on the diagonal, which trivially satisfies the same balance identity. Thus , the detailed balance condition, and integrating it proves invariance of the target.
The transformed density includes its Jacobian, so mapping back preserves the desired posterior law. Warmup adaptation is excluded from this fixed-kernel proof. Independent augmentation with is itself a reversible conditional update; alternatively the original joint augmented space can be sampled directly. This is the Metropolis–Hastings algorithm balance argument.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 219 3 d Solution 2026-10-03
Write the target posterior density as and the proposal distribution density as . The Metropolis–Hastings algorithm accepts a proposed move withFor distinct states,which is symmetric in and . The rejection probability supplies the diagonal part, so the entire transition kernel satisfies detailed balance. Integrating the detailed-balance identity over the starting state proves . Hence the posterior is a stationary distribution; an irreducible Markov chain that is also an aperiodic Markov chain converges uniquely to it.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 3 28J i Solution Created 2026-09-24 Updated 2026-10-03
Let be the Markov kernel of the Metropolis–Hastings algorithm. Away from the possibility of remaining at , its transition density isMultiplication by the target density givesThis is detailed balance for every pair of distinct states.
Writefor the rejection probability, soFor every measurable , detailed balance and the Tonelli theorem giveHence is an invariant distribution of the chain.
Past exam of the mathematics course of the University of Cambridge 2021 iii Paper 219 2 c Solution 2026-09-28
The posterior isA random-walk Metropolis–Hastings algorithm proposes from a symmetric density about the current and accepts with probabilityFor distinct states, multiplying the transition density by the target density giveswhich is symmetric and proves detailed balance. Run multiple dispersed chains, tune proposals during warm-up, inspect traces, effective sample sizes and convergence diagnostics, then estimate the period mean by averaging over retained draws.
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 219 2 c Solution Created 2026-09-24 Updated 2026-09-25
Take flat priors on and scale priors on the positive variances. The posterior distribution is thenA random-walk Metropolis–Hastings algorithm can update with a symmetric proposal and accept a proposed state from with probability , including the Jacobian if the target is represented in transformed coordinates. Its transition kernel satisfieswhich is detailed balance; hence the posterior is stationary.
Preconditioned Crank–Nicolson algorithm Created 2026-09-29 Updated 2026-10-03
The preconditioned Crank–Nicolson algorithm, or pCN algorithm, uses a Gaussian autoregressive proposal reversible with respect to a standard normal distribution in a Metropolis–Hastings algorithm. When the target density is a likelihood times the proposal's invariant Gaussian prior density, the Gaussian factors cancel from the Metropolis–Hastings acceptance probability, leaving the likelihood ratio.
Proposal distribution 2026-09-29
At the current state , a Metropolis–Hastings algorithm draws a candidate state from its proposal distribution . The Metropolis–Hastings acceptance probability corrects the proposal's bias so that the target distribution remains invariant.
Spatial Bernoulli infection model 2026-10-14
Given the currently infected set and susceptible set , define and . Conditionally independent new-infection indicators have likelihoodA nonnegative infection intensity requires ; an unrestricted normal distribution prior distribution for must therefore be restricted or replaced. With or and positive distances, the conditional posterior kernels are not generally conjugate normal probability densities. Metropolis–Hastings algorithm updates, optionally on with its Jacobian determinant, provide a direct sampling method.
