QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

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

QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

cheng li

Hi Team,

 

I have checked out the recent trunk from github and ran through the tests on the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed when calibrated to BMA swaps, the error message reads as:

 

Testing consistency of piecewise-log-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-cubic zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-flat forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of convex monotone forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of local-bootstrap algorithm...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

 

Regards,

Cheng


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

cheng li

Hi Team,

 

I found this issue is due to the fixing date is past the evaluation date but before curve reference data. This issue can be solved by

 

Change:

 

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinHolidays);

 

To:

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinBusinessDays);

 

In the file testsuit/piecewiseyieldcurve.cpp

 

Regards,

Cheng

 

发件人: cheng li [mailto:[hidden email]]
发送时间: 20141223 11:46
收件人: [hidden email]
主题: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

 

Hi Team,

 

I have checked out the recent trunk from github and ran through the tests on the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed when calibrated to BMA swaps, the error message reads as:

 

Testing consistency of piecewise-log-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-cubic zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-flat forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of convex monotone forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of local-bootstrap algorithm...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

 

Regards,

Cheng


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

Luigi Ballabio
Strange. Using JoinHolidays should adjust to a date which is a business day for both BMA and LIBOR. Do you have more details on the calculations? What dates did you find for fixing date, evaluation date and curve reference date?

Luigi

On Tue, Dec 23, 2014 at 6:43 AM, cheng li <[hidden email]> wrote:

Hi Team,

 

I found this issue is due to the fixing date is past the evaluation date but before curve reference data. This issue can be solved by

 

Change:

 

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinHolidays);

 

To:

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinBusinessDays);

 

In the file testsuit/piecewiseyieldcurve.cpp

 

Regards,

Cheng

 

发件人: cheng li [mailto:[hidden email]]
发送时间: 20141223 11:46
收件人: [hidden email]
主题: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

 

Hi Team,

 

I have checked out the recent trunk from github and ran through the tests on the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed when calibrated to BMA swaps, the error message reads as:

 

Testing consistency of piecewise-log-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-cubic zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-flat forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of convex monotone forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of local-bootstrap algorithm...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

 

Regards,

Cheng


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users




--

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

cheng li

Hi Luigi,

 

Evaluation date is 41996 i.e. 2014/12/23

curve reference date is 42002 i.e. 2014/12/29

BMA swap first fixing date is 41997 i.e. 2014/12/24

 

So when index to fix, ql will try to calculate the fixing from the curve as fixing date is after evaluation date. However curve reference date is after the fixing date so such calculation will throw an error.

 

I think this error happens because 2014/12/24 is a Wednesday which is a valid fixing data for BMA swap. Besides 2014/12/26 is a holiday in Libor calendar (especially for United Kindom calendar) however it is a working day in BMA calendar. So in the original code, when setting the curve reference date, 2014/12/26 has been skiped and reference date be set as 2014/12/29. But when we try to get the first fixing, I saw in the codes it moved 2 days backwardly from reference date with BMA calendar and that date is 2014/12/24.

 

In the testing code, the author assume that the first fixing must happened in the history (seen from the evaluation date). But in this case it is not true.

 

Such error will occur on the date when test is run with today set as 2014/12/23. When set as 2014/12/22 it is fine.

 

Regards,

Cheng

 

发件人: Luigi Ballabio [mailto:[hidden email]]
发送时间: 20141223 17:00
收件人: cheng li
抄送: QuantLib users
主题: Re: [Quantlib-users] 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

 

Strange. Using JoinHolidays should adjust to a date which is a business day for both BMA and LIBOR. Do you have more details on the calculations? What dates did you find for fixing date, evaluation date and curve reference date?

 

Luigi

 

On Tue, Dec 23, 2014 at 6:43 AM, cheng li <[hidden email]> wrote:

Hi Team,

 

I found this issue is due to the fixing date is past the evaluation date but before curve reference data. This issue can be solved by

 

