Ciao Andrea,
At 07:26 PM 5/20/02 +0200,
[hidden email] wrote:
>I'm tring to introduce importance sampling into the MonteCarlo Framework of
>QuantLib but I have some problems.
>
>I think a good place to work is the class
>RandomNumbers::RandomArrayGenerator where in the method next() I can
>change the value of next_weight, but...
I think RandomArrayGenerator is too high-level already as it delegates the
actual random number generation to its generator_ data member. The type of
generator_ is determined by RandomArrayGenerator template argument.
Unfortunately, the Gaussian generators currently implemented in QuantLib
are all unbiased ones, while for importance sampling as I understand it,
the desired importance bias should be introduced from the beginning.
Namely, once we draw numbers from a Gaussian distribution G(x), we cannot
introduce importance sampling a posteriori. Instead, we should sample from
a distribution F(x) = G(x)H(x), where H(x) expresses the bias, and give
each sample x_i a weight 1/H(x_i).
So we have one or possibly two problems here: one is that there's no such
biased generator in QuantLib, and by the way, you are welcome to implement
and contribute it*; the second is that you might want to introduce a
different bias for each component of your random array. I think this could
be managed by using different biased generators for different components,
with the warning that one should be careful not to introduce artificial
correlations between them.
Bye for now,
Luigi