|
From: Ferdinando A. <fer...@am...> - 2002-04-30 16:41:43
|
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 |