Discount curve fitted to a set of fixed-coupon bonds
This class fits a discount function $ d(t) $ over a set of
bonds, using a user defined fitting method. The discount
function is fit in such a way so that all cashflows of all
input bonds, when discounted using $ d(t) $, will
reproduce the set of input bond prices in an optimized
sense. Minimized price errors are weighted by the inverse of
their respective bond duration.
The FittedBondDiscountCurve class acts as a generic wrapper,
while its inner class FittingMethod provides the
implementation details. Developers thus need only derive new
fitting methods from the latter.
warning
The method can be slow if there are many bonds to
fit. Speed also depends on the particular choice of
fitting method chosen and its convergence properties
under optimization. See also todo list for
BondDiscountCurveFittingMethod.
todo
refactor the bond helper class so that it is pure
virtual and returns a generic bond or its cash
flows. Derived classes would include helpers for
fixed-rate and zero-coupon bonds. In this way, both
bonds and bills can be used to fit a discount curve
using the exact same machinery. At present, only
fixed-coupon bonds are supported. An even better way to
move forward might be to get rate helpers to return
cashflows, in which case this class could be used to fit
any set of cash flows, not just bonds.
todo
add more fitting diagnostics: smoothness, standard
deviation, student-t test, etc. Generic smoothness
method may be useful for smoothing splines fitting. See
Fisher, M., D. Nychka and D. Zervos: "Fitting the term
structure of interest rates with smoothing splines."
Board of Governors of the Federal Reserve System,
Federal Resere Board Working Paper, 95-1.
Discount curve fitted to a set of fixed-coupon bonds
This class fits a discount function $ d(t) $ over a set of bonds, using a user defined fitting method. The discount function is fit in such a way so that all cashflows of all input bonds, when discounted using $ d(t) $, will reproduce the set of input bond prices in an optimized sense. Minimized price errors are weighted by the inverse of their respective bond duration.
The FittedBondDiscountCurve class acts as a generic wrapper, while its inner class FittingMethod provides the implementation details. Developers thus need only derive new fitting methods from the latter.
The method can be slow if there are many bonds to fit. Speed also depends on the particular choice of fitting method chosen and its convergence properties under optimization. See also todo list for BondDiscountCurveFittingMethod.
refactor the bond helper class so that it is pure virtual and returns a generic bond or its cash flows. Derived classes would include helpers for fixed-rate and zero-coupon bonds. In this way, both bonds and bills can be used to fit a discount curve using the exact same machinery. At present, only fixed-coupon bonds are supported. An even better way to move forward might be to get rate helpers to return cashflows, in which case this class could be used to fit any set of cash flows, not just bonds.
add more fitting diagnostics: smoothness, standard deviation, student-t test, etc. Generic smoothness method may be useful for smoothing splines fitting. See Fisher, M., D. Nychka and D. Zervos: "Fitting the term structure of interest rates with smoothing splines." Board of Governors of the Federal Reserve System, Federal Resere Board Working Paper, 95-1.
add extrapolation routines