Login  Register

Re: Heston model - Monte Carlo simulation

Posted by Luigi Ballabio on Nov 20, 2009; 1:50pm
URL: http://quantlib.414.s1.nabble.com/Heston-model-Monte-Carlo-simulation-tp8160p8163.html

On Tue, 2009-11-17 at 03:24 -0800, gbogaert wrote:
> Thank you for your advice. Could you give more detailed on the used of the
> MultiPath Generator? Is it not used for multiple assets?

Not only that.  If you pass it the Heston model, it will generate
MultiPaths with two components. The first will be the path generated for
the underlying and the second the one for the volatility.

> In my case I have one asset. Based on the test-suite, I tried the
> PathGenerator class. From what I understood, a path is generated each time
> that generator.next() is called, isn't it? I called it several times
> (50,000x) and took the last value of the sample with sample.value.back() for
> each generation. I am then surprised that after relaunching my program
> several times I always get the same values and average.

That's because you're always feeding the generator the same seed:

>    BigNatural seed = 42;
>    [...]
>    rsg_type rsg = PseudoRandom::make_sequence_generator(timeSteps, seed);

If you want your program to use different feeds each time, set the seed
to 0.  But that will mean you might be unable to reproduce errors if
they arised.

Luigi


--

There are no rules of architecture for a castle in the clouds.
-- Gilbert K. Chesterton



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users