Hi,
I have a bit of a problem with the name compoundforward, essentially it bootstraps a strip of forwards of some compounding freq to a strip of discountfactors. These df's it then uses to get back to zeros and instantaneous forwards, so it seems it is more in the line of a DiscountStructure? In fact I have gone as far as inheriting from DiscountStructure and passing the implementation of zeroYield and forward to it. Haven't checked in yet, would like to hear yr comments first? Andre ------------------------------------------------------------------------- This e-mail is intended only for the use of the individual or entity named above and may contain information that is confidential and privileged, proprietary to the company and protected by law. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. Opinions, conclusions and other information in this message that do not relate to the official business of our company shall be understood as neither given nor endorsed by it. |
At 01:25 PM 4/25/2002 +0200, Andre Louw wrote:
>I have a bit of a problem with the name compoundforward, essentially it >bootstraps a strip of forwards of some compounding freq to a strip of >discountfactors. These df's it then uses to get back to zeros and >instantaneous forwards, so it seems it is more in the line of a >DiscountStructure? >In fact I have gone as far as inheriting from DiscountStructure and passing >the implementation of zeroYield and forward to it. Haven't checked in yet, >would like to hear yr comments first? I think it could/should be just another constructor of the DiscountCurve class. The TermStructure framework as I see it: 1st layer) QuantLib::TermStructure is the general interface 2nd layer) QuantLib::ZeroYieldStructure, QuantLib::DiscountStructure, QuantLib::ForwardRateStructure are generic parameterizations of the TermStructure in term of zero, discount, instantaneous forward respectively. If someone needs a parameterization in term of discrete forwards this could be the appropriate layer. 3rd layer) Here you are inside the QuantLib::TermStructures namespace. This is the layer where you provide a functional form to your TermStructure, e.g. piece-wise constant instantaneous forwards for QuantLib::TermStructures::PiecewiseFlatForward, loglinear interpolated discounts for QuantLib::TermStructures::DiscountCurve, etc. Please note that in these two examples the functional forms are completely equivalent, but one could think of cubic spline interpolated zeros, etc. For sake of clarity I would even derive PiecewiseFlatForward from QuantLib::ForwardRateStructure (now it derives from QuantLib::TermStructure), just to stress that it is a third conceptual layer. Every class in the third layer could (should?) easily provide 3 constructors based on a grid of discounts, zeros, forwards respectively, whatever their parameterization and functional form are In this framework CompoundForward could become just a specialized constructor using discrete forwards of QuantLib::TermStructures::DiscountCurve What do you think about this framework? ciao -- Nando |
Hi,
I'm fine with the layered structure, but this is a case in which I do think that there's way too many constructors. Make them factory functions instead, distincts from the term structure classes---this way you can also reuse them for different term structures. Or full-featured factories. Observability of market elements should enter the equation, too, although I'm not going to give it much thought at 8 pm :) Bye, Luigi At 06:41 PM 4/30/02 +0200, Ferdinando Ametrano wrote: >At 01:25 PM 4/25/2002 +0200, Andre Louw wrote: >>I have a bit of a problem with the name compoundforward, essentially it >>bootstraps a strip of forwards of some compounding freq to a strip of >>discountfactors. These df's it then uses to get back to zeros and >>instantaneous forwards, so it seems it is more in the line of a >>DiscountStructure? >>In fact I have gone as far as inheriting from DiscountStructure and passing >>the implementation of zeroYield and forward to it. Haven't checked in yet, >>would like to hear yr comments first? >I think it could/should be just another constructor of the DiscountCurve >class. > >The TermStructure framework as I see it: > >1st layer) QuantLib::TermStructure is the general interface > >2nd layer) QuantLib::ZeroYieldStructure, QuantLib::DiscountStructure, >QuantLib::ForwardRateStructure are generic parameterizations of the >TermStructure in term of zero, discount, instantaneous forward >respectively. If someone needs a parameterization in term of discrete >forwards this could be the appropriate layer. > >3rd layer) Here you are inside the QuantLib::TermStructures namespace. >This is the layer where you provide a functional form to your >TermStructure, e.g. piece-wise constant instantaneous forwards for >QuantLib::TermStructures::PiecewiseFlatForward, loglinear interpolated >discounts for QuantLib::TermStructures::DiscountCurve, etc. >Please note that in these two examples the functional forms are completely >equivalent, but one could think of cubic spline interpolated zeros, etc. >For sake of clarity I would even derive PiecewiseFlatForward from >QuantLib::ForwardRateStructure (now it derives from >QuantLib::TermStructure), just to stress that it is a third conceptual layer. >Every class in the third layer could (should?) easily provide 3 >constructors based on a grid of discounts, zeros, forwards respectively, >whatever their parameterization and functional form are > >In this framework CompoundForward could become just a specialized >constructor using discrete forwards of QuantLib::TermStructures::DiscountCurve > >What do you think about this framework? > >ciao -- Nando > > >_______________________________________________ >Quantlib-dev mailing list >[hidden email] >https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi,
I totally agree with Luigi. Marco At 08:03 PM 4/30/02 +0100, Luigi Ballabio wrote: >Hi, > I'm fine with the layered structure, but this is a case in which > I do think that there's way too many constructors. Make them factory > functions instead, distincts from the term structure classes---this way > you can also reuse them for different term structures. Or full-featured > factories. >Observability of market elements should enter the equation, too, although >I'm not going to give it much thought at 8 pm :) > >Bye, > Luigi > >At 06:41 PM 4/30/02 +0200, Ferdinando Ametrano wrote: >>At 01:25 PM 4/25/2002 +0200, Andre Louw wrote: >>>I have a bit of a problem with the name compoundforward, essentially it >>>bootstraps a strip of forwards of some compounding freq to a strip of >>>discountfactors. These df's it then uses to get back to zeros and >>>instantaneous forwards, so it seems it is more in the line of a >>>DiscountStructure? >>>In fact I have gone as far as inheriting from DiscountStructure and passing >>>the implementation of zeroYield and forward to it. Haven't checked in yet, >>>would like to hear yr comments first? >>I think it could/should be just another constructor of the DiscountCurve >>class. >> >>The TermStructure framework as I see it: >> >>1st layer) QuantLib::TermStructure is the general interface >> >>2nd layer) QuantLib::ZeroYieldStructure, QuantLib::DiscountStructure, >>QuantLib::ForwardRateStructure are generic parameterizations of the >>TermStructure in term of zero, discount, instantaneous forward >>respectively. If someone needs a parameterization in term of discrete >>forwards this could be the appropriate layer. >> >>3rd layer) Here you are inside the QuantLib::TermStructures namespace. >>This is the layer where you provide a functional form to your >>TermStructure, e.g. piece-wise constant instantaneous forwards for >>QuantLib::TermStructures::PiecewiseFlatForward, loglinear interpolated >>discounts for QuantLib::TermStructures::DiscountCurve, etc. >>Please note that in these two examples the functional forms are >>completely equivalent, but one could think of cubic spline interpolated >>zeros, etc. >>For sake of clarity I would even derive PiecewiseFlatForward from >>QuantLib::ForwardRateStructure (now it derives from >>QuantLib::TermStructure), just to stress that it is a third conceptual layer. >>Every class in the third layer could (should?) easily provide 3 >>constructors based on a grid of discounts, zeros, forwards respectively, >>whatever their parameterization and functional form are >> >>In this framework CompoundForward could become just a specialized >>constructor using discrete forwards of QuantLib::TermStructures::DiscountCurve >> >>What do you think about this framework? >> >>ciao -- Nando >> >> >>_______________________________________________ >>Quantlib-dev mailing list >>[hidden email] >>https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > >_______________________________________________ >Quantlib-dev mailing list >[hidden email] >https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |