Login  Register

Re: Fwd: Floating errors in the term-structure code?

Posted by Student T on Apr 12, 2016; 2:40pm
URL: http://quantlib.414.s1.nabble.com/Fwd-Floating-errors-in-the-term-structure-code-tp17402p17404.html

Luigi,

I don't know what exactly causing it. I've attached the full-source code.





On Wed, Apr 13, 2016 at 1:36 AM, Luigi Ballabio <[hidden email]> wrote:
Hello,
    the discrepancy seems rather large to be due to a floating-point error. It might be due to a day-count mismatch, or some other convention instead. What is the underlying index, and what are the coupon dates for the case above?

Luigi


On Tue, Apr 12, 2016 at 4:54 PM Ted Wong <[hidden email]> wrote:
Hi,

I have an LIBOR index that is linked to a flat forward-curve. Although this is unrealistic, I just want it to test QuantLib's implementation. 

My fixed rate is 0.10, so I expect if I put a breakpoint inside QuantLib, I would see it. However, the rate I get is 0.100459737, please take a look at my screenshot.

My suspicion is that QuantLib calculates the forward rate by dividing two discount factors in IborIndex::forecastFixing, and thus causing some floating errors. Am I right?

My code and screenshot are here:

    RelinkableHandle<YieldTermStructure> termStructure;              

    termStructure.linkTo(flatRate(t_, 0.10, Actual360()));

                <Create a swap>

    std::cout << swap->NPV() << std::endl;

Inline image 1



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

test.cpp (2K) Download Attachment