A better sampling

The Monte Carlo Integration Method can be improved greatly by a nonuniform sampling if variations in the integrand $f(x)$ are smooth.

Multiply and divide the integrand $f(x)$ by a positive weight function $w(x)$

\begin{displaymath}
I = \int_{0}^{1} dx w(x) \frac{ f(x) }{ w(x) }
\end{displaymath}

Let's assume further that $w(x)$ is normalized to 1 in the same domain as the integral.

\begin{displaymath}
\int_{0}^{1} dx w(x) = 1
\end{displaymath}

Change variable from $x$ to $y(x)$ by

\begin{displaymath}
dy = w(x) dx
\end{displaymath}

or

\begin{displaymath}
y(x) = \int_{0}^{x} dx' w(x')
\end{displaymath}

Note that $ y(0) = 0 $ and $ y(1) = 1 $.

The integral now becomes

\begin{displaymath}
I = \int_{0}^{1} dy \frac{ f(x(y)) }{ w(x(y)) }
\end{displaymath}

The Monte Carlo evaluation of $I$ proceeds as before, e.g., averaging the values of f(x) divided by $w(x)$ via a random sampling of points uniformally distributed in $y$ in the interval [0,1], namely

\begin{displaymath}
I \equiv \frac{1}{N} \sum_{i=1}^{N} \frac{ f( x(y_i) ) }{ w( x(y_i) ) }
\end{displaymath}

If $w(x)$ has the same smooth variation as $f(x)$, e.g., $w(x)$ is large or small where $f(x)$ is large or small, the ratio $f/w$ will be roughly a constant over the interval [0, 1]. This ought to improve the accuracy in calculating the integral.

There is a fundamentaly different interpretation of the the results that we have just obtained. The change of variable in differential form

\begin{displaymath}
dy = w(x) dx
\end{displaymath}

shows that a uniform distribution in $y$ ( since $w(y) = 1$ ) results in a distribution in $x$ given by the weight function $w(x)$. The integral can therefore be interpreted as an average of $f(x)$ with random numbers sampling according to the probability weight function $w(x)$. In other words, sampling $f(x)$ with random numbers distributed according to $w(x)$, the latter roughly following the functional dependence of $f(x)$, will be much more accurate than sampling with equally distributed random numbers.

We will see in the next subsection a method to generate random numbers of arbitrary distribution. This will become a fundamental tool to evaluate multi-dimensional integrals.

Michel Vallieres 2014-04-01