Login  Register

G2 revisited

Posted by mike.parkerql on Jun 06, 2004; 3:50pm
URL: http://quantlib.414.s1.nabble.com/G2-revisited-tp2986.html

Corrections to G2 model attached if anyone interested.

Changes:
mux_ was wrong sign.
muy_ wasn't set.
operator() result value was not correct c.f. Brigo & Mercurio book.
Ba_[i], Bb[i] were not correctly set.
Bracketing problems with setting y(x). Used larger min/max.

Also changed g2::swaption to have 2 further arguments for use in integration.
I've found that range = 6.0 and intervals=16 can give 1e-8 - 1e-9 accuracy.
Will depend on parameters though. The range corresponds to number of standard
deviations away from mux_ in the exponential part of the integration formula.

Also attached swaption pricing engine for use with G2, so that usage is same
as e.g. for jamshidianswaption in the bermudanswaption example.

BTW, does anyone know how to set things so that additional constraints apply
to the G2 parameters when fitting (outside of changing code for G2
constructor)?
For example, if I wanted to set boundary conditions for a to be in range (0.0-
0.05). I can't work out how to do it otherwise.

Mike
--

g2.hpp (7K) Download Attachment
g2.cpp (11K) Download Attachment
G2Swaption.hpp (1K) Download Attachment
G2Swaption.cpp (284 bytes) Download Attachment