Skip to main content

Basics of Markov Chain Monte Carlo

In the first week of the course we discussed the analysis-by-synthesis paradigm and how we can formulate shape model fitting as a Bayesian inference problem. Conceptually, once the problem is formulated in this way, all the information we can extract from a shape or image using our model, is captured in the posterior distribution. In practice, however, extracting this information can be an extremely challenging computational problem.

In this week we will discuss Markov Chain Monte Carlo methods, and in particular the Metropolis-Hastings algorithm. The Metropolis-Hastings algorithm is a method which makes it possible to draw samples from an arbitrary distribution. We will use it to draw samples from our posterior distribution and thus to approximate aspects of this poster distribution using the samples.


  1. The Metropolis-Hastings algorithm (Video, Slides)
  2. Implementing and experimenting with the Metropolis Hastings algorithm (Jupyter-Notebook: View, Run in browser)
  3. Properties and limitations of the Metropolis-hastings algorithm (Video, Slides)
  4. Using the Metropolis-Hastings in Scalismo (Tutorial)

Questions and remarks

Please use our Gitter Chat to ask questions, discuss with your peers or to give us feedback.