Hi,
When using boost::shared_ptr<YieldTermStructure> swapTermStructure( new PiecewiseYieldCurve<Discount,LogLinear>( settlementDate, depoSwapInstruments, termStructureDayCounter, tolerance)); in constructing a yield curve with quotes t = 1 ... 10, 12, 15, 20, 25, 30, 40 and 50 years, the forward rates are not constant for the intermediate years. How to accomplish this? Regards, André ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
André,
the *instantaneous* forwards f(t) should be constant between the curve's pillar dates when interpolating loglinear in discount. Discrete forwards will vary slightly though, because (a) they are simply compounded, so equal to ( exp( int_s^t f(u) du ) -1 ) / (t-s) which is equal to f(u) only up to first order if f(u) is constant on [t,s], assuming equal daycounters between the curve and the discrete forward convention, or at least a pair of daycounters with constant ratio (t-s) / (t'-s') for all dates possible (b) they may have a different day counter than the curve so int_s^t f(u) = f(u)*(t-s) != f(u)*(t'-s') (again for f(u) constant on [t,s]) and (t'-s') / (t-s) may not be constant for different dates, too - even if the discrete forward would be computed using continuous compounding; (b) applies at least for certain day counter combinations, but not for the "usual" ones in this situation like Act/365Fixed, Act/360. All this is of course independent of QuantLib. Is that what you meant ? Best regards Peter On 11 August 2015 at 11:12, André de Boer <[hidden email]> wrote: > Hi, > > When using > > boost::shared_ptr<YieldTermStructure> swapTermStructure( > new PiecewiseYieldCurve<Discount,LogLinear>( > settlementDate, depoSwapInstruments, > termStructureDayCounter, > tolerance)); > > in constructing a yield curve with quotes t = 1 ... 10, 12, 15, 20, > 25, 30, 40 and 50 years, the forward rates are not constant for the > intermediate years. How to accomplish this? > > Regards, > André > > ------------------------------------------------------------------------------ > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi André,
To add to Peter's comment... If you simply want to display your bootstrapped forward curve as backward piecewise constant, you need to extract yourself the (x,y) data and used your preferred graphical tools (gnuplot of Matlab for instance). If you want to bootstrap from the beginning instantiating a PiecewiseYieldCurve which is bounded to be backward flat in the forward rates I think that you can put <QuantLib::ForwardRate,QuantLib::ForwardFlat> and it should work, but beware that boostrapping inherently requires interpolation and it is not a simple choice of displaying and/or usage of the bootstrapped curve afterwards (see for instance Ametrano, Bianchetti "Everything you always wanted to know about multiple interest rate curve bootstrapping but were afraid to ask"). By the way I just tried and syntax-wise it is OK: I can create PiecewiseYieldCurve<ForwardRate,FlatForward>, but the bootstrapped curve out of it gives important errors with respect to Bloomberg results, while when I put Discount, Loglinear errors are less than cents of bps. Personally I would recommend Discount, LogLinear (or forward rate, linear). Stefano Stefano PORTOLAN - Complex Valuation Services EUROPEAN FUND ADMINISTRATION S.A. 2, rue d’Alsace | L-1122 Luxembourg | Luxembourg Tel.: +352 48 48 80 711 www.efa.eu -----Original Message----- From: Peter Caspers [mailto:[hidden email]] Sent: mardi 11 août 2015 14:31 To: André de Boer Cc: QuantLib users Subject: Re: [Quantlib-users] constant forward in yield curve for intermediate quotes André, the *instantaneous* forwards f(t) should be constant between the curve's pillar dates when interpolating loglinear in discount. Discrete forwards will vary slightly though, because (a) they are simply compounded, so equal to ( exp( int_s^t f(u) du ) -1 ) / (t-s) which is equal to f(u) only up to first order if f(u) is constant on [t,s], assuming equal daycounters between the curve and the discrete forward convention, or at least a pair of daycounters with constant ratio (t-s) / (t'-s') for all dates possible (b) they may have a different day counter than the curve so int_s^t f(u) = f(u)*(t-s) != f(u)*(t'-s') (again for f(u) constant on [t,s]) and (t'-s') / (t-s) may not be constant for different dates, too - even if the discrete forward would be computed using continuous compounding; (b) applies at least for certain day counter combinations, but not for the "usual" ones in this situation like Act/365Fixed, Act/360. All this is of course independent of QuantLib. Is that what you meant ? Best regards Peter On 11 August 2015 at 11:12, André de Boer <[hidden email]> wrote: > Hi, > > When using > > boost::shared_ptr<YieldTermStructure> swapTermStructure( > new PiecewiseYieldCurve<Discount,LogLinear>( > settlementDate, depoSwapInstruments, > termStructureDayCounter, > tolerance)); > > in constructing a yield curve with quotes t = 1 ... 10, 12, 15, 20, > 25, 30, 40 and 50 years, the forward rates are not constant for the > intermediate years. How to accomplish this? > > Regards, > André > > ---------------------------------------------------------------------- > -------- _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users Agile Investment Servicing: Find out more in our latest annual report. <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK> Follow us: <http://www.linkedin.com/company/european-fund-administration> <https://twitter.com/EFA_tweet> The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing. European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725, L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu <http://www.efa.eu> Please consider the environment before printing this e-mail ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
... and finally, when moving towards a pillar date with a discrete
forward, it will start to grow / decrease linearly (up to the inaccuracies mentioned above) when closer to the pillar than the discrete forward period, "fading" into next discrete forward over the time period [ pillar - forwardPeriod, pillar + forwardPeriod ], so effectively the discrete forward curve looks "(almost) piecewise linear, with linear pieces connecting the steps". Maybe you were also referring to this effect ? Peter On 11 August 2015 at 14:36, PORTOLAN Stefano <[hidden email]> wrote: > Hi André, > > To add to Peter's comment... > > If you simply want to display your bootstrapped forward curve as backward piecewise constant, you need to extract yourself the (x,y) data and used your preferred graphical tools (gnuplot of Matlab for instance). > If you want to bootstrap from the beginning instantiating a PiecewiseYieldCurve which is bounded to be backward flat in the forward rates I think that you can put <QuantLib::ForwardRate,QuantLib::ForwardFlat> and it should work, but beware that boostrapping inherently requires interpolation and it is not a simple choice of displaying and/or usage of the bootstrapped curve afterwards (see for instance Ametrano, Bianchetti "Everything you always wanted to know about multiple interest rate curve bootstrapping but were afraid to ask"). > By the way I just tried and syntax-wise it is OK: I can create PiecewiseYieldCurve<ForwardRate,FlatForward>, but the bootstrapped curve out of it gives important errors with respect to Bloomberg results, while when I put Discount, Loglinear errors are less than cents of bps. > Personally I would recommend Discount, LogLinear (or forward rate, linear). > > Stefano > > Stefano PORTOLAN - Complex Valuation Services > > EUROPEAN FUND ADMINISTRATION S.A. > 2, rue d’Alsace | L-1122 Luxembourg | Luxembourg > Tel.: +352 48 48 80 711 > www.efa.eu > > > > -----Original Message----- > From: Peter Caspers [mailto:[hidden email]] > Sent: mardi 11 août 2015 14:31 > To: André de Boer > Cc: QuantLib users > Subject: Re: [Quantlib-users] constant forward in yield curve for intermediate quotes > > André, > > the *instantaneous* forwards f(t) should be constant between the curve's pillar dates when interpolating loglinear in discount. > Discrete forwards will vary slightly though, because > > (a) they are simply compounded, so equal to ( exp( int_s^t f(u) du ) > -1 ) / (t-s) which is equal to f(u) only up to first order if f(u) is constant on [t,s], assuming equal daycounters between the curve and the discrete forward convention, or at least a pair of daycounters with constant ratio (t-s) / (t'-s') for all dates possible > > (b) they may have a different day counter than the curve so int_s^t > f(u) = f(u)*(t-s) != f(u)*(t'-s') (again for f(u) constant on [t,s]) and (t'-s') / (t-s) may not be constant for different dates, too - even if the discrete forward would be computed using continuous compounding; (b) applies at least for certain day counter combinations, but not for the "usual" ones in this situation like Act/365Fixed, Act/360. > > All this is of course independent of QuantLib. Is that what you meant ? > > Best regards > Peter > > On 11 August 2015 at 11:12, André de Boer <[hidden email]> wrote: >> Hi, >> >> When using >> >> boost::shared_ptr<YieldTermStructure> swapTermStructure( >> new PiecewiseYieldCurve<Discount,LogLinear>( >> settlementDate, depoSwapInstruments, >> termStructureDayCounter, >> tolerance)); >> >> in constructing a yield curve with quotes t = 1 ... 10, 12, 15, 20, >> 25, 30, 40 and 50 years, the forward rates are not constant for the >> intermediate years. How to accomplish this? >> >> Regards, >> André >> >> ---------------------------------------------------------------------- >> -------- _______________________________________________ >> QuantLib-users mailing list >> [hidden email] >> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------------------------------ > _______________________________________________ > QuantLib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > Agile Investment Servicing: Find out more in our latest annual report. <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK> > > > > Follow us: > <http://www.linkedin.com/company/european-fund-administration> <https://twitter.com/EFA_tweet> > > > > The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing. > > > > European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725, L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu <http://www.efa.eu> > > > > Please consider the environment before printing this e-mail ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
"(almost) piecewise constant, with linear pieces connecting the steps"
is what I wanted to say. Peter On 11 August 2015 at 15:44, Peter Caspers <[hidden email]> wrote: > ... and finally, when moving towards a pillar date with a discrete > forward, it will start to grow / decrease linearly (up to the > inaccuracies mentioned above) when closer to the pillar than the > discrete forward period, "fading" into next discrete forward over the > time period [ pillar - forwardPeriod, pillar + forwardPeriod ], so > effectively the discrete forward curve looks "(almost) piecewise > linear, with linear pieces connecting the steps". Maybe you were also > referring to this effect ? > Peter > > On 11 August 2015 at 14:36, PORTOLAN Stefano <[hidden email]> wrote: >> Hi André, >> >> To add to Peter's comment... >> >> If you simply want to display your bootstrapped forward curve as backward piecewise constant, you need to extract yourself the (x,y) data and used your preferred graphical tools (gnuplot of Matlab for instance). >> If you want to bootstrap from the beginning instantiating a PiecewiseYieldCurve which is bounded to be backward flat in the forward rates I think that you can put <QuantLib::ForwardRate,QuantLib::ForwardFlat> and it should work, but beware that boostrapping inherently requires interpolation and it is not a simple choice of displaying and/or usage of the bootstrapped curve afterwards (see for instance Ametrano, Bianchetti "Everything you always wanted to know about multiple interest rate curve bootstrapping but were afraid to ask"). >> By the way I just tried and syntax-wise it is OK: I can create PiecewiseYieldCurve<ForwardRate,FlatForward>, but the bootstrapped curve out of it gives important errors with respect to Bloomberg results, while when I put Discount, Loglinear errors are less than cents of bps. >> Personally I would recommend Discount, LogLinear (or forward rate, linear). >> >> Stefano >> >> Stefano PORTOLAN - Complex Valuation Services >> >> EUROPEAN FUND ADMINISTRATION S.A. >> 2, rue d’Alsace | L-1122 Luxembourg | Luxembourg >> Tel.: +352 48 48 80 711 >> www.efa.eu >> >> >> >> -----Original Message----- >> From: Peter Caspers [mailto:[hidden email]] >> Sent: mardi 11 août 2015 14:31 >> To: André de Boer >> Cc: QuantLib users >> Subject: Re: [Quantlib-users] constant forward in yield curve for intermediate quotes >> >> André, >> >> the *instantaneous* forwards f(t) should be constant between the curve's pillar dates when interpolating loglinear in discount. >> Discrete forwards will vary slightly though, because >> >> (a) they are simply compounded, so equal to ( exp( int_s^t f(u) du ) >> -1 ) / (t-s) which is equal to f(u) only up to first order if f(u) is constant on [t,s], assuming equal daycounters between the curve and the discrete forward convention, or at least a pair of daycounters with constant ratio (t-s) / (t'-s') for all dates possible >> >> (b) they may have a different day counter than the curve so int_s^t >> f(u) = f(u)*(t-s) != f(u)*(t'-s') (again for f(u) constant on [t,s]) and (t'-s') / (t-s) may not be constant for different dates, too - even if the discrete forward would be computed using continuous compounding; (b) applies at least for certain day counter combinations, but not for the "usual" ones in this situation like Act/365Fixed, Act/360. >> >> All this is of course independent of QuantLib. Is that what you meant ? >> >> Best regards >> Peter >> >> On 11 August 2015 at 11:12, André de Boer <[hidden email]> wrote: >>> Hi, >>> >>> When using >>> >>> boost::shared_ptr<YieldTermStructure> swapTermStructure( >>> new PiecewiseYieldCurve<Discount,LogLinear>( >>> settlementDate, depoSwapInstruments, >>> termStructureDayCounter, >>> tolerance)); >>> >>> in constructing a yield curve with quotes t = 1 ... 10, 12, 15, 20, >>> 25, 30, 40 and 50 years, the forward rates are not constant for the >>> intermediate years. How to accomplish this? >>> >>> Regards, >>> André >>> >>> ---------------------------------------------------------------------- >>> -------- _______________________________________________ >>> QuantLib-users mailing list >>> [hidden email] >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> QuantLib-users mailing list >> [hidden email] >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> >> Agile Investment Servicing: Find out more in our latest annual report. <http://www.efa.eu/documents/10136/0/2014+Overview+-+UK> >> >> >> >> Follow us: >> <http://www.linkedin.com/company/european-fund-administration> <https://twitter.com/EFA_tweet> >> >> >> >> The information in this e-mail message and/ or its attachments is confidential and may be legally privileged, thus any disclosure, copying, distribution or any action taken or omitted to be taken in reliance thereon may be strictly prohibited and unlawful. If you are not the intended recipient, please notify us immediately and destroy this e-mail and its attachments. Considering the various risks involved when sending emails through the Internet, EFA will not be liable in any case for damages and claims due to the risks of this communication channel (e.g. non or late delivery, message corruption, inadvertent disclosure). Any views or opinions presented in this email and/or its attachments are solely those of the author and do not necessarily represent those of the company, consequently, EFA may not be held liable for its content unless confirmed subsequently in writing. >> >> >> >> European Fund Administration SA | 2 rue d'Alsace, P.O. Box 1725, L-1017 Luxembourg | Tel: +352 48 48 80 80 | www.efa.eu <http://www.efa.eu> >> >> >> >> Please consider the environment before printing this e-mail ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |