G2++ for Bermudan Example

Posted by Zakoian2000 on
URL: http://quantlib.414.s1.nabble.com/G2-for-Bermudan-Example-tp2564.html

Hello. Has anybody tried to use the G2++ model in the Bermudan Swaption
example?

It works fine with HW1, HW2, and BK but the following does not work...

Handle<Model> modelG2(new G2(rhTermStructure));
swaptions.setPricingEngine(Handle<PricingEngine>(new TreeSwaption(modelG2,
grid)));
calibrateModel(modelG2, swaptions, 0.25);

bermudanSwaption.setPricingEngine(
            Handle<PricingEngine>(new TreeSwaption(modelG2, 100)));

bermudanSwaption.NPV();

What am I doing wrong? I just started C++ programming and don't have much
idea if TreeSwaption class can take 2 factor models.

Please help!

Zakoian