next up previous
Next: Monte Carlo error analysis Up: Monte Carlo integration Previous: Monte Carlo integration

Simple Monte Carlo integration

More generaly, imagine a rectangle of height $H$ in the integration interval $[a,b]$, such that the function $f(x)$ is within its boundaries. Compute $n$ pairs of random numbers $(x_i,y_i)$ such that they are uniformly distributed inside this rectangle. The fraction of points that fall within the area contained below $f(x)$, i. e., that satisfy $y_i \leq f(x_i)$ is an estimate of the ratio o fthe integral of $f(x)$ and the area of the rectangle. Hence, the estimate of the integral will be given by:

\begin{displaymath}
\int _a^b{f(x)dx} \simeq I(N) = \frac{N_{in}}{N}H(b-a).
\end{displaymath} (267)

Another Monte Carlo procedure is based on the definition:

\begin{displaymath}
\langle g \rangle=\frac{1}{(b-a)} \int _a^b{f(x)dx}.
\end{displaymath} (268)

In order to determine this average, we sample the value of $f(x)$:

\begin{displaymath}
\langle f \rangle \simeq \frac{1}{N}\sum_{i=1}^{N}f(x_i),
\end{displaymath}

where the $N$ values $x_i$ are distributed unformly in the interval $[a,b]$. The integral will be given by

\begin{displaymath}
I(N)=(b-a) \langle f \rangle .
\end{displaymath}


next up previous
Next: Monte Carlo error analysis Up: Monte Carlo integration Previous: Monte Carlo integration
Adrian E. Feiguin 2009-11-04