Joined: Nov 2007
Fri Nov 23, 07 10:54 AM
I know that something like this has been on the forum before, but it didn't solve my problem (the thread leaves of when the poster apparently solved his problem). I am trying to calibrate the G2++ model parameters to swaption prices as described in Brigo and Mercurio (2nd edition pg 158). I use the swaption formula they describe to compute swaption prices and try to fit the parameters to match a number of market observed swaption prices.
The calculation of the swaption price involves numerically solving an integral. The integrant, in return, involves numerically finding a root to an equation. I compute the root of the equation using Matlab's fsolve and the numerical integration with Matlab's quad or quadl procedures (quad (using a adaptive Simpson quadrature, about 100 function evaluations) and quadl (using adaptive Gauss/Lobatto quadrature, about 280 function evaluations, thus slower)). This, as one might expect, is pretty slow, taking a little more than 2.5 seconds to calculate the price of a swaption.
I then try to fit the parameters to a number of swaption prices (originally 70 but have reduced to 9 without convergence in acceptable time) using the Matlab minimizer lsqnonlin.
My questions on this are threefold:
1. As the calculation of the swaption price and the evaluation of the integrand seems critical, are there any ways to speed this up in Matlab? What would you consider acceptable evaluation times for the price of a swaption?
2. Are there better ways of numerically computing the integral? I read something on the forum about using Gauss-Legendre polynomials to compute it, but am unsure of how that would work.
3. Is the optimization algorithm (lsqnonlin) the right approach? I have also read on the forum about using a simulated annealing algorithm, is that a better approach?
Any practical input on this would be highly apreciated. I am also aware that Matlab may not be the best option to do this, but am a little reluctant to implement all of its neat functions myself.
Thank you very much in advance
Edited: Fri Nov 23, 07 at 10:57 AM by bademeister