Brighton Webs Ltd.
statistical and data services for industry
Home
Index

Concept

Feedback

Monte Carlo Methods - Integration.  Integration is the process of determining the area under the curve, the integral of a function is defined as:

For many functions there is an analytical solution, however. However, some functions do not have analytical solutions and can't be handled with trapezoidal methods and the derivative forms such as Simpson's rule.  A simple two dimensional example with an analytical solution will illustrate the process, take the integral:

The process will vary according to the nature of the function.  In this case it  based on the use of two random numbers and a target space.  The target space is a rectangle bounded on the x axis by the minimum and maximum x values and on the y axis by the minimum and maximum values of f(x).

First generate a random number which is between the lower and upper intervals of the integration interval, in this case between 0 and Pi/2 (r1 on the diagram below).  Next generate a random number between the minimum and maximum values of the function, in this case between 0 and 1 (r2 on the diagram below).  Using the first random number as the x coordinate and the second random number as the y coordinate, plot the coordinate pair on a graph of the function as shown in the diagram below:

If the point falls under the curve accept it, if it falls above it reject it.  Repeat this process a significant number of times, storing the number of accepted values.  At the end of the process determine the value of the integral using the formula:

A program designed to integrate the sample function generated the following results:

The example shows that there is close agreement between the analytical and Monte Carlo methods.  Obviously, the more complex the function and the greater the number of dimensions it occupies, the more complex the program needs to be to perform the integration.

A process similar to Monte Carlo integration forms the basis for the Accept/Reject method of generating random numbers from complex probability density functions.

 

For more information: info@brighton-webs.co.uk