Change:

 

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinHolidays);

 

To:

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinBusinessDays);

 

In the file testsuit/piecewiseyieldcurve.cpp

 

Regards,

Cheng

 

发件人: cheng li [mailto:[hidden email]]
发送时间: 20141223 11:46
收件人: [hidden email]
主题: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

 

Hi Team,

 

I have checked out the recent trunk from github and ran through the tests on the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed when calibrated to BMA swaps, the error message reads as:

 

Testing consistency of piecewise-log-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-cubic zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-flat forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of convex monotone forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of local-bootstrap algorithm...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

 

Regards,

Cheng


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



 

--


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

cheng li
In reply to this post by Luigi Ballabio

Oops with my change the test will failed on the date Dec 24, 2014;

 

unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case( &PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)": std::exception: 1st leg: Missing USDLibor3M Actual/360 fixing for December 23rd, 2014

 

So I have to think it more…

 

Regards,

Cheng

 

发件人: Luigi Ballabio [mailto:[hidden email]]
发送时间: 20141223 17:00
收件人: cheng li
抄送: QuantLib users
主题: Re: [Quantlib-users] 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

 

Strange. Using JoinHolidays should adjust to a date which is a business day for both BMA and LIBOR. Do you have more details on the calculations? What dates did you find for fixing date, evaluation date and curve reference date?

 

Luigi

 

On Tue, Dec 23, 2014 at 6:43 AM, cheng li <[hidden email]> wrote:

Hi Team,

 

I found this issue is due to the fixing date is past the evaluation date but before curve reference data. This issue can be solved by

 

Change:

 

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinHolidays);

 

To:

402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),

403                                      USDLibor(3*Months).fixingCalendar(),

404                                      JoinBusinessDays);

 

In the file testsuit/piecewiseyieldcurve.cpp

 

Regards,

Cheng

 

发件人: cheng li [mailto:[hidden email]]
发送时间: 20141223 11:46
收件人: [hidden email]
主题: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

 

Hi Team,

 

I have checked out the recent trunk from github and ran through the tests on the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed when calibrated to BMA swaps, the error message reads as:

 

Testing consistency of piecewise-log-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear discount curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-cubic zero-yield curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-linear forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of piecewise-flat forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of convex monotone forward-rate curve...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

2>  Testing consistency of local-bootstrap algorithm...

2>  unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)": std::exception: 2nd leg: negative time (-0.00833333) given

2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint

 

Regards,

Cheng


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



 

--


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

Peter Caspers-4
Hello,

my 2 cents. If evaluation date = Dec 23rd, the BMA swap settles on Dec
23rd + 2 good days (US+UK calendar) = Dec 29th. The point is that the
last relevant bma fixing date is then then the last Wednesday, which
is Dec 24th, with value date Dec 26th (+1 US day), which is 3 days
before the yield curves settlement date, hence the error ( - 3 / 360 =
-0.00833333 ). This looks like a peculiarity of the BMA convention, so
I would just change the reference date of the term structure in the
test case to today to avoid such situations, i.e. in line 437

        vars.termStructure = boost::shared_ptr<YieldTermStructure>(new
            PiecewiseYieldCurve<T,I,B>(vars.today, vars.bmaHelpers,
                                       Actual360(),
                                       1.0e-12,
                                       interpolator));

the more because nothing really relevant is changed by this. While
looking at it (though not related to the issue here) I think we should
apply the logic of PR 124

https://github.com/lballabio/quantlib/pull/124

to the BMA swap rate helpers consistently, i.e. adjusting shouldn't we
? I will just send a PR later for that.

Kind regards
Peter

On 24 December 2014 at 04:40, cheng li <[hidden email]> wrote:

