Metropolis chains #
Given a proposal chain Ψ and a target distribution π, the Metropolis chain at x draws a
candidate y ~ Ψ x, accepts it with probability min (π y Ψ(y, x) / (π x Ψ(x, y))) 1 and
otherwise stays at x ([LP17], Section 3.2.2, (3.4)). For a symmetric proposal
the acceptance ratio is π y / π x (Section 3.2.1). Every Metropolis chain is reversible with
respect to π, and so has π as a stationary distribution ([LP17],
Section 3.2 and Exercise 3.1).
The construction is total. Ratios are computed in ℝ≥0∞, where d / 0 = ⊤ for d ≠ 0 and
0 / 0 = 0. So if π x Ψ(x, y) = 0 the move is always accepted when π y Ψ(y, x) ≠ 0 and
always rejected when π y Ψ(y, x) = 0. Either way π x P(x, y) = min (π x Ψ(x, y)) (π y Ψ(y, x))
for x ≠ y. No positivity, irreducibility or symmetry hypothesis is needed for reversibility.
The source divides by π x, so it implicitly assumes π is positive; that assumption is not
needed here.
Main definitions #
Cslib.Probability.MarkovChain.acceptCoin: a coin showingtruewith probabilitymin p 1.Cslib.Probability.MarkovChain.metropolisRatio: the Metropolis–Hastings ratio.Cslib.Probability.MarkovChain.metropolis: the Metropolis chain forΨandπ.
Main results #
Cslib.Probability.MarkovChain.metropolis_apply_of_ne: off-diagonal transition probabilities, [LP17], (3.5).Cslib.Probability.MarkovChain.isReversible_metropolis: detailed balance with respect toπ.Cslib.Probability.MarkovChain.isStationary_metropolis:πis stationary.Cslib.Probability.MarkovChain.metropolisRatio_of_symm: the symmetric-proposal ratio.
References #
- [LP17], Section 3.2.
A coin showing true with probability min p 1.
The Metropolis–Hastings ratio π(y) Ψ(y, x) / (π(x) Ψ(x, y)) for a move from x to y
([LP17], (3.4)); the acceptance probability is its minimum with 1.
The Metropolis chain for the proposal chain Ψ and the target distribution π
([LP17], Section 3.2.2): from x, propose y ~ Ψ x, move to y with probability
min (metropolisRatio Ψ π x y) 1, and otherwise stay at x.
Off the diagonal, the Metropolis chain moves from x to y with probability
Ψ(x, y) min (r(x, y)) 1 ([LP17], (3.5)).
The Metropolis chain satisfies detailed balance with respect to its target distribution:
π(x) P(x, y) = min (π x Ψ(x, y)) (π y Ψ(y, x)) is symmetric in x and y
([LP17], Section 3.2 and Exercise 3.1).
The target distribution is stationary for the Metropolis chain.
For a symmetric proposal, the Metropolis ratio of a possible move is π y / π x
([LP17], Section 3.2.1).