Vegas Monte Carlo

Simulation
Introduced by
Peter Lepage
Year
1978
Type
Adaptive sampling algorithm
Family
Numerical integration

What does it do?

VEGAS is an adaptive Monte Carlo algorithm for the numerical integration of multidimensional functions, introduced by Peter Lepage in 1978.

It builds a separable sampling grid that is refined over successive iterations so that more points fall where the integrand contributes most, which is why it is widely used for high-dimensional integrals in particle physics. For smooth integrands whose structure is roughly aligned with the coordinate axes, adaptive importance sampling typically reduces the variance compared with uniform sampling at the same number of function evaluations, although this gain is not guaranteed.

The intuition behind the method

Naive Monte Carlo draws points uniformly over the integration region, so many evaluations may fall where the integrand is small, and the estimate converges slowly. VEGAS instead learns from one iteration to the next which parts of each coordinate axis carry the largest contributions, and draws more points there. The grid is adjusted separately along each axis, which keeps the procedure simple but means it follows structure aligned with the axes more readily than correlated or diagonal structure. Each iteration yields an estimate and its variance, and the final answer combines the iterations after adaptation has settled. The gain comes from reduced variance, not from a deterministic rule, and it is not guaranteed: for poorly aligned or sharply peaked integrands it can be small. The result remains a statistical estimate with an error bar.

History

Peter Lepage described the adaptive algorithm in a 1978 article in the Journal of Computational Physics.

When to use it

Choose VEGAS to integrate a smooth function over a box-shaped region in several or many dimensions, for example a multi-particle phase-space or loop-type integral, when deterministic quadrature becomes impractical because of dimensionality. It suits problems where each function evaluation is cheap enough to afford many iterations and where a statistical error bar is acceptable. Avoid it when the integrand has singularities, sharp discontinuities or narrow peaks not aligned with the coordinate axes, unless these are first removed analytically or by a change of variables. In phase-space and loop applications, threshold and endpoint singularities typically have to be remapped by a change of variables before VEGAS is applied. It is also a poor choice when each function evaluation is expensive, because adaptation requires many evaluations.

Limitations and considerations

  • The grid is a product of one-dimensional partitions, so structure aligned with the axes is captured well, whereas a correlated or diagonal peak is represented only approximately.
  • Convergence still degrades as the dimension grows, because the number of grid cells needed to resolve the integrand increases rapidly with dimension.
  • Singularities and discontinuities degrade importance sampling, since the sampled variance can be very large or dominated by a few rare points.
  • Error estimates are reliable only once the grid has stabilised; if adaptation is incomplete, the quoted error can understate the true uncertainty.
  • High precision requires many function evaluations, which makes the method unsuitable for expensive integrands.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Importance sampling reduces the variance of the estimate for smooth integrands compared with uniform sampling in the same dimension, so fewer evaluations are needed for a given error.
  • The grid adapts to the integrand without the user specifying a sampling density by hand, although the user still chooses the number of evaluations per iteration and the number of iterations.
  • Each iteration gives an independent estimate and variance, so the output includes a consistency check between iterations.
  • The evaluations within one iteration are independent and can be distributed across processors.

Applications

  • Evaluation of multidimensional loop integrals in perturbative calculations
  • Phase-space integration for multi-particle decays and scattering cross sections
  • Numerical integration of smooth multidimensional functions where deterministic quadrature is impractical

How it works

How it works

1

Specify the integrand and the integration limits for every dimension, since the grid is defined over a rectangular region in the chosen coordinates.

2

Set up an initial grid that spans the integration region, uniform along each axis, and choose the number of function evaluations per iteration and the number of iterations.

3

Draw random points from the current grid, evaluate the integrand at each point with its sampling weight, and average the weighted values. Multiplying this mean by the volume of the region gives the iteration's estimate of the integral, and the sample variance of the weighted values gives the variance of that estimate.

4

Use the sampled contributions to move the grid boundaries along each axis, so that cells with larger weighted contributions become narrower and future samples concentrate where the integrand is large.

5

Discard the first iterations, while the grid is still changing, and combine the remaining iterations by inverse-variance weighting into a final value and error. The chi-squared per degree of freedom across the retained iterations indicates whether they agree within their stated errors: a value near one supports the quoted error, whereas a clearly larger value means the iterations disagree and the error should not be taken at face value. The quoted error assumes that the iteration estimates are approximately independent and Gaussian, which is reasonable only when each iteration uses enough evaluations.

Common pitfalls

  • Stopping after too few adaptation iterations, so the grid has not stabilised and the final estimate carries a bias that the quoted error does not reveal.
  • Applying VEGAS directly to integrands with singularities or sharp discontinuities without removing them analytically or by a suitable change of variables.
  • Reading a large chi-squared value as an acceptable error. It signals that the iterations disagree, usually because of insufficient sampling or because the grid has not learned the integrand.
  • Quoting the error from a few iterations without checking the chi-squared agreement or the approximately Gaussian assumption behind the error bar.

Frequently asked questions

How does VEGAS differ from naive Monte Carlo?

Naive Monte Carlo samples the region uniformly. VEGAS draws points from a grid that is refined so that more samples fall where the integrand contributes most. This importance sampling reduces the variance of the estimate for a given number of evaluations. The result is still a statistical estimate with an error, but for smooth integrands that error is usually smaller than uniform sampling achieves with the same effort.

What does the chi-squared error estimate mean?

VEGAS reports an estimate and a variance for each iteration. The chi-squared per degree of freedom across the iterations tests whether these estimates agree within their stated errors. A value close to one indicates consistency. A value clearly above one suggests that the grid has not yet adapted or that sampling is insufficient.

Can VEGAS handle singularities?

Not well. An integrable singularity can make the sampled variance very large or dominated by a few points, so importance sampling loses its advantage. Remove or subtract the singular behaviour analytically, or change variables to soften it, before applying VEGAS.

How many grid cells should I use?

The number of cells per axis trades resolution against statistics. More cells let the grid follow finer structure, but each cell then receives fewer samples per iteration and adapts more slowly. Start with a modest grid and increase it if the chi-squared test indicates the integrand is not being resolved. No general rule fixes the best value, so test how sensitive the result is to this choice.

Related methods

Sources

  1. Lepage, G. P. (1978). A new algorithm for adaptive multidimensional integration. Journal of Computational Physics, 27(2), 192–203.

    Open DOI reference
  2. Lepage, G. P. (1980). VEGAS: an adaptive multidimensional integration program. Cornell University preprint CLNS-80/447.

    Open publication reference
  3. Nagy, M., & Nagy, I. (2005). Application of VEGAS integration algorithm for calculation of penetration depth in superconductors. Journal of Physics: Condensed Matter, 17(39), 6131.

    Open publication reference