MCMC sampling for dummies


Thomas Wiecki



How is inference actually performed and how does it work? How do we get these magical samples from the posterior? The beauty of probabilistic programming is that you actually don't have to understand how the inference works in order to build models, but it certainly helps. Math and statisics tend to seem complex because when they are taught, no one ever tells you about the intuition behind the concepts (which is usually quite simple) but only hands you some scary math. This blog post is an attempt at trying to explain the intuition behind MCMC sampling (specifically, the random-walk Metropolis algorithm). Critically, we'll be using code examples rather than formulas or math-speak.

For the full example, see:
MCMC sampling for dummies

Work with PyMC Labs

If you are interested in seeing what we at PyMC Labs can do for you, then please email We work with companies at a variety of scales and with varying levels of existing modeling capacity. We also run corporate workshop training events and can provide sessions ranging from introduction to Bayes to more advanced topics.