HyperAI

Markov Chain Monte Carlo Method MCMC

MCMC It is an algorithm for sampling from a random distribution based on a Markov chain, which approximates the posterior distribution of the parameter of interest by randomly sampling in the probability space.

The basic theory of MCMC is Markov process. In related algorithms, in order to sample on a specified distribution, we can simulate this process from any state according to the Markov process, and continuously perform state transitions until it finally converges to a stable distribution.

The overall idea is to use a stable distribution to replace the complex distribution, and use this to sample and fit to finally get the distribution of the complex sample.

Common MCMC methods: Metropolis-Hastings sampling, Gibbs sampling

Metropolis-Hastings sampling

1: Initialize the initial state of the Markov chain

2: Sample the following process of cycle

  • At the moment, the state of the Markov chain is , and the sampling
  • Sampling from a uniform distribution
  • If , that is,
  • Otherwise, the transfer is not accepted, that is,

Gibbs Sampling

1: Randomly initialize

2: Cyclic sampling of

References

【1】Getting Started with MCMC

【2】A brief analysis of Markov chain Monte Carlo method