For the off-diagonal moves, the Metropolis–Hastings acceptance probability gives
This expression is unchanged by interchanging and . The rejected-move measure is supported on the diagonal and is also symmetric. Therefore the whole transition measure satisfies
which 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.
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 is
Thus 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 is
The 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.
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, putting
we 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 when
Otherwise 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 gives
A 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.
Figure 1.
Two modes of the quartic target density, with the diagonal saddle between them, explaining slow mode switching in random-walk Metropolis-Hastings
. Details.
Let be the standard multivariate normal density. Independence gives the proposal distribution density
For 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 satisfy
The 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
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 . Then
The 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.
Write the target posterior density as and the proposal distribution density as . The Metropolis–Hastings algorithm accepts a proposed move with
For 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.
Let be the Markov kernel of the Metropolis–Hastings algorithm. Away from the possibility of remaining at , its transition density is
Multiplication by the target density gives
This is detailed balance for every pair of distinct states.
Write
for the rejection probability, so
For every measurable , detailed balance and the Tonelli theorem give
Hence is an invariant distribution of the chain.
The posterior is
A random-walk Metropolis–Hastings algorithm proposes from a symmetric density about the current and accepts with probability
For distinct states, multiplying the transition density by the target density gives
which 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.
Take flat priors on and scale priors on the positive variances. The posterior distribution is then
A 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 satisfies
which 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.
Given the currently infected set and susceptible set , define and . Conditionally independent new-infection indicators have likelihood
A 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.