Integrates,
via the Monte Carlo technique, a univariate function, in this case
the standard Gaussian, between the given limits of integration,
x1 and x2, using both
the simple version of the technique and importance sampling.
This latter is of interest when some regions of the integrand have
very small values, as is the case of the Gaussian tail.
The "simple" version computes the integral, I,
just by accumulating values of y, for
x = x1 +
(x2 − x1) r,
with random uniform (0–1) r, and multiplying by the range
of integrations (x2 − x1)
divided by N, the number of trials.
"Importance sampling" assigns small weight to the
regions of the integrand, y, of very small
(near zero) value:
- Choose a weight function, w(x),
that is (a) "similar" to y(x),
(b) a 'pdf', and
(c) whose 'cdf' is easily invertible.
- Repeat: obtain r, a random uniform
(0–1).
- Compute
xR = W−1(r)
(inverse of the 'cdf').
- Accumulate the integral, I, with
y(xR) / w(xR).
Go to repeat till I is "satisfactory"
(stable).
When importance sampling is convenient
(as in the base case), the integral becomes stable earlier,
in the course of the simulation, i.e.,
fewer trials would be necessary.
The analytical value of the integral and
the simulated results are given, and a plot is shown for
the values of two (simple and importance sampling) integrals,
along the simulation trials.
Other suggested data: (4, 10) |
• Google: "importance sampling"
• Wasserman, Larry,
2004, "All of Statistics: a concise course in statistical inference",
Springer, New Yotk, NY (USA) (QA276.12.W37 2003), xix+442 pp. ISBN 0-387-40272-1,
(IST Bibl.: QA276.7-.8.WAS.67200), pp 408–410, Example 24.6.
• Wikipedia "Importance sampling.
• 1919-10-10: Kruskal, William Henry
(2005-04-21). |