Monte-Carlo Simulations
Prerequisites: Statistics. Full path (2 pages)
Intuitive
Monte Carlo methods compute quantities by random sampling. A standard first example: draw a square, inscribe a quarter circle, and throw darts at random at the square. The fraction of darts that land inside the quarter circle approaches the ratio of the two areas, which is a quarter of pi. Counting hits gives an estimate of pi, and the estimate improves the more darts we throw.
The same idea works for any average or integral. Instead of evaluating a function on a regular grid of points, we evaluate it at randomly chosen points and take the mean. A grid becomes hopeless in many dimensions: with ten points per axis, a system with 100 variables would need ten to the power 100 grid points. The error of a random estimate shrinks with the number of samples at a rate that does not depend on the number of dimensions. This is why Monte Carlo is the standard tool for problems with very many variables, such as a magnet made of many interacting spins, a gas of many molecules, or a quantum field on a lattice.
In physics we usually need samples from a particular distribution, for example configurations weighted by the Boltzmann factor. Monte Carlo algorithms such as the Metropolis algorithm do this with a random walk through configuration space that visits each configuration with the right frequency, so that averages over the walk become thermal averages.
In Monte-Carlo simulations parameters are chosen randomly and then compared to a predefined goal.
Concrete
Monte Carlo integration. Suppose we want the expectation value of under a probability density , Draw independent samples from and form the sample mean Its expectation value is , and its variance is with . The statistical error is therefore , independent of the dimension of , and can itself be estimated from the samples. In the dart example, is uniform on the unit square, inside the quarter circle and outside, so and .
The error can be reduced by importance sampling: draw from a density that is large where is large, and average instead. The mean is unchanged and the variance can be much smaller.
Markov chain Monte Carlo. In statistical mechanics we need averages in the canonical ensemble, where runs over configurations, for example all spin configurations of an Ising model. We cannot sample directly because is unknown. The Metropolis algorithm produces a chain of configurations instead:
- From the current configuration , propose , for example by flipping one randomly chosen spin, with a symmetric proposal probability.
- Compute .
- Accept with probability ; otherwise keep as the next element of the chain.
Only energy differences enter, so is never needed. The acceptance rule satisfies detailed balance, , so the Boltzmann distribution is stationary. After discarding an initial equilibration period, is estimated by the average of along the chain. Successive configurations are correlated, so the error is larger than for independent samples, and it has to be estimated with the autocorrelation time or by binning.
In lattice QCD and other lattice field theories, the same method samples field configurations with weight , where is the Euclidean action obtained after a Wick rotation.
- An introduction to Monte Carlo methods by Jean-Charles Walter, Gerard Barkema
- The Monte Carlo method in quantum field theory by Colin Morningstar
Abstract
Let be a probability space and . For independent samples , the strong law of large numbers gives almost surely, and the central limit theorem gives The rate is independent of the dimension of . Deterministic quadrature rules on a grid in dimensions converge as for integrands of smoothness , so in high dimension sampling wins. Quasi-Monte Carlo methods replace random points by low-discrepancy sequences and can reach errors close to for sufficiently regular integrands.
Markov chain Monte Carlo constructs a transition kernel that leaves the target invariant, . Detailed balance, , is a sufficient condition and makes self-adjoint on . For a Markov chain on a finite state space that is irreducible and aperiodic, the distribution of converges to from any starting point, and ergodic averages converge to -expectations; analogous statements hold on general state spaces under Harris recurrence. The Metropolis-Hastings rule turns any proposal kernel into such a chain by accepting with probability which requires only up to normalization.
For a stationary chain the variance of the ergodic average is where is the normalized autocorrelation of at lag , so is the effective number of independent samples. The decay of autocorrelations is controlled by the spectral gap of . Near a continuous phase transition grows as a power of the correlation length for local update algorithms (critical slowing down), which motivates nonlocal updates such as cluster algorithms for spin models; lattice gauge theory with dynamical fermions uses hybrid Monte Carlo, which updates all variables at once along molecular dynamics trajectories. All of this assumes a nonnegative weight. When the Boltzmann weight is not positive, as for fermions at finite density or real-time path integrals, the reweighted averages suffer from cancellations that grow exponentially with the volume, the sign problem.
History
- The Beginning of the Monte Carlo Method by N. Metropolis