Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
Classes | Namespaces
metropolisHastingsSampler.hpp File Reference

Metropolis-Hastings MCMC sampling engine. More...

#include "../domains/integration_domain.hpp"
#include "../geometry.hpp"
#include <array>
#include <random>
#include <utility>
#include <functional>
#include "metropolisHastingsSampler.tpp"
Include dependency graph for metropolisHastingsSampler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mc::mcmc::MetropolisHastingsSampler< dim >
 Metropolis-Hastings MCMC sampler for arbitrary target distributions. More...
 

Namespaces

namespace  mc
 
namespace  mc::mcmc
 

Detailed Description

Metropolis-Hastings MCMC sampling engine.

Author
Giacomo Merlo
Date
11/01/26

Implements the Metropolis-Hastings algorithm for sampling from arbitrary target probability distributions using Markov Chain Monte Carlo (MCMC).

Algorithm Overview: The Metropolis-Hastings sampler generates a sequence of correlated samples distributed according to a target probability density π(x) by:

  1. Starting at an initial state x₀
  2. Proposing x' = x + N(0, σ²) from a symmetric random walk
  3. Computing acceptance ratio α = min(1, π(x')/π(x))
  4. Accepting x' with probability α, otherwise staying at x

Advantages over rejection sampling:

Key properties:

Note
Requires careful burn-in and thinning for reliable estimates.
See also
Metropolis et al. (1953), Hastings (1970)

Definition in file metropolisHastingsSampler.hpp.