Login  Register

Re: Bug in MCAmericanBasketEngine class

Posted by Joseph Wang on Oct 09, 2005; 12:29pm
URL: http://quantlib.414.s1.nabble.com/Bug-in-MCAmericanBasketEngine-class-tp4110p4112.html

That would also work....  Do you want to add it or should I.

I've also added a test to the test suite that replacates the crash which
I can check in once the fix is in place.

Also, I've been reading up on Monte Carlo.  Chapter 10 of Peter Jackel's
book Monte Carlo Methods in Finance says that antithetic sampling should
not be used with low-discrepency series (especially Sobol numbers) as it
will case interaction effects given that the quasi-random numbers are
also almost antihetic.

Does this have any impact on the code?


Luigi Ballabio wrote:

>
> On Oct 9, 2005, at 6:12 PM, Joseph Wang wrote:
>
>> Can you add the following lines and see if it fixes things....
>>
>>        std::vector<MultiPath> multipaths(N);
>>        for (i=0; i<N/2; i++) {
>>            multipaths[i] = multipathGenerator->next().value;
>>            multipaths[N/2+i] = multipathGenerator->antithetic().value;
>>        }
>>        // Add an extra path if N is odd
>>        if (N % 2 == 1) {
>>            multipaths[N-1] = multipathGenerator->next().value;
>>        }
>
>
> Isn't it enough to make N even if it's not? At its declaration site,
> you can write:
>
> Size N = requiredSamples_ + (requiredSamples_ % 2);
>
> Luigi
>