Sie sind auf Seite 1von 1

MATH 4931: SIMULATION AND THE MONTE CARLO METHOD

Importance Sampling

We will consider the problem of estimating the integral

Z
I =

2
4 1 x dx =

g(x)dx

We will do this using the idea of importance sampling: write

g(x)
I =
f (x)dx =
0 f (x)
By considering four different choices for f (x) :
(a) f (x) = 1 for 0 x 1
(b) f (x) = 2x for 0 x 1
(c) f (x) = 4 2x/3 for 0 x 1
(d) f (x) = 2 2x for 0 x 1
()
Let Ibn for = a, b, c, d denote

k(x)f (x)dx.
0

1X
k(Xi ),
n i=1
where X1 , . . . , Xn are IID random variables with density () and appropriate k = g/f to estimate I.
For this set-up, answer the following questions:
(1) For each of the densities (b)-(d) above, show explicitly how to generate a random variable
with that density using the inversion method.
(2) Write R script to actually estimate I using each of the four methods above.
(3) Design and execute a simulations study in R to compare each of the four methods (see class
notes). Use B = 1000 and n = 100 and 10000. What do you see in the resulting box plots?
(4) Calculate I and add this as a horizontal line to your box plots above. What do you see?
()
(5) Calculate Let var(Ibn ) for = a, b, c, d. How does this relate to what you saw in the box
plots?
(6) How large a sample size do you need to achieve an accuracy of 0.001 99% of the time?
(7) Which of the four choices of f works best? Why?

Das könnte Ihnen auch gefallen