Re: Quantlib Error: time (30.0037) is past max curve time (30.001)

Posted by Jinping Shi on
URL: http://quantlib.414.s1.nabble.com/bug-related-to-error-message-root-not-bracketed-tp153p158.html

Found the solution and please ignore the early message.  I just need to add one more line:
 
swapTermStructure->enableExtrapolation();
 
(Maybe it is worth it to add this line to the example code swapvaluation.cpp)
 
Thanks!

 

From: [hidden email]
To: [hidden email]
CC: [hidden email]
Subject: Quantlib Error: time (30.0037) is past max curve time (30.001)
Date: Thu, 9 Sep 2010 14:35:49 +0000

I am using the sample code swapvaluation.cpp to build termstructure, and made two changes for USD
 
(1) Calendar swap_calendar = UnitedStates(UnitedStates::GovernmentBond);
 
(2) boost::shared_ptr<IborIndex> swap_FloatingLegIndex(new USDLibor(3*Months) );
 
There seems some inconsistency between these two and I see the following type error message for certain dates:
20090825, 20090826, 20091222, 20100330, 20100523, 20100504, 20100505, 20100823, 20100824, 20100825
 
It seems a 30 year swap rate, by using some day count, becomes more than 30 years.  My swapr ates are quoted as Thirty360(), as in class SwapRateHelper, and the termstructure day count is using ActualActual(ActualActual::ISDA) as in class PiecewiseYieldCurve<Discount,LogLinear>.
 
Where is the problem and how to correct it?
 
If in (1) I use UnitedKingdom(UnitedKingdom::Exchange), the problem goes away.  Is that the right thing to do?
 
 
 
 
run date : 2010-8-25 16:0:00
Swap Settlement date: Friday, August 27th, 2010
 running 14040H
terminate called after throwing an instance of 'QuantLib::Error'
  what(): 
../../../../utility_sys/bin2/include/ql/termstructures/iterativebootstrap.hpp:199: In function `void QuantLib::IterativeBootstrap<Curve>::calculate() const [with Curve = QuantLib::PiecewiseYieldCurve<QuantLib::Discount, QuantLib::LogLinear, QuantLib::IterativeBootstrap>]':
1st iteration: failed at 10th instrument, maturity August 27th, 2040, reference date August 27th, 2010:
termstructure.cpp:84: In function `void QuantLib::TermStructure::checkRange(QuantLib::Time, bool) const':
time (30.0037) is past max curve time (30.001)
Abort
 
 
Thanks,
Jinping Shi
 

------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users