Error using the piecewiseYieldCurve class with template arguments PiecewiseYieldCurve<ForwardRate, LogLinear>

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Error using the piecewiseYieldCurve class with template arguments PiecewiseYieldCurve<ForwardRate, LogLinear>

Ramon Lozano
Hi,
 
 I am trying to use the PiecewiseYieldCurve class. Drawing from the SwapValuation example provided, I get an error when I change the argument from PiecewiseYieldCurve<Discount,LogLinear>
to PiecewiseYieldCurve<ForwardRate,LogLinear>. When i checked the status of the bootstrap member, it says valid_curve = false? Kind of stuck what the problem is here, because when I run it with Discount everything works fine, but when I change it to ForwardRate i get an unhandled exception. Have attached the code.
 
thanks
 

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

Main.cpp (13K) Download Attachment
INCLUDES.h (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error using the piecewiseYieldCurve class with template arguments PiecewiseYieldCurve<ForwardRate, LogLinear>

Bojan Nikolic

The reason is that the current implementation of the LogLinear
interpolator can not do the integral of the function being interpolated
(the "primitive" function).

The Discount curve builder does not require this function, so it works
fine. The ForwardRate rate does require the "primitive" function so it
fails. If you switch to linear interpolation it will however work, i.e.:

   PiecewiseYieldCurve<ForwardRate,Linear>
     depoFutSwapTermStructure(settlementDate,
                              depoFutSwapInstruments,
                              termStructureDayCounter,
                              tolerance);

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users