The Metropolis-Hastings algorithm allows us to find random samples that, over time, will match samples drawn from P(x)P^*(x) given only the scaled P(x)P(x).1

This is hard to conceptualize without some pictures, so let's explore some examples of what Metropolis-Hastings is solving.


  1. In a way, you can think of this algorithm as a way of approximating integrals: we're estimating xRP(x) dx\int_{x \in \mathbb{R}} P(x)\ dx. That's a fine way of thinking about it, but in Bayesian stats we normally take these samples directly, without going to the extra step of estimating cc.

The Metropolis-Hastings algorithm allows us to find random samples that, over time, will match samples drawn from P(x)P^*(x) given only the scaled P(x)P(x).1

This is hard to conceptualize without some pictures, so let's explore some examples of what Metropolis-Hastings is solving.


  1. In a way, you can think of this algorithm as a way of approximating integrals: we're estimating xRP(x) dx\int_{x \in \mathbb{R}} P(x)\ dx. That's a fine way of thinking about it, but in Bayesian stats we normally take these samples directly, without going to the extra step of estimating cc.