next up previous
Next: About this document ... Up: monte Previous: Integration by Sampling the

Importance Sampling

Sometimes the integrand we are sampling is zero or tiny nearly everywhere, except for a small region where it is huge. In this case the Monte Carlo method will have a poor time sampling the function, since most of the sample points will fall uselessly in places where the integrand is tiny. To improve the situation, we use biased or importance sampling. Suppose, instead of uniform sampling with probability $1/(b-a)$ in the variable $x$, we sample with a probability $p(x)$. The integral in question can be rewritten as
\begin{displaymath}
I = \int_{a}^{b}\frac{f(x)}{p(x)} p(x)dx.
\end{displaymath} (11)

The integral we want is then the mean value
\begin{displaymath}
I = <y_{i}/p(x_{i})>.
\end{displaymath} (12)

The division by $p(x_{i})$ compensates for the bias by giving higher weight to values that fall in regions of small probability, where sampling is less likely to happen. If $y_{i}$ is small when $p(x_{i})$ is small, then we are safe. The error in the estimated integral is computed as before, but basing the standard deviation on the compensated values $y_{i}/p(x_{i})$.

Biased sampling can be accomplished by changing variables and sampling uniformly in the new variable. Suppose we change to $s = s(x)$. Then we may write

\begin{displaymath}
I = \int_{s(a)}^{s(b)} \frac{f[x(s)]}{ds/dx} ds.
\end{displaymath} (13)

In this case the bias probability is $p(x) = ds/dx/[s(b) - s(a)]$.

To get a small the variance in the mean of any distribution, it is best to arrange so that the majority of the sampled values lie close to the mean. The ideal bias would have $p(x) \propto f(x)$ so that all sampled values would be the same constant.

As an example, suppose we are integrating

\begin{displaymath}
I = \int_0^1 x^{10} dx.
\end{displaymath}

Because the integrand is very large only close to 1, a Monte Carlo procedure based on uniform sampling in $x$ would give a poor variance. Better to sample more frequently close to $x = 1$. Ideally, we would sample with a probability proportional to the magnitude of the integrand itself. That means we want $p(x) \propto x^{10}$. So how do we manufacture such a probability distribution from the standard uniform distribution? We do it by a change of variable, as described above. First we take $s$ uniform on the interval $[0,1]$. Then we change variables to $x$ so that $ds/dx = Cx^{10}$, where $C$ is a proportionality constant. That is $s(x) = Cx^{11}/11 + C^\prime$. We adjust the constants so that $s(a=0) = 0$ and $s(b=1) = 1$ and solve for $x$ to get

\begin{displaymath}
x = s^{1/11}
\end{displaymath}

This $x$ will be have the desired bias if $s$ is uniformly distributed on $[0,1]$.

Notice from the previous example that in deriving $s(x)$ we had to do the integral analytically and, further, we had to find its inverse function $x(s)$. Of course, if we could do that, we wouldn't be doing it using the Monte Carlo method in the first place! In practice, we must be content with finding an approximation to the integrand that can be integrated in closed form, and use it to construct the biased distribution. The better the approximation where the integrand is largest, the smaller the variance.


next up previous
Next: About this document ... Up: monte Previous: Integration by Sampling the
Carleton DeTar
2002-04-03