Processing math: 100%

 

 

 

Monte Carlo integration, algorithm

The algorithm is as follows

  • Choose the number of Monte Carlo samples N.
  • Perform a loop over N and for each step generate a random number xi in the interval [0,1] through a call to a random number generator.
  • Use this number to evaluate f(xi).
  • Evaluate the contributions to the mean value and the standard deviation for each loop.
  • After N samples calculate the final mean value and the standard deviation.