> For the complete documentation index, see [llms.txt](https://mc.hohoweiya.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mc.hohoweiya.xyz/mh.md).

# Metropolis-Hastings

![](/files/-LX4ay-suKrRgpveTPZY)

Remarks:

* A sample produced by the above algorithm differs from an iid sample. For one thing, such a sample may involve repeated occurrences of the same value, since rejection of $$Y\_t$$ leads to repetition of $$X^{(t)}$$ at time $$t+1$$ (an impossible occurrence in absolutely continuous iid settings)
* Minimal regularity conditions on both $$f$$ and the conditional distribution $$q$$ for $$f$$ to be the limiting distribution of the chain $$X^{(t)}$$: $$\cup\_{x\in \mathrm{supp}, f}\mathrm{supp}, q(y\mid x)\supset \mathrm{supp},,f$$.
* $$f$$ is the stationary distribution of the Metropolis chain: it satisfies the detailed balance property.

  $$
  K(x,y) = \rho(x,y)q(y\mid x)+(1-r(x))\delta\_x(y),.
  $$

The MH Markov chain has, by construction, an invariant probability distribution $$f$$, if it is also an aperiodic [Harris chain](https://github.com/szcf-weiya/MonteCarlo/tree/7992ce819e3ed5698052814ec15692627f3eaba0/MarkovChain/def_harris_recurrent.png), then we can apply [ergodic theorem](https://github.com/szcf-weiya/MonteCarlo/tree/7992ce819e3ed5698052814ec15692627f3eaba0/MarkovChain/thm_ergodic.png) to establish a [convergence result](https://github.com/szcf-weiya/MonteCarlo/tree/7992ce819e3ed5698052814ec15692627f3eaba0/MH/thm_converge.png).

* A sufficient condition to be aperiodic: allow events such as $${X^{(t+1)}=X^{(t)}}$$.
* Property of irreducibility: sufficient conditions such as positivity of the conditional density $$q$$.
* If the MH chain is $$f$$-irreducible, it is Harris recurrent.
* A somewhat less restrictive condition for irreducibility and aperiodicity.

In the following sections, let's introduce other versions of Metropolis-Hastings.
