QuantLib: CubicBSplinesFitting Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.12

Public Member Functions | List of all members
CubicBSplinesFitting Class Reference

CubicSpline B-splines fitting method. More...

`#include <ql/termstructures/yield/nonlinearfittingmethods.hpp>`

Inheritance diagram for CubicBSplinesFitting:
[legend]

## Public Member Functions
| CubicBSplinesFitting (const std::vector< Time > &knotVector, bool constrainAtZero=true, const Array &weights=Array(), boost::shared_ptr< OptimizationMethod > optimizationMethod=boost::shared_ptr< OptimizationMethod >(), const Array &l2=Array())
| CubicBSplinesFitting (const std::vector< Time > &knotVector, bool constrainAtZero, const Array &weights, const Array &l2)
Real | basisFunction (Integer i, Time t) const
| cubic B-spline basis functions
std::auto_ptr< FittedBondDiscountCurve::FittingMethod > | clone () const
| clone of the current object
Public Member Functions inherited from FittedBondDiscountCurve::FittingMethod
Array | solution () const
| output array of results of optimization problem
Integer | numberOfIterations () const
| final number of iterations used in the optimization problem
Real | minimumCostValue () const
| final value of cost function after optimization
bool | constrainAtZero () const
| return whether there is a constraint at zero
Array | weights () const
| return weights being used
Array | l2 () const
| return l2 penalties being used
boost::shared_ptr< OptimizationMethod > | optimizationMethod () const
| return optimization method being used
DiscountFactor | discount (const Array &x, Time t) const
| open discountFunction to public

## Additional Inherited Members
Protected Member Functions inherited from FittedBondDiscountCurve::FittingMethod
| FittingMethod (bool constrainAtZero=true, const Array &weights=Array(), boost::shared_ptr< OptimizationMethod > optimizationMethod=boost::shared_ptr< OptimizationMethod >(), const Array &l2=Array())
| constructors
virtual void | init ()
| rerun every time instruments/referenceDate changes
Protected Attributes inherited from FittedBondDiscountCurve::FittingMethod
bool | constrainAtZero_
| constrains discount function to unity at \( T=0 \), if true
FittedBondDiscountCurve * | curve_
| internal reference to the FittedBondDiscountCurve instance
Array | solution_
| solution array found from optimization, set in calculate()
Array | guessSolution_
| optional guess solution to be passed into constructor. More...
boost::shared_ptr< FittingCost > | costFunction_
| base class sets this cost function used in the optimization routine

## Detailed Description

CubicSpline B-splines fitting method.

Fits a discount function to a set of cubic B-splines \( N_{i,3}(t) \), i.e.,

\[ d(t) = \sum_{i=0}^{n} c_i * N_{i,3}(t) \]

See: McCulloch, J. 1971, "Measuring the Term Structure of Interest Rates." Journal of Business, 44: 19-31

McCulloch, J. 1975, "The tax adjusted yield curve." Journal of Finance, XXX811-30

Warning:
  "The results are extremely sensitive to the number and location of the knot points, and there is no optimal way of selecting them." James, J. and N. Webber, "Interest Rate Modelling" John Wiley, 2000, pp. 440.

Examples:
  FittedBondCurve.cpp.