> Oops, with my change the test will failed on the date Dec 24, 2014;
>
>
>
> unknown location(0): fatal error in "QuantLib::detail::quantlib_test_case(
> &PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)":
> std::exception: 1st leg: Missing USDLibor3M Actual/360 fixing for December
> 23rd, 2014
>
>
>
> So I have to think it more…
>
>
>
> Regards,
>
> Cheng
>
>
>
> 发件人: Luigi Ballabio [mailto:[hidden email]]
> 发送时间: 2014年12月23日 17:00
> 收件人: cheng li
> 抄送: QuantLib users
> 主题: Re: [Quantlib-users] 答复: QuantLib PiecewiseYieldCurve tests failed on
> date 23 Dec, 2014
>
>
>
> Strange. Using JoinHolidays should adjust to a date which is a business day
> for both BMA and LIBOR. Do you have more details on the calculations? What
> dates did you find for fixing date, evaluation date and curve reference
> date?
>
>
>
> Luigi
>
>
>
> On Tue, Dec 23, 2014 at 6:43 AM, cheng li <[hidden email]>
> wrote:
>
> Hi Team,
>
>
>
> I found this issue is due to the fixing date is past the evaluation date but
> before curve reference data. This issue can be solved by
>
>
>
> Change:
>
>
>
> 402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),
>
> 403
> USDLibor(3*Months).fixingCalendar(),
>
> 404                                      JoinHolidays);
>
>
>
> To:
>
> 402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),
>
> 403
> USDLibor(3*Months).fixingCalendar(),
>
> 404                                      JoinBusinessDays);
>
>
>
> In the file testsuit/piecewiseyieldcurve.cpp
>
>
>
> Regards,
>
> Cheng
>
>
>
> 发件人: cheng li [mailto:[hidden email]]
> 发送时间: 2014年12月23日 11:46
> 收件人: [hidden email]
> 主题: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014
>
>
>
> Hi Team,
>
>
>
> I have checked out the recent trunk from github and ran through the tests on
> the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed when
> calibrated to BMA swaps, the error message reads as:
>
>
>
> Testing consistency of piecewise-log-linear discount curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of piecewise-linear discount curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of piecewise-linear zero-yield curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of piecewise-cubic zero-yield curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of piecewise-linear forward-rate curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of piecewise-flat forward-rate curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of convex monotone forward-rate curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
> 2>  Testing consistency of local-bootstrap algorithm...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last checkpoint
>
>
>
> Regards,
>
> Cheng
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
>
>
> --
>
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: 答复: 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

cheng li
Hi Peter,

Agree. I think in this case just change the curve reference date to today won't hurt anyway~

Regards,
Cheng

-----邮件原件-----
发件人: Peter Caspers [mailto:[hidden email]]
发送时间: 2014年12月24日 22:09
收件人: cheng li
抄送: Luigi Ballabio; QuantLib users
主题: Re: [Quantlib-users] 答复: 答复: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014

Hello,

my 2 cents. If evaluation date = Dec 23rd, the BMA swap settles on Dec 23rd + 2 good days (US+UK calendar) = Dec 29th. The point is that the last relevant bma fixing date is then then the last Wednesday, which is Dec 24th, with value date Dec 26th (+1 US day), which is 3 days before the yield curves settlement date, hence the error ( - 3 / 360 =
-0.00833333 ). This looks like a peculiarity of the BMA convention, so I would just change the reference date of the term structure in the test case to today to avoid such situations, i.e. in line 437

        vars.termStructure = boost::shared_ptr<YieldTermStructure>(new
            PiecewiseYieldCurve<T,I,B>(vars.today, vars.bmaHelpers,
                                       Actual360(),
                                       1.0e-12,
                                       interpolator));

the more because nothing really relevant is changed by this. While looking at it (though not related to the issue here) I think we should apply the logic of PR 124

https://github.com/lballabio/quantlib/pull/124

to the BMA swap rate helpers consistently, i.e. adjusting shouldn't we ? I will just send a PR later for that.

Kind regards
Peter

On 24 December 2014 at 04:40, cheng li <[hidden email]> wrote:

