I have the following problem, and am having trouble understanding part of the equation:
Monte Carlo methods to estimate an integral is basically, take a lot of random samples and determined a weighted average. For example, the integral of f(x) can be estimated from N independent random samples xr by
alt text http://www.goftam.com/images/area.gif
for a uniform probability distribution of xr in the range [x1, x2]. Since each function evaluation f(xr) is independent, it is easy to distribute this work over a set of processes.
What I don’t understand is what f(xr) is supposed to do? Does it feed back into the same equation? Wouldn’t that be an infinite loop?
Your goal is to compute the integral of
ffromx1tox2. For example, you may wish to compute the integral ofsin(x)from0topi.Using Monte Carlo integration, you can approximate this by sampling random points in the interval
[x1,x2]and evaluatingfat those points. Perhaps you’d like to call thisMonteCarloIntegrate( f, x1, x2 ).So no,
MonteCarloIntegratedoes not ‘feed back’ into itself. It calls a functionf, the function you are trying to numerically integrate, e.g.sin.