Markov chain Monte Carlo
Part of a series on |
Bayesian statistics |
---|
![]() |
Posterior = Likelihood × Prior ÷ Evidence |
Background |
Model building |
Posterior approximation |
Estimators |
Evidence approximation |
Model evaluation |
In statistics, Markov chain Monte Carlo (MCMC) is a class of algorithms used to draw samples from a probability distribution. Given a probability distribution, one can construct a Markov chain whose elements' distribution approximates it – that is, the Markov chain's equilibrium distribution matches the target distribution. The more steps that are included, the more closely the distribution of the sample matches the actual desired distribution.
Markov chain Monte Carlo methods are used to study probability distributions that are too complex or too highly dimensional to study with analytic techniques alone. Various algorithms exist for constructing such Markov chains, including the Metropolis–Hastings algorithm.
General explanation
[edit]
Markov chain Monte Carlo methods create samples from a continuous random variable, with probability density proportional to a known function. These samples can be used to evaluate an integral over that variable, as its expected value or variance.
Practically, an ensemble of chains is generally developed, starting from a set of points arbitrarily chosen and sufficiently distant from each other. These chains are stochastic processes of "walkers" which move around randomly according to an algorithm that looks for places with a reasonably high contribution to the integral to move into next, assigning them higher probabilities.
Random walk Monte Carlo methods are a kind of random simulation or Monte Carlo method. However, whereas the random samples of the integrand used in a conventional Monte Carlo integration are statistically independent, those used in MCMC are autocorrelated. Correlations of samples introduces the need to use the Markov chain central limit theorem when estimating the error of mean values.
These algorithms create Markov chains such that they have an equilibrium distribution which is proportional to the function given.
History
[edit]The development of MCMC methods is deeply rooted in the early exploration of Monte Carlo (MC) techniques in the mid-20th century, particularly in physics, marked by the Metropolis algorithm proposed by Nicholas Metropolis, Arianna W. Rosenbluth, Marshall Rosenbluth, Augusta H. Teller, and Edward Teller in 1953, designed to tackle high-dimensional integration problems using early computers. W. K. Hastings generalized this algorithm in 1970 and inadvertently introduced the component-wise updating idea later known as Gibbs sampling, while theoretical foundations for Gibbs sampling, such as the Hammersley–Clifford theorem (published via Julian Besag's 1974 paper), were also developing. Although the seeds of MCMC were sown earlier, including the formal naming of Gibbs sampling in image processing by Stuart Geman and Donald Geman (1984) and the data augmentation method by Martin A. Tanner and Wing Hung Wong (1987), its "revolution" in mainstream statistics largely followed demonstrations of the universality and ease of implementation of sampling methods (especially Gibbs sampling) for complex statistical (particularly Bayesian) problems, spurred by increasing computational power and software like BUGS. This transformation was accompanied by significant theoretical advancements, such as Luke Tierney's (1994) rigorous treatment of MCMC convergence, and Jun S. Liu, Wong, and Augustine Kong's (1994, 1995) analysis of Gibbs sampler structure. Subsequent developments further expanded the MCMC toolkit, including particle filters (Sequential Monte Carlo) for sequential problems, Perfect sampling aiming for exact simulation (Jim Propp and David B. Wilson, 1996), RJMCMC (Peter J. Green, 1995) for handling variable-dimension models, and deeper investigations into convergence diagnostics and the central limit theorem. Overall, the evolution of MCMC represents a paradigm shift in statistical computation, enabling the analysis of numerous previously intractable complex models and continually expanding the scope and impact of statistics. [1]
Mathematical Setting
[edit]Suppose (Xₙ) is a Markov Chain in the general state space with specific properties. We are interested in the limiting behavior of the partial sums:
as n goes to infinity. Particularly, we hope to establish the Law of Large Numbers and the Central Limit Theorem for MCMC. In the following, we state some definitions and theorems necessary for the important convergence results[2]. In short, we need the existence of invariant measure and Harris recurrent to establish the Law of Large Numbers of MCMC (Ergodic Theorem). And we need aperiodicity, irreducibility and extra conditions such as reversibility to ensure the Central Limit Theorem holds in MCMC.
Irreducibility and Aperiodicity
[edit]Recall that in the discrete setting, a Markov chain is said to be irreducible if it is possible to reach any state from any other state in a finite number of steps with positive probability. However, in the continuous setting, point-to-point transitions have zero probability. In this case, φ-irreducibility generalizes irreducibility by using a reference measure φ on the measurable space .
- Definition (φ-irreducibility)
Given a measure defined on , the Markov chain with transition kernel is φ-irreducible if, for every with , there exists such that for all (Equivalently, , here is the first for which the chain enters the set ).
This is a more general definition for irreducibility of a Markov chain in non-discrete state space. In the discrete case, an irreducible Markov chain is said to be aperiodic if it has period 1. Formally, the period of a state is defined as:
For the general (non-discrete) case, we define aperiodicity in terms of small sets:
- Definition (Cycle length and small sets)
A φ-irreducible Markov chain has a cycle of length d if there exists a small set , an associated integer , and a probability distribution such that d is the greatest common divisor of:
A set is called small if there exists and a nonzero measure such that:
Harris recurrent
[edit]- Definition (Harris recurrence)
A set is Harris recurrent if for all , where is the number of visits of the chain to the set .
The chain is said to be Harris recurrent if there exists a measure such that the chain is -irreducible and every measurable set with is Harris recurrent.
A useful criterion for verifying Harris recurrence is the following:
- Proposition
If for every , we have for every , then for all , and the chain is Harris recurrent.
This definition is only needed when the state space is uncountable. In the countable case, recurrence corresponds to , which is equivalent to for all .
- Definition (Invariant measure)
A -finite measure is said to be invariant for the transition kernel (and the associated chain) if:
When there exists an invariant probability measure for a ψ-irreducible (hence recurrent) chain, the chain is said to be positive recurrent. Recurrent chains that do not allow for a finite invariant measure are called null recurrent.
In applications of Markov Chain Monte Carlo (MCMC), a very useful criterion for Harris recurrence involves the use of bounded harmonic functions.
- Definition (Harmonic function)
A measurable function is said to be harmonic for the chain if:
These functions are invariant under the transition kernel in the functional sense, and they help characterize Harris recurrence.
- Proposition
For a positive Markov chain, if the only bounded harmonic functions are the constant functions, then the chain is Harris recurrent.
Law of Large Numbers for MCMC
[edit]- Theorem (Ergodic Theorem for MCMC)
If has a -finite invariant measure , then the following two statements are equivalent:
- The Markov chain is Harris recurrent.
- If with , then
This theorem provides a fundamental justification for the use of Markov Chain Monte Carlo (MCMC) methods, and it serves as the counterpart of the Law of Large Numbers (LLN) in classical Monte Carlo.
An important aspect of this result is that does not need to be a probability measure. Therefore, there can be some type of strong stability even if the chain is null recurrent. Moreover, the Markov chain can be started from arbitrary state.
If is a probability measure, we can let and get
This is the Ergodic Theorem that we are more familiar with.
Central Limit Theorem for MCMC
[edit]There are several conditions under which the Central Limit Theorem (CLT) holds for Markov chain Monte Carlo (MCMC) methods. One of the most commonly used is the condition of reversibility.
- Definition (Reversibility)
A stationary Markov chain is said to be reversible if the distribution of given is the same as the distribution of given .
This is equivalent to the detailed balance condition, which is defined as follows:
- Definition (Detailed balance)
A Markov chain with transition kernel satisfies the detailed balance condition if there exists a function such that:
for every pair in the state space.
- Theorem (CLT under reversibility)
If is aperiodic, irreducible, and reversible with invariant distribution , then:
where
and
- .
Even though reversibility is a restrictive assumption in theory, it is often easily satisfied in practical MCMC algorithms by introducing auxiliary variables or using symmetric proposal mechanisms. There are many other conditions that can be used to establish CLT for MCMC such as geometirc ergodicity and the discrete state space.
Autocorrelation
[edit]MCMC methods produce autocorrelated samples, in contrast to standard Monte Carlo techniques that draw independent samples. Autocorrelation means successive draws from the Markov chain are statistically dependent, so each new sample adds less fresh information than an independent draw would. As a result, one must account for this correlation when assessing the accuracy of estimates from the chain. In particular, positive autocorrelation in the chain increases the variance of estimators and slows the convergence of sample averages toward the true expectation.
Autocorrelation and efficiency
[edit]The effect of correlation on estimation can be quantified through the Markov chain central limit theorem. For a chain targeting a distribution with variance , the variance of the sample mean after steps is approximately , where is an effective sample size smaller than . Equivalently, one can express this as:
where is the sample mean and is the autocorrelation of the chain at lag , defined as . The term in parentheses, , is often called the integrated autocorrelation. When the chain has no autocorrelation ( for all ), this factor equals 1, and one recovers the usual variance for independent samples. If the chain’s samples are highly correlated, the sum of autocorrelations is large, leading to a much bigger variance for than in the independent case.
Effective sample size (ESS)
[edit]The effective sample size is a useful diagnostic that translates the autocorrelation in a chain into an equivalent number of independent samples. It is defined by the formula:
so that is the number of independent draws that would yield the same estimation precision as the dependent draws from the Markov chain. For example, if , then , meaning the chain of length carries information equivalent to independent samples. In an ideal scenario with no correlation, and thus . But in a poorly mixing chain with strong autocorrelation, can be much smaller than . In practice, monitoring the ESS for each parameter is a way to gauge how much correlation is present: a low ESS indicates that many more iterations may be needed to achieve a desired effective sample of independent draws.
Reducing correlation
[edit]While MCMC methods were created to address multi-dimensional problems better than generic Monte Carlo algorithms, when the number of dimensions rises they too tend to suffer the curse of dimensionality: regions of higher probability tend to stretch and get lost in an increasing volume of space that contributes little to the integral. One way to address this problem could be shortening the steps of the walker, so that it does not continuously try to exit the highest probability region, though this way the process would be highly autocorrelated and expensive (i.e. many steps would be required for an accurate result). More sophisticated methods such as Hamiltonian Monte Carlo and the Wang and Landau algorithm use various ways of reducing this autocorrelation, while managing to keep the process in the regions that give a higher contribution to the integral. These algorithms usually rely on a more complicated theory and are harder to implement, but they usually converge faster.
We outline several general strategies such as reparameterization, adaptive proposal tuning, parameter blocking, and overrelaxation that help reduce correlation and improve sampling efficiency within the standard MCMC framework.
Reparameterization
[edit]One way to reduce autocorrelation is to reformulate or reparameterize the statistical model so that the posterior geometry leads to more efficient sampling. By changing the coordinate system or using alternative variable definitions, one can often lessen correlations. For example, in Bayesian hierarchical modeling, a non-centered parameterization can be used in place of the standard (centered) formulation to avoid extreme posterior correlations between latent and higher-level parameters. This involves expressing latent variables in terms of independent auxiliary variables, dramatically improving mixing. Such reparameterization strategies are commonly employed in both Gibbs sampling and Metropolis–Hastings algorithm to enhance convergence and reduce autocorrelation.[3]
Proposal tuning and adaptation
[edit]Another approach to reducing correlation is to improve the MCMC proposal mechanism. In Metropolis–Hastings algorithm, step size tuning is critical: if the proposed steps are too small, the sampler moves slowly and produces highly correlated samples; if the steps are too large, many proposals are rejected, resulting in repeated values. Adjusting the proposal step size during an initial testing phase helps find a balance where the sampler explores the space efficiently without too many rejections.
Adaptive MCMC methods modify proposal distributions based on the chain's past samples. For instance, adaptive metropolis algorithm updates the Gaussian proposal distribution using the full information accumulated from the chain so far, allowing the proposal to adapt over time.[4]
Parameter blocking
[edit]Parameter blocking is a technique that reduces autocorrelation in MCMC by updating parameters jointly rather than one at a time. When parameters exhibit strong posterior correlations, one-by-one updates can lead to poor mixing and slow exploration of the target distribution. By identifying and sampling blocks of correlated parameters together, the sampler can more effectively traverse high-density regions of the posterior.
Parameter blocking is commonly used in both Gibbs sampling and Metropolis–Hastings algorithms. In blocked Gibbs sampling, entire groups of variables are updated conditionally at each step.[5] In Metropolis–Hastings, multivariate proposals enable joint updates (i.e., updates of multiple parameters at once using a vector-valued proposal distribution, typically a multivariate Gaussian), though they often require careful tuning of the proposal covariance matrix.[6]
Overrelaxation
[edit]Overrelaxation is a technique to reduce autocorrelation between successive samples by proposing new samples that are negatively correlated with the current state. This helps the chain explore the posterior more efficiently, especially in high-dimensional Gaussian models or when using Gibbs sampling. The basic idea is to reflect the current sample across the conditional mean, producing proposals that retain the correct stationary distribution but with reduced serial dependence. Overrelaxation is particularly effective when combined with Gaussian conditional distributions, where exact reflection or partial overrelaxation can be analytically implemented.[7]
Examples
[edit]Random walk Monte Carlo methods
[edit]- Metropolis–Hastings algorithm: This method generates a Markov chain using a proposal density for new steps and a method for rejecting some of the proposed moves. It is actually a general framework which includes as special cases the very first and simpler MCMC (Metropolis algorithm) and many more recent variants listed below.
- Gibbs sampling: When target distribution is multi-dimensional, Gibbs sampling algorithm[8] updates each coordinate from its full conditional distribution given other coordinates. Gibbs sampling can be viewed as a special case of Metropolis–Hastings algorithm with acceptance rate uniformly equal to 1. When drawing from the full conditional distributions is not straightforward other samplers-within-Gibbs are used (e.g., see [9][10]). Gibbs sampling is popular partly because it does not require any 'tuning'. Algorithm structure of the Gibbs sampling highly resembles that of the coordinate ascent variational inference in that both algorithms utilize the full-conditional distributions in the updating procedure.[11]
- Metropolis-adjusted Langevin algorithm and other methods that rely on the gradient (and possibly second derivative) of the log target density to propose steps that are more likely to be in the direction of higher probability density.[12]
- Hamiltonian (or hybrid) Monte Carlo (HMC): Tries to avoid random walk behaviour by introducing an auxiliary momentum vector and implementing Hamiltonian dynamics, so the potential energy function is the target density. The momentum samples are discarded after sampling. The result of hybrid Monte Carlo is that proposals move across the sample space in larger steps; they are therefore less correlated and converge to the target distribution more rapidly.
- Pseudo-marginal Metropolis–Hastings: This method replaces the evaluation of the density of the target distribution with an unbiased estimate and is useful when the target density is not available analytically, e.g. latent variable models.
- Slice sampling: This method depends on the principle that one can sample from a distribution by sampling uniformly from the region under the plot of its density function. It alternates uniform sampling in the vertical direction with uniform sampling from the horizontal 'slice' defined by the current vertical position.
- Multiple-try Metropolis: This method is a variation of the Metropolis–Hastings algorithm that allows multiple trials at each point. By making it possible to take larger steps at each iteration, it helps address the curse of dimensionality.
- Reversible-jump: This method is a variant of the Metropolis–Hastings algorithm that allows proposals that change the dimensionality of the space.[13] Markov chain Monte Carlo methods that change dimensionality have long been used in statistical physics applications, where for some problems a distribution that is a grand canonical ensemble is used (e.g., when the number of molecules in a box is variable). But the reversible-jump variant is useful when doing Markov chain Monte Carlo or Gibbs sampling over nonparametric Bayesian models such as those involving the Dirichlet process or Chinese restaurant process, where the number of mixing components/clusters/etc. is automatically inferred from the data.
Interacting particle methods
[edit]Interacting MCMC methodologies are a class of mean-field particle methods for obtaining random samples from a sequence of probability distributions with an increasing level of sampling complexity.[14] These probabilistic models include path space state models with increasing time horizon, posterior distributions w.r.t. sequence of partial observations, increasing constraint level sets for conditional distributions, decreasing temperature schedules associated with some Boltzmann–Gibbs distributions, and many others. In principle, any Markov chain Monte Carlo sampler can be turned into an interacting Markov chain Monte Carlo sampler. These interacting Markov chain Monte Carlo samplers can be interpreted as a way to run in parallel a sequence of Markov chain Monte Carlo samplers. For instance, interacting simulated annealing algorithms are based on independent Metropolis–Hastings moves interacting sequentially with a selection-resampling type mechanism. In contrast to traditional Markov chain Monte Carlo methods, the precision parameter of this class of interacting Markov chain Monte Carlo samplers is only related to the number of interacting Markov chain Monte Carlo samplers. These advanced particle methodologies belong to the class of Feynman–Kac particle models,[15][16] also called Sequential Monte Carlo or particle filter methods in Bayesian inference and signal processing communities.[17] Interacting Markov chain Monte Carlo methods can also be interpreted as a mutation-selection genetic particle algorithm with Markov chain Monte Carlo mutations.
Quasi-Monte Carlo
[edit]The quasi-Monte Carlo method is an analog to the normal Monte Carlo method that uses low-discrepancy sequences instead of random numbers.[18][19] It yields an integration error that decays faster than that of true random sampling, as quantified by the Koksma–Hlawka inequality. Empirically it allows the reduction of both estimation error and convergence time by an order of magnitude.[18] Markov chain quasi-Monte Carlo methods[20][21] such as the Array–RQMC method combine randomized quasi–Monte Carlo and Markov chain simulation by simulating chains simultaneously in a way that better approximates the true distribution of the chain than with ordinary MCMC.[22] In empirical experiments, the variance of the average of a function of the state sometimes converges at rate or even faster, instead of the Monte Carlo rate.[23]
Applications
[edit]MCMC methods are primarily used for calculating numerical approximations of multi-dimensional integrals, for example in Bayesian statistics, computational physics,[24] computational biology[25] and computational linguistics.[26][27]
Bayesian Statistics
[edit]In Bayesian statistics, Markov chain Monte Carlo methods are typically used to calculate moments and credible intervals of posterior probability distributions. The use of MCMC methods makes it possible to compute large hierarchical models that require integrations over hundreds to thousands of unknown parameters.[28]
Statistical Physics
[edit]Many contemporary research problems in statistical physics can be addressed by approximate solutions using Monte Carlo simulation, which provides valuable insights into the properties of complex systems. Monte Carlo methods are fundamental in computational physics, physical chemistry, and related disciplines, with broad applications including medical physics, where they are employed to model radiation transport for radiation dosimetry calculations[29][30]. Instead of exhaustively analyzing all possible system states, the Monte Carlo method randomly examines a subset of them to form a representative sample, and yields accurate approximations of the system’s characteristic properties. As the number of sampled states increases, the error can be further reduced to a lower level.
Complex Distribution Sampling
[edit]
Langevin Dynamics are typically used in complex distribution sampling and generative modeling[31][32], via an MCMC procedure. Specifically, given the probability density function , we use its log gradient as the score function and start from a prior distribution . Then, a chain is built by
for . When and , converges to a sample from the target distribution .
For some complex distribution, if we know its probability density function but find it difficult to directly sample from it, we can apply Langevin Dynamics as an alternate. However, in most cases, especially generative modeling, usually we do not know the exact probability density function of the target distribution we wish to sample from, neither the score function . In this case, score matching methods[33][34][35] provide feasible solutions, minimizing the Fisher information metric between a parameterized score-based model and the score function without knowing the ground-truth data score. The score function can be estimated on a training dataset by stochastic gradient descent.
In real cases, however, the training data only takes a small region of the target distribution, and the estimated score functions are inaccurate in other low density regions with fewer available data examples. To overcome this challenge, denoising score matching[32][34][36] methods purturb the available data examples with noise of different scales, which can improve the coverage of low density regions, and use them as the training dataset for the score-base model. Note that the choice of noise scales is tricky, as too large noise will corrupt the original data, while too small noise will not populate the original data to those low density regions. Thus, carefully crafted noise schedules[32][35][36] are applied for higher quality generation.
Convergence
[edit]Usually it is not hard to construct a Markov chain with the desired properties. The more difficult problem is to determine (1) when to start collecting statistics and (2) how many steps are needed to converge to the stationary distribution within an acceptable error.[37][38] Fortunately, there are a variety of practical diagnostics to empirically assess convergence.
Total Variation Distance
[edit]Formally, let denote the stationary distribution and the distribution of the Markov chain after steps starting from state . Theoretically, convergence can be quantified by measuring the total variation distance:
A chain is said to mix rapidly if for all within a small number of steps under a pre-defined tolerance . In other words, the stationary distribution is reached quickly starting from an arbitrary position, and the minimum such is known as the mixing time. In practice, however, the total variation distance is generally intractable to compute, especially in high-dimensional problems or when the stationary distribution is only known up to a normalizing constant (as in most Bayesian applications).
Gelman-Rubin Diagnostics
[edit]The Gelman-Rubin statistic, also known as the potential scale reduction factor (PSRF), evaluates MCMC convergence by sampling multiple independent Markov chains and comparing within-chain and between-chain variances.[39] If all chains have converged to the same stationary distribution, the between-chain and within-chain variances should be similar, and thus the PSRF must approach 1. In practice, a value of is often taken as evidence of convergence. Higher values suggest that the chains are still exploring different parts of the target distribution.
Geweke Diagnostics
[edit]The Geweke diagnostic examines whether the distribution of samples in the early part of the Markov chain is statistically indistinguishable from the distribution in a later part.[40] Given a sequence of correlated MCMC samples , the diagnostic splits the chain into an early segment consisting of the first samples, typically chosen as (i.e., the first 10% of the chain), and a late segment consisting of the last samples, typically chosen as (i.e., the last 50% of the chain)
Denote the sample means of these segments as:
Since MCMC samples are autocorrelated, a simple comparison of sample means is insufficient. Instead, the difference in means is standardized using an estimator of the spectral density at zero frequency, which accounts for the long-range dependencies in the chain. The test statistic is computed as:
where is an estimate of the long-run variance (i.e., the spectral density at frequency zero), commonly estimated using Newey-West estimators or batch means. Under the null hypothesis of convergence, the statistic follows an approximately standard normal distribution .
If , the null hypothesis is rejected at the 5% significance level, suggesting that the chain has not yet reached stationarity.
Heidelberger-Welch Diagnostics
[edit]The Heidelberger-Welch diagnostic is grounded in spectral analysis and Brownian motion theory, and is particularly useful in the early stages of simulation to determine appropriate burn-in and stopping time.[41][42] The diagnostic comprises of two components, a stationarity test that assesses whether the Markov chain has reached a steady-state, and a half-width test that determines whether the estimated expectation is within a user-specified precision.
Stationary Test
[edit]Let be the output of an MCMC simulation for a scalar function , and the evaluations of the function over the chain. Define the standardized cumulative sum process:
where is the sample mean and is an estimate of the spectral density at frequency zero.
Under the null hypothesis of convergence, the process converges in distribution to a Brownian bridge. The following Cramér-von Mises statistic is used to test for stationarity:
This statistic is compared against known critical values from the Brownian bridge distribution. If the null hypothesis is rejected, the first 10% of the samples are discarded and the test can be repeated on the remaining chain until either stationarity is accepted or 50% of the chain is discarded.
Half-Width Test (Precision Check)
[edit]Once stationarity is accepted, the second part of the diagnostic checks whether the Monte Carlo estimator is accurate enough for practical use. Assuming the central limit theorem holds, the confidence interval for the mean is given by
where is an estimate of the variance of , is the Student's critical value at confidence level and degrees of freedom , is the number of samples used.
The half-width of this interval is defined as
If the half-width is smaller than a user-defined tolerance (e.g., 0.05), the chain is considered long enough to estimate the expectation reliably. Otherwise, the simulation should be extended.
Raftery-Lewis Diagnostics
[edit]The Raftery-Lewis diagnostic is specifically designed to assess how many iterations are needed to estimate quantiles or tail probabilities of the target distribution with a desired accuracy and confidence.[43] Unlike Gelman-Rubin or Geweke diagnostics, which are based on assessing convergence to the entire distribution, the Raftery-Lewis diagnostic is goal-oriented as it provides estimates for the number of samples required to estimate a specific quantile of interest within a desired margin of error.
Let denote the desired quantile (e.g., 0.025) of a real-valued function : in other words, the goal is to find such that . Suppose we wish to estimate this quantile such that the estimate falls within margin of the true value with probability . That is, we want
The diagnostic proceeds by converting the output of the MCMC chain into a binary sequence:
where is the indicator function. The sequence is treated as a realization from a two-state Markov chain. While this may not be strictly true, it is often a good approximation in practice.
From the empirical transitions in the binary sequence, the Raftery-Lewis method estimates:
- The minimum number of iterations required to achieve the desired precision and confidence for estimating the quantile is obtained based on asymptotic theory for Bernoulli processes:
where is the standard normal quantile function.
- The burn-in period is calculated using eigenvalue analysis of the transition matrix to estimate the number of initial iterations needed for the Markov chain to forget its initial state.
Software
[edit]Several software programs provide MCMC sampling capabilities, for example:
- ParaMonte parallel Monte Carlo software available in multiple programming languages including C, C++, Fortran, MATLAB, and Python.
- Packages that use dialects of the BUGS model language:
- MCSim
- Julia language with packages like
- Turing.jl
- DynamicHMC.jl
- AffineInvariantMCMC.jl
- Gen.jl
- and the ones in StanJulia repository.
- Python (programming language) with the packages:
- R (programming language) with the packages adaptMCMC, atmcmc, BRugs, mcmc, MCMCpack, ramcmc, rjags, rstan, etc.
- Stan
- TensorFlow Probability (probabilistic programming library built on TensorFlow)
- Korali high-performance framework for Bayesian UQ, optimization, and reinforcement learning.
- MacMCMC — Full-featured application (freeware) for MacOS, with advanced functionality, available at causaScientia
See also
[edit]- Coupling from the past
- Integrated nested Laplace approximations
- Markov chain central limit theorem
- Metropolis-adjusted Langevin algorithm
References
[edit]Citations
[edit]- ^ Robert, Christian; Casella, George (2011). "A short history of Markov chain Monte Carlo: Subjective recollections from incomplete data". Statistical Science. 26 (1): 102–115. doi:10.1214/10-STS351.
- ^ Robert and Casella (2004), pp. 205–246
- ^ Papaspiliopoulos, Omiros; Roberts, Gareth O.; Sköld, Martin (2007). "A general framework for the parametrization of hierarchical models". Statistical Science. 22 (1). Institute of Mathematical Statistics: 59–73. doi:10.1214/088342307000000014.
- ^ Haario, Heikki; Saksman, Eero; Tamminen, Johanna (2001). "An adaptive Metropolis algorithm". Bernoulli. 7 (2): 223–242. doi:10.2307/3318737. JSTOR 3318737.
- ^ Óli Páll Geirsson, Birgir Hrafnkelsson, and Helgi Sigurðarson (2015). "A Block Gibbs Sampling Scheme for Latent Gaussian Models." arXiv preprint [arXiv:1506.06285](https://arxiv.org/abs/1506.06285).
- ^ Siddhartha Chib and Srikanth Ramamurthy (2009). "Tailored Randomized Block MCMC Methods with Application to DSGE Models." *Journal of Econometrics*, 155(1), 19–38. doi:10.1016/j.jeconom.2009.08.003
- ^ Piero Barone, Giovanni Sebastiani, and Jonathan Stander (2002). "Over-relaxation methods and coupled Markov chains for Monte Carlo simulation." Statistics and Computing, 12(1), 17–26. doi:10.1023/A:1013112103963
- ^ Geman, Stuart; Geman, Donald (November 1984). "Stochastic Relaxation, Gibbs Distributions, and the Bayesian Restoration of Images". IEEE Transactions on Pattern Analysis and Machine Intelligence. PAMI-6 (6): 721–741. doi:10.1109/TPAMI.1984.4767596. ISSN 0162-8828. PMID 22499653. S2CID 5837272.
- ^ Gilks, W. R.; Wild, P. (1992-01-01). "Adaptive Rejection Sampling for Gibbs Sampling". Journal of the Royal Statistical Society. Series C (Applied Statistics). 41 (2): 337–348. doi:10.2307/2347565. JSTOR 2347565.
- ^ Gilks, W. R.; Best, N. G.; Tan, K. K. C. (1995-01-01). "Adaptive Rejection Metropolis Sampling within Gibbs Sampling". Journal of the Royal Statistical Society. Series C (Applied Statistics). 44 (4): 455–472. doi:10.2307/2986138. JSTOR 2986138.
- ^ Lee, Se Yoon (2021). "Gibbs sampler and coordinate ascent variational inference: A set-theoretical review". Communications in Statistics - Theory and Methods. 51 (6): 1–21. arXiv:2008.01006. doi:10.1080/03610926.2021.1921214. S2CID 220935477.
- ^ See Stramer 1999.
- ^ See Green 1995.
- ^ Del Moral, Pierre (2013). Mean field simulation for Monte Carlo integration. Chapman & Hall/CRC Press. p. 626.
- ^ Del Moral, Pierre (2004). Feynman–Kac formulae. Genealogical and interacting particle approximations. Springer. p. 575.
- ^ Del Moral, Pierre; Miclo, Laurent (2000). "Branching and Interacting Particle Systems Approximations of Feynman-Kac Formulae with Applications to Non-Linear Filtering". In Jacques Azéma; Michel Ledoux; Michel Émery; Marc Yor (eds.). Séminaire de Probabilités XXXIV (PDF). Lecture Notes in Mathematics. Vol. 1729. pp. 1–145. doi:10.1007/bfb0103798. ISBN 978-3-540-67314-9.
- ^ Del Moral, Pierre (2006). "Sequential Monte Carlo samplers". Journal of the Royal Statistical Society. Series B (Statistical Methodology). 68 (3): 411–436. arXiv:cond-mat/0212648. doi:10.1111/j.1467-9868.2006.00553.x. S2CID 12074789.
- ^ a b Papageorgiou, Anargyros; Traub, Joseph (1996). "Beating Monte Carlo" (PDF). Risk. 9 (6): 63–65.
- ^ Sobol, Ilya M (1998). "On quasi-monte carlo integrations". Mathematics and Computers in Simulation. 47 (2): 103–112. doi:10.1016/s0378-4754(98)00096-2.
- ^ Chen, S.; Dick, Josef; Owen, Art B. (2011). "Consistency of Markov chain quasi-Monte Carlo on continuous state spaces". Annals of Statistics. 39 (2): 673–701. arXiv:1105.1896. doi:10.1214/10-AOS831.
- ^ Tribble, Seth D. (2007). Markov chain Monte Carlo algorithms using completely uniformly distributed driving sequences (Diss.). Stanford University. ProQuest 304808879.
- ^ L'Ecuyer, P.; Lécot, C.; Tuffin, B. (2008). "A Randomized Quasi-Monte Carlo Simulation Method for Markov Chains" (PDF). Operations Research. 56 (4): 958–975. doi:10.1287/opre.1080.0556.
- ^ L'Ecuyer, P.; Munger, D.; Lécot, C.; Tuffin, B. (2018). "Sorting Methods and Convergence Rates for Array-RQMC: Some Empirical Comparisons". Mathematics and Computers in Simulation. 143: 191–201. doi:10.1016/j.matcom.2016.07.010.
- ^ Kasim, M.F.; Bott, A.F.A.; Tzeferacos, P.; Lamb, D.Q.; Gregori, G.; Vinko, S.M. (September 2019). "Retrieving fields from proton radiography without source profiles". Physical Review E. 100 (3): 033208. arXiv:1905.12934. Bibcode:2019PhRvE.100c3208K. doi:10.1103/PhysRevE.100.033208. PMID 31639953. S2CID 170078861.
- ^ Gupta, Ankur; Rawlings, James B. (April 2014). "Comparison of Parameter Estimation Methods in Stochastic Chemical Kinetic Models: Examples in Systems Biology". AIChE Journal. 60 (4): 1253–1268. Bibcode:2014AIChE..60.1253G. doi:10.1002/aic.14409. PMC 4946376. PMID 27429455.
- ^ See Gill 2008.
- ^ See Robert & Casella 2004.
- ^ Banerjee, Sudipto; Carlin, Bradley P.; Gelfand, Alan P. (2014-09-12). Hierarchical Modeling and Analysis for Spatial Data (Second ed.). CRC Press. p. xix. ISBN 978-1-4398-1917-3.
- ^ Jia, Xun; Ziegenhein, Peter; Jiang, Steve B. (2014-02-21). "GPU-based high-performance computing for radiation therapy". Physics in Medicine and Biology. 59 (4): R151–182. Bibcode:2014PMB....59R.151J. doi:10.1088/0031-9155/59/4/R151. ISSN 1361-6560. PMC 4003902. PMID 24486639.
- ^ Rogers, D. W. O. (July 2006). "REVIEW: Fifty years of Monte Carlo simulations for medical physics". Physics in Medicine and Biology. 51 (13): R287 – R301. Bibcode:2006PMB....51R.287R. doi:10.1088/0031-9155/51/13/R17. ISSN 0031-9155. PMID 16790908.
- ^ Hinton, Geoffrey E. (2002-08-01). "Training Products of Experts by Minimizing Contrastive Divergence". Neural Computation. 14 (8): 1771–1800. doi:10.1162/089976602760128018. ISSN 0899-7667. PMID 12180402.
- ^ a b c Song, Yang; Ermon, Stefano (2019-12-08), "Generative modeling by estimating gradients of the data distribution", Proceedings of the 33rd International Conference on Neural Information Processing Systems, no. 1067, Red Hook, NY, USA: Curran Associates Inc., pp. 11918–11930, retrieved 2025-04-28
- ^ Hyvärinen, Aapo (2005). "Estimation of Non-Normalized Statistical Models by Score Matching". Journal of Machine Learning Research. 6 (24): 695–709. ISSN 1533-7928.
- ^ a b Vincent, Pascal (July 2011). "A Connection Between Score Matching and Denoising Autoencoders". Neural Computation. 23 (7): 1661–1674. doi:10.1162/NECO_a_00142. ISSN 0899-7667. PMID 21492012.
- ^ a b Song, Yang; Garg, Sahaj; Shi, Jiaxin; Ermon, Stefano (2020-08-06). "Sliced Score Matching: A Scalable Approach to Density and Score Estimation". Proceedings of the 35th Uncertainty in Artificial Intelligence Conference. PMLR: 574–584.
- ^ a b Song, Yang; Ermon, Stefano (2020-12-06). "Improved techniques for training score-based generative models". Proceedings of the 34th International Conference on Neural Information Processing Systems. NIPS '20. Red Hook, NY, USA: Curran Associates Inc.: 12438–12448. ISBN 978-1-7138-2954-6.
- ^ Cowles, M.K.; Carlin, B.P. (1996). "Markov chain Monte Carlo convergence diagnostics: a comparative review". Journal of the American Statistical Association. 91 (434): 883–904. CiteSeerX 10.1.1.53.3445. doi:10.1080/01621459.1996.10476956.
- ^ Roy, Vivekananda (2020-03-07). "Convergence Diagnostics for Markov Chain Monte Carlo". Annual Review of Statistics and Its Application. 7 (1): 387–412. arXiv:1909.11827. Bibcode:2020AnRSA...7..387R. doi:10.1146/annurev-statistics-031219-041300. ISSN 2326-8298.
- ^ Gelman, A.; Rubin, D.B. (1992). "Inference from iterative simulation using multiple sequences (with discussion)" (PDF). Statistical Science. 7 (4): 457–511. Bibcode:1992StaSc...7..457G. doi:10.1214/ss/1177011136.
- ^ Geweke, John (1992-08-13), Bernardo, J M; Berger, J O; Dawid, P; Smith, A F M (eds.), "Evaluating the Accuracy of Sampling-Based Approaches to the Calculation of Posterior Moments", Bayesian Statistics 4, Oxford University PressOxford, pp. 169–194, doi:10.1093/oso/9780198522669.003.0010, ISBN 978-0-19-852266-9, retrieved 2025-04-29
- ^ Heidelberger, Philip; Welch, Peter D. (1981-04-01). "A spectral method for confidence interval generation and run length control in simulations". Commun. ACM. 24 (4): 233–245. doi:10.1145/358598.358630. ISSN 0001-0782.
- ^ Heidelberger, Philip; Welch, Peter D. (1983-12-01). "Simulation Run Length Control in the Presence of an Initial Transient". Operations Research. 31 (6): 1109–1144. doi:10.1287/opre.31.6.1109. ISSN 0030-364X.
- ^ Raftery, Adrian E.; Lewis, Steven M. (1992-11-01). "[Practical Markov Chain Monte Carlo]: Comment: One Long Run with Diagnostics: Implementation Strategies for Markov Chain Monte Carlo". Statistical Science. 7 (4). doi:10.1214/ss/1177011143. ISSN 0883-4237.
- ^ Foreman-Mackey, Daniel; Hogg, David W.; Lang, Dustin; Goodman, Jonathan (2013-11-25). "emcee: The MCMC Hammer". Publications of the Astronomical Society of the Pacific. 125 (925): 306–312. arXiv:1202.3665. Bibcode:2013PASP..125..306F. doi:10.1086/670067. S2CID 88518555.
- ^ Phan, Du; Pradhan, Neeraj; Jankowiak, Martin (2019-12-24). "Composable Effects for Flexible and Accelerated Probabilistic Programming in NumPyro". arXiv:1912.11554 [stat.ML].
Sources
[edit]- Christophe Andrieu, Nando De Freitas, Arnaud Doucet and Michael I. Jordan An Introduction to MCMC for Machine Learning, 2003
- Asmussen, Søren; Glynn, Peter W. (2007). Stochastic Simulation: Algorithms and Analysis. Stochastic Modelling and Applied Probability. Vol. 57. Springer.
- Atzberger, P. "An Introduction to Monte-Carlo Methods" (PDF).
- Berg, Bernd A. (2004). Markov Chain Monte Carlo Simulations and Their Statistical Analysis. World Scientific.
- Bolstad, William M. (2010). Understanding Computational Bayesian Statistics. Wiley. ISBN 978-0-470-04609-8.
- Carlin, Brad; Chib, Siddhartha (1995). "Bayesian Model Choice via Markov Chain Monte Carlo Methods". Journal of the Royal Statistical Society, Series B, 57(3), 473–484.
- Casella, George; George, Edward I. (1992). "Explaining the Gibbs sampler". The American Statistician. 46 (3): 167–174. CiteSeerX 10.1.1.554.3993. doi:10.2307/2685208. JSTOR 2685208.
- Chib, Siddhartha; Greenberg, Edward (1995). "Understanding the Metropolis–Hastings Algorithm". The American Statistician. 49 (4): 327–335. doi:10.1080/00031305.1995.10476177. JSTOR 2684568.
- Gelfand, A.E.; Smith, A.F.M. (1990). "Sampling-Based Approaches to Calculating Marginal Densities". Journal of the American Statistical Association. 85 (410): 398–409. CiteSeerX 10.1.1.512.2330. doi:10.1080/01621459.1990.10476213.
- Gelman, Andrew; Carlin, John B.; Stern, Hal S.; Rubin, Donald B. (1995). Bayesian Data Analysis (1st ed.). Chapman and Hall. (See Chapter 11.)
- Geman, S.; Geman, D. (1984). "Stochastic Relaxation, Gibbs Distributions, and the Bayesian Restoration of Images". IEEE Transactions on Pattern Analysis and Machine Intelligence. 6 (6): 721–741. doi:10.1109/TPAMI.1984.4767596. PMID 22499653. S2CID 5837272.
- Gilks, W.R.; Richardson, S.; Spiegelhalter, D.J. (1996). Markov Chain Monte Carlo in Practice. Chapman and Hall/CRC.
- Gill, Jeff (2008). Bayesian methods: a social and behavioral sciences approach (2nd ed.). Chapman and Hall/CRC. ISBN 978-1-58488-562-7.
- Green, P.J. (1995). "Reversible-jump Markov chain Monte Carlo computation and Bayesian model determination". Biometrika. 82 (4): 711–732. CiteSeerX 10.1.1.407.8942. doi:10.1093/biomet/82.4.711.
- Neal, Radford M. (2003). "Slice Sampling". Annals of Statistics. 31 (3): 705–767. doi:10.1214/aos/1056562461. JSTOR 3448413.
- Neal, Radford M. (1993). "Probabilistic Inference Using Markov Chain Monte Carlo Methods".
- Robert, Christian P.; Casella, G. (2004). Monte Carlo Statistical Methods (2nd ed.). Springer. ISBN 978-0-387-21239-5.
- Rubinstein, R.Y.; Kroese, D.P. (2007). Simulation and the Monte Carlo Method (2nd ed.). Wiley. ISBN 978-0-470-17794-5.
- Smith, R.L. (1984). "Efficient Monte Carlo Procedures for Generating Points Uniformly Distributed Over Bounded Regions". Operations Research. 32 (6): 1296–1308. doi:10.1287/opre.32.6.1296. hdl:2027.42/7681.
- Spall, J.C. (April 2003). "Estimation via Markov Chain Monte Carlo". IEEE Control Systems Magazine. 23 (2): 34–45. doi:10.1109/mcs.2003.1188770.
- Stramer, O.; Tweedie, R. (1999). "Langevin-Type Models II: Self-Targeting Candidates for MCMC Algorithms". Methodology and Computing in Applied Probability. 1 (3): 307–328. doi:10.1023/A:1010090512027. S2CID 1512689.
Further reading
[edit]- Diaconis, Persi (April 2009). "The Markov chain Monte Carlo revolution" (PDF). Bull. Amer. Math. Soc. 46 (2): 179–205. doi:10.1090/s0273-0979-08-01238-x. S 0273-0979(08)01238-X.
- Press, W.H.; Teukolsky, S.A.; Vetterling, W.T.; Flannery, B.P. (2007). "Section 15.8. Markov Chain Monte Carlo". Numerical Recipes: The Art of Scientific Computing (3rd ed.). Cambridge University Press. ISBN 978-0-521-88068-8.
- Richey, Matthew (May 2010). "The Evolution of Markov Chain Monte Carlo Methods" (PDF). The American Mathematical Monthly. 117 (5): 383–413. CiteSeerX 10.1.1.295.4478. doi:10.4169/000298910x485923. S2CID 13630404.