> Oops, with my change the test will failed on the date Dec 24, 2014;
>
>
>
> unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(
> &PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)":
> std::exception: 1st leg: Missing USDLibor3M Actual/360 fixing for
> December 23rd, 2014
>
>
>
> So I have to think it more…
>
>
>
> Regards,
>
> Cheng
>
>
>
> 发件人: Luigi Ballabio [mailto:[hidden email]]
> 发送时间: 2014年12月23日 17:00
> 收件人: cheng li
> 抄送: QuantLib users
> 主题: Re: [Quantlib-users] 答复: QuantLib PiecewiseYieldCurve tests failed
> on date 23 Dec, 2014
>
>
>
> Strange. Using JoinHolidays should adjust to a date which is a
> business day for both BMA and LIBOR. Do you have more details on the
> calculations? What dates did you find for fixing date, evaluation date
> and curve reference date?
>
>
>
> Luigi
>
>
>
> On Tue, Dec 23, 2014 at 6:43 AM, cheng li
> <[hidden email]>
> wrote:
>
> Hi Team,
>
>
>
> I found this issue is due to the fixing date is past the evaluation
> date but before curve reference data. This issue can be solved by
>
>
>
> Change:
>
>
>
> 402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),
>
> 403
> USDLibor(3*Months).fixingCalendar(),
>
> 404                                      JoinHolidays);
>
>
>
> To:
>
> 402        vars.calendar = JointCalendar(BMAIndex().fixingCalendar(),
>
> 403
> USDLibor(3*Months).fixingCalendar(),
>
> 404                                      JoinBusinessDays);
>
>
>
> In the file testsuit/piecewiseyieldcurve.cpp
>
>
>
> Regards,
>
> Cheng
>
>
>
> 发件人: cheng li [mailto:[hidden email]]
> 发送时间: 2014年12月23日 11:46
> 收件人: [hidden email]
> 主题: QuantLib PiecewiseYieldCurve tests failed on date 23 Dec, 2014
>
>
>
> Hi Team,
>
>
>
> I have checked out the recent trunk from github and ran through the
> tests on the date as 23 Dec 2014. The PiecewiseYieldCurve tests failed
> when calibrated to BMA swaps, the error message reads as:
>
>
>
> Testing consistency of piecewise-log-linear discount curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLogLinearDiscountConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of piecewise-linear discount curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearDiscountConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of piecewise-linear zero-yield curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearZeroConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of piecewise-cubic zero-yield curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testSplineZeroConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of piecewise-linear forward-rate curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLinearForwardConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of piecewise-flat forward-rate curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testFlatForwardConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of convex monotone forward-rate curve...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testConvexMonotoneForwardConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
> 2>  Testing consistency of local-bootstrap algorithm...
>
> 2>  unknown location(0): fatal error in
> "QuantLib::detail::quantlib_test_case(&PiecewiseYieldCurveTest::testLocalBootstrapConsistency)":
> std::exception: 2nd leg: negative time (-0.00833333) given
>
> 2>  d:\dev\quantlib\quantlib\test-suite\utilities.hpp(74): last
> 2> checkpoint
>
>
>
> Regards,
>
> Cheng
>
>
> ----------------------------------------------------------------------
> -------- Dive into the World of Parallel Programming! The Go Parallel
> Website, sponsored by Intel and developed in partnership with Slashdot
> Media, is your hub for all things parallel software development, from
> weekly thought leadership blogs to news, videos, case studies,
> tutorials and more. Take a look and join the conversation now.
> http://goparallel.sourceforge.net 
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
>
>
> --
>
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>
>
>
> ----------------------------------------------------------------------
> -------- Dive into the World of Parallel Programming! The Go Parallel
> Website, sponsored by Intel and developed in partnership with Slashdot
> Media, is your hub for all things parallel software development, from
> weekly thought leadership blogs to news, videos, case studies,
> tutorials and more. Take a look and join the conversation now.
> http://goparallel.sourceforge.net 
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users