Dear all,
I am using the "NumericHaganPricer" class to value CMS swaplets. I have a question regarding the "integrate(Real, Real, const ConundrumIntegrand&)" method for values of a > 0. When a > 0, the method initially attempts to use Gauss-Legendre quadrature (class "GaussKronrodNonAdaptive") to calculate the integral in (2.17a) of Hagan's paper. The method first uses 10 and 21 points to value the integral and stops if the difference between the two results (rescaled) satisfies one of two conditions. If not, the process is repeated with 21 & 43 points and finally with 43 & 87 points. My question is regarding the condition "if (err < absoluteAccuracy() || err < relativeAccuracy() * std::fabs(result))".
The method "relativeAccuracy()" returns 1.0 and hence the second condition is generally satisfied immediately and the result using 21 points is returned. The problem is that the method "Integrator::integrationSuccess()" is then called and this returns false if the first condition in the above statement is false. In this case, the result above is discarded and Gauss-Kronrod quadrature is then used to calculate the integral i.e. before exhausting the method above and going to 87 points, Gauss-Kronrod is chosen (class "GaussKronrodAdaptive"). Was it intended to use "&&" in the condition above (in place of "||")?
A second problem is that when Gauss-Kronrod is called (i.e. if "Integrator::integrationSuccess()" evaluates to "false"), the solution is blowing up i.e. the swaplet rate is of the order of 1000% (even though a cruder VBA approach and the QuantLib 87 point Gauss-Legendre method above give a swaplet rate of the order of 4%). Has anybody experienced similar problems with the "GaussKronrodAdaptive::integrate(const boost::function<Real (Real)>&, Real, Real) const" method?
I am a newcomer to QuantLib so I apologise in advance if I am missing something in either of these questions.
Thanks and kind regards, Francis.
------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |