11.7 Exercises 379
The importance sampling improves considerably the results, as we noted in the example with
the normal distribution. Typical results are
Table 11.5Results obtained with the uniform distribution only and importance sampling. The suffixudstands
for the approach with the uniform distribution whileisstands for the use of importance sampling.
N Iud σud time(s)Iis σis time(s)
1E6 0.19238 3.85124E-4 0.6 0.19176 1.01515E-4 1.4
10E6 0.18607 1.18053E-4 6 0.192254 1.22430E-4 14
100E6 0.18846 4.37163E-4 57 0.192720 1.03346E-4 138
1000E6 0.18843 1.35879E-4 581 0.192789 3.28795E-5 1372
- Parallelize your code from the previous point and comparethe CPU time needed with that
from the first point above. Do you achieve a good speedup?
- The integral of Eq. (11.23) has a closed form solution. Canyou find it?