Math 2.0

Numerical analysis Definition

Metropolis–Hastings algorithm

Builds on Markov chainTransition matrixDetailed balanceStationary distributionMarkov chain Monte Carlo

Definition

Let SS be a countable set and let π\pi be a probability distribution on SS with π(x)>0\pi(x) > 0 for all x∈Sx \in S. Let Q=(Q(x,y))x,y∈SQ = (Q(x, y))_{x, y \in S} be a transition matrix, the proposal, such that Q(x,y)>0Q(x, y) > 0 if and only if Q(y,x)>0Q(y, x) > 0. For x≠yx \ne y with Q(x,y)>0Q(x, y) > 0, the acceptance probability is α(x,y)=min⁡(1,π(y) Q(y,x)π(x) Q(x,y)).\alpha(x, y) = \min\left(1, \frac{\pi(y) \, Q(y, x)}{\pi(x) \, Q(x, y)}\right). The Metropolis–Hastings chain is the Markov chain (Xn)(X_n) built as follows. Given Xn=xX_n = x, draw YY from Q(x,⋅)Q(x, \cdot). With probability α(x,Y)\alpha(x, Y) set Xn+1=YX_{n+1} = Y; otherwise set Xn+1=xX_{n+1} = x. Its transition matrix has P(x,y)=Q(x,y) α(x,y)P(x, y) = Q(x, y) \, \alpha(x, y) for y≠xy \ne x and P(x,x)=1−∑y≠xP(x,y)P(x, x) = 1 - \sum_{y \ne x} P(x, y).

Remarks

For x≠yx \ne y, π(x)P(x,y)=min⁡(π(x)Q(x,y),π(y)Q(y,x))\pi(x) P(x, y) = \min\left(\pi(x) Q(x, y), \pi(y) Q(y, x)\right), which is symmetric in xx and yy. So PP satisfies detailed balance with respect to π\pi, and π\pi is a stationary distribution. Only the ratio π(y)/π(x)\pi(y)/\pi(x) is used, so π\pi may be known up to a constant factor. Example: if QQ is symmetric, α(x,y)=min⁡(1,π(y)/π(x))\alpha(x, y) = \min(1, \pi(y)/\pi(x)); this special case is the Metropolis algorithm. Non-example: the chain that always accepts the proposal has transition matrix QQ, whose stationary law is in general not π\pi; it skips the acceptance step. The chain is a Markov chain Monte Carlo method when it is also irreducible. The same construction works on general state spaces with densities in place of π\pi and QQ.

Reading path

To understand this page from the ground up, read these 55 pages in order. The foundations come first.

  1. Construction of the reals from Cauchy sequences concept
  2. Detailed balance concept
  3. Element definition
  4. Integers object
  5. Markov chain Monte Carlo concept
  6. Ordered field definition
  7. Proposition concept
  8. Random experiment concept
  9. Rational numbers object
  10. Real numbers object
  11. Stationary distribution concept
  12. Transition matrix concept
  13. Set definition
  14. Ring of integers statement
  15. Disjunction definition
  16. Implication definition
  17. Predicate definition
  18. Ordered pair definition
  19. Union definition
  20. Sample space definition
  21. Existential quantifier definition
  22. Universal quantifier definition
  23. The rationals form a field statement
  24. Cartesian product definition
  25. Subset definition
  26. Uniqueness quantifier definition
  27. The rationals form an ordered field statement
  28. Binary relation definition
  29. Universal set definition
  30. Power set definition
  31. Order on the reals definition
  32. Function definition
  33. Complement definition
  34. Interval definition
  35. Injective function definition
  36. Preimage of a set definition
  37. Sigma-algebra definition
  38. Countable set definition
  39. Event definition
  40. Borel sigma-algebra definition
  41. Probability axioms concept
  42. Probability measure definition
  43. Probability space definition
  44. Conditional probability definition
  45. Random variable definition
  46. Independence of two events definition
  47. Discrete random variable definition
  48. Stochastic process concept
  49. Random variable with a density definition
  50. Conditional independence definition
  51. Expected value definition
  52. Conditional expectation definition
  53. Markov property definition
  54. Markov chain definition
  55. Metropolis–Hastings algorithm definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm
About this page
TagA02K3MKQ3Q
URIm2://A02K3MKQ3Q
Kinddefinition
WritingW0 stub
MSC65C05, 60J22, 65C40
DefinesMetropolis–Hastings algorithm
UsesMarkov chain, Transition matrix, Detailed balance, Stationary distribution, Markov chain Monte Carlo
Changed2 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.