|
From: Dirk E. <ed...@de...> - 2009-11-02 22:19:00
|
On 29 October 2009 at 15:25, Luigi Ballabio wrote: | On Sat, 2009-10-17 at 10:35 -0500, Dirk Eddelbuettel wrote: | > While working on RQuantLib [1], Khanh and I discovered a number of numerical | > issues with Cubic interpolation on yield curves. The RQuantLib side of the | > code that triggers it is actually pretty old and used to run so I am confused | > as to when this changed. | > | > A relatively simple way to trigger the same issue is to modify the | > swapvaluation.cpp example as follows: | > | > edd@ron:~/svn/quantlib/Examples/Swap$ diff -u swapvaluation.cpp.orig swapvaluation.cpp | > --- swapvaluation.cpp.orig 2008-08-01 03:55:43.000000000 -0500 | > +++ swapvaluation.cpp 2009-10-17 10:08:42.000000000 -0500 | > @@ -316,7 +316,7 @@ | > depoSwapInstruments.push_back(s10y); | > depoSwapInstruments.push_back(s15y); | > boost::shared_ptr<YieldTermStructure> depoSwapTermStructure( | > - new PiecewiseYieldCurve<Discount,LogLinear>( | > + new PiecewiseYieldCurve<Discount,Cubic>( | > settlementDate, depoSwapInstruments, | > termStructureDayCounter, | > std::vector<Handle<Quote> >(), | > | > and you get to trigger the bug as easily as | > | > edd@ron:~/svn/quantlib/Examples/Swap$ g++ -o newswap swapvaluation.cpp -lQuantLib -lm && ./newswap | | Dirk, | as of today, I couldn't reproduce the error on the 0.9.9 release branch | (branches/R000909-branch in Subversion.) The swap example runs | successfully after the change. Does it work for you? Of course it's not | picking up some other library version you installed earlier, is it? Confirmed! I (finally) got a chance to build QL 0.9.9 (using 20091023 tarballs) and things work now. Very good news. I only needed a few touchups to get RQuantLib to build with it too. So I put 0.9.9~20091023 into Debian -- and may follow up with the Nov 2 variant you released today. The full build and regression test takes well over an hour but seemingly passed each and every test. Looking forward to QL 1.0!! Dirk -- Three out of two people have difficulties with fractions. |