Markov chain Monte Carlo (MCMC)

    Markov chain Monte Carlo is the family of algorithms that Bayesian models use to draw thousands of samples from the posterior when it can't be worked out with a formula.

    Last reviewed

    The algorithm wanders through the space of possible settings, spending more time where the fit to data and priors is better. The collected samples approximate the posterior. It's slow, which is why Bayesian mix models can take from minutes to hours to run, and it needs checking: several independent runs should end up in the same place.

    Topic
    Model quality and Bayesian methods

    Related terms

    Convergence
    Convergence means a Bayesian model's sampling runs have settled on the same distribution, so the results can be treated as a fair picture of the posterior.
    Posterior
    The posterior is a Bayesian model's updated belief about a quantity after combining the prior with the data. It's a distribution, not a single number.
    Bayesian MMM
    A Bayesian mix model combines what you believed about each channel before seeing the data (priors) with what the data show, and reports each result as a range of plausible values.
    PyMC-Marketing
    PyMC-Marketing is an open-source Python library from PyMC Labs for Bayesian marketing analytics, including mix models and customer lifetime value models.

    Want a second opinion?

    Tell us what you're trying to decide and what data you have, and we'll tell you what we'd do. Or take the short readiness quiz first. It's a rough screen, not a verdict. Both open on the home page.