Login  Register

Re: Svensson overshooting when fitting the bond yield curve.

Posted by randomAlpha on Sep 30, 2014; 3:45pm
URL: http://quantlib.414.s1.nabble.com/Svensson-overshooting-when-fitting-the-bond-yield-curve-tp15926p15931.html

The betas are not stable so you may get significantly different answers depending on initial guess, tolerance, number of iterations. As long as the pricing errors are minimized you should have similar curves. You should also note that five bonds is not a well populated curve and if you don't include short rates it is possible to get negative values below your shortest maturity.

To compare two different curves it's generally best to diff the forwards as these will be the most sensitive components


> On Sep 29, 2014, at 10:42 PM, SteveGe <[hidden email]> wrote:
>
> Thanks a lot for your quick reply KK.
>
> I modified the example code in QuantLib-1.4\Examples\FittedBondCurve to use
> my five bonds and coupons.
> Code snippet as below.  The parameters I got is very different from yours.
>
> solution_[0] = -0.260551     //this should be your beta1
> solution_[1] = 0.249855     //this should be your beta2
> solution_[2] = 0.512962    //this should be your beta3
> solution_[3] = 0.131457     //this should be your beta4
> solution_[4] = 0.0729963    // this might be your 1/lamada1
> solution_[5] = 1.56969      // this might be your 1/lamada2
>
>
> const Size numberOfBonds = 5;
>        Real cleanPrice[numberOfBonds];
>        for (Size i=0; i<numberOfBonds; i++) {
>            cleanPrice[i]=100.0;
>        }
>        std::vector&lt; boost::shared_ptr&lt;SimpleQuote> > quote;
>        for (Size i=0; i<numberOfBonds; i++) {
>            boost::shared_ptr&lt;SimpleQuote> cp(new
> SimpleQuote(cleanPrice[i]));
>            quote.push_back(cp);
>        }
>        RelinkableHandle quoteHandle[numberOfBonds];
>        for (Size i=0; i<numberOfBonds; i++) {
>            quoteHandle[i].linkTo(quote[i]);
>        }
>        Integer lengths[] = { 1, 3, 5, 7, 10 };
>        Real coupons[] = { 0.0379, 0.0397, 0.0399, 0.0416, 0.0426 };
>
>        DayCounter dc = ActualActual(ActualActual::Bond);
>        BusinessDayConvention accrualConvention = Unadjusted;
>        BusinessDayConvention convention = Unadjusted;
>
> Did I make any mistake here ?
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Svensson-overshooting-when-fitting-the-bond-yield-curve-tp15926p15929.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users