|
From: Luigi B. <lui...@gm...> - 2019-03-22 10:36:25
|
alive_ = 2 means that you have two deposits. dates[0] is the reference date of the curve. dates[1] is the pillar of the first deposit. What is the value of dates[2], i.e., the pillar of the second deposit? If it is equal to dates[1], which seems to be the case, how are you initializing the deposits? Luigi On Thu, Mar 21, 2019 at 9:34 PM R S <raj...@ho...> wrote: > > I have been debugging the following use case > > Two DepositHelper constructed with the following rates and periods: > 0.0382, 1 * Weeks > 0.0372, 4 * Weeks > > with following parameters: > DayCounter dayCounter = Actual360(); > BusinessDayConvention bizDayConv = ModifiedFollowing; > int fixingDays = 2; > Date settlementDate(1, September, 2010); > double tolerance = 1.0e-15; > > I am constructing a > PiecewiseYieldCurve<Discount, LogLinear>(settlementDate, helper, ActualActual(ActualActual::ISDA), tolerance) > > I am actually constructing the shared pointer as follows: > boost::shared_ptr<PiecewiseYieldCurve<Discount, LogLinear>> depoSwapTermStructure( > new PiecewiseYieldCurve<Discount, LogLinear>(settlementDate, helper, > ActualActual(ActualActual::ISDA), > tolerance) > ); > > All executes well except when i try and do this: > > vector<Date> curvedates = depoSwapTermStructure->dates(); > > The exception is: > terminate called after throwing an instance of 'QuantLib::Error' > what(): more than one instrument with pillar September 8th, 2010 > Process finished with exit code 134 (interrupted by signal 6: SIGABRT) > > This happens at line 111 (for loop) of iterativebootstrap.hpp > > At line 102, dates array is defined as: > dates.resize(alive_+1); where alive_ = 2 > > firstDate is set to 40422 (1/Sep/2010) which becomes dates[0] > > The pillar date is set to 40429 (8/Sep/2010) on the DepositHelpers which becomes dates[1] > > which ends up satisfying this condition: > QL_REQUIRE(dates[i-1]!=dates[i], > "more than one instrument with pillar " << dates[i]); > > Clearly I am missing an important step in the bootstrap before I extract the dates and rates out (I want to extract the forward rates to feed it back to an InterpolatedCurve to avoid repeating bootstrap) > > Any pointers would be appreciated > > > Regards > -RS > On 13 Mar 2019, 11:57 +0000, Eric Ehlers , wrote: > > All three files received - curve_hydration.zip, curve_hydration.tar, and curve_hydration.tar.gz. I will take a look this weekend and report back here. > > Regards, > > Eric > > On 12/03/2019 20:32, R S wrote: > > zip was blocked, tar was too large. Trying to send as tar.gz > > > > Regards > -RS > On 11 Mar 2019, 15:10 +0000, Eric Ehlers <eri...@re...>, wrote: > > Would you mind sending over the smallest standalone program that recreates the error? > > Regards, > > Eric > > On 08/03/2019 21:16, R S wrote: > > As advised here > http://quantlib.10058.n7.nabble.com/How-to-serialize-an-object-in-Quantlibxl-td763.html > > I am attempting to save date and rates from my curve in order to reconstruct it (avoid bootstrap) > > I am taking a pre-canned example with deposit and swap helpers > > rates.push_back(0.0382); qlperiods.push_back(5 * Days); > rates.push_back(0.0372); qlperiods.push_back(1 * Months); > rates.push_back(0.037125); qlperiods.push_back(2 * Years); > > (I have more but I have narrowed it to these to keep it simple) > > First two go into building DepositRateHelper and the last one, SwapRateHelper > > I then construct a PiecewiseYieldCurve<Discount, LogLinear> > > When I try to print the dates and rates from. this. depoSwap curve > > vector<Date> curvedates = depoSwapTermStructure->dates(); > vector<Real> curverates = depoSwapTermStructure->data(); > > vector<Real>::iterator ri = curverates.begin(); > for (vector<Date>::iterator it = curvedates.begin(); it != curvedates.end(); it++) { > cout << *it << " : " << *ri << endl; > ri++; > } > > I keep getting this error > terminate called after throwing an instance of 'QuantLib::Error' > what(): more than one instrument with pillar March 19th, 2019 > > Settlement is set to > Date settlementDate(1, September, 2010); > > The error stops if i comment out > rates.push_back(0.0382); qlperiods.push_back(5 * Days); > > I am lost as to why > > > > Regards > -RS > > > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev |