Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Physics LibreTexts

9.5: Monte Carlo Integration

( \newcommand{\kernel}{\mathrm{null}\,}\)

The final numerical integration scheme that we'll discuss is Monte Carlo integration, and it is conceptually completely different from the previous schemes. Instead of assigning a set of discretization points (either explicitly, as in the mid-point/trapezium/Simpson's rules, or through a machine optimization procedure, as in the adaptive quadrature method), this method randomly samples the points in the integration domain. If the sampling points are independent and there is a sufficiently large number of them, the integral can be estimated by taking a weighted average of the integrand over the sampling points.

To be precise, consider a 1D integral over a domain x[a,b]. Let each sampling point be drawn independently from a distribution p(x). This means that the probability of drawing sample xn in the range xn[x,x+dx] is p(x)dx. The distribution is normalized, so that

bap(x)dx=1.

Let us take N samples, and evaluate the integrand at those points: this gives us a set of numbers {f(xn)}. We then compute the quantity

Imc=1NN1n=0f(xn)p(xn).

Unlike the estimators that we have previously studied, Imc is a random number (because the underlying variables {xn} are all random). Crucially, its average value is equal to the desired integral:

Imc=1NN1n=0f(xn)p(xn)=f(xn)p(xn)foreachn=bap(x)[f(x)p(x)]dx=baf(x)dx

For low-dimensional integrals, there is normally no reason to use the Monte Carlo integration method. It requires a much larger number of samples in order to reach a level of numerical accuracy comparable to the other numerical integration methods. (For 1D integrals, Monte Carlo integration typically requires millions of samples, whereas Simpson's rule only requires hundreds or thousands of discretization points.) However, Monte Carlo integration outperforms discretization-based integration schemes when the dimensionality of the integration becomes extremely large. Such integrals occur, for example, in quantum mechanical calculations involving many-body systems, where the dimensionality of the Hilbert space scales exponentially with the number of particles.


This page titled 9.5: Monte Carlo Integration is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Y. D. Chong via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?