|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
Svensson Fitting method. More...
#include <nonlinearfittingmethods.hpp>
Inheritance diagram for SvenssonFitting:
Collaboration diagram for SvenssonFitting:Public Member Functions | |
| SvenssonFitting (const Array &weights=Array(), const ext::shared_ptr< OptimizationMethod > &optimizationMethod={}, const Array &l2=Array(), Real minCutoffTime=0.0, Real maxCutoffTime=QL_MAX_REAL, Constraint constraint=NoConstraint()) | |
| SvenssonFitting (const Array &weights, const Array &l2, Real minCutoffTime=0.0, Real maxCutoffTime=QL_MAX_REAL, Constraint constraint=NoConstraint()) | |
| std::unique_ptr< FittedBondDiscountCurve::FittingMethod > | clone () const override |
| clone of the current object More... | |
Public Member Functions inherited from FittedBondDiscountCurve::FittingMethod | |
| virtual | ~FittingMethod ()=default |
| virtual Size | size () const =0 |
| total number of coefficients to fit/solve for More... | |
| Array | solution () const |
| output array of results of optimization problem More... | |
| Integer | numberOfIterations () const |
| final number of iterations used in the optimization problem More... | |
| Real | minimumCostValue () const |
| final value of cost function after optimization More... | |
| EndCriteria::Type | errorCode () const |
| error code of the optimization More... | |
| virtual std::unique_ptr< FittingMethod > | clone () const =0 |
| clone of the current object More... | |
| bool | constrainAtZero () const |
| return whether there is a constraint at zero More... | |
| Array | weights () const |
| return weights being used More... | |
| Array | l2 () const |
| return l2 penalties being used More... | |
| ext::shared_ptr< OptimizationMethod > | optimizationMethod () const |
| return optimization method being used More... | |
| const Constraint & | constraint () const |
| return optimization contraint More... | |
| DiscountFactor | discount (const Array &x, Time t) const |
| open discountFunction to public More... | |
Private Member Functions | |
| Size | size () const override |
| total number of coefficients to fit/solve for More... | |
| DiscountFactor | discountFunction (const Array &x, Time t) const override |
| discount function called by FittedBondDiscountCurve More... | |
Additional Inherited Members | |
Protected Member Functions inherited from FittedBondDiscountCurve::FittingMethod | |
| FittingMethod (bool constrainAtZero=true, const Array &weights=Array(), ext::shared_ptr< OptimizationMethod > optimizationMethod=ext::shared_ptr< OptimizationMethod >(), Array l2=Array(), Real minCutoffTime=0.0, Real maxCutoffTime=QL_MAX_REAL, Constraint constraint=NoConstraint()) | |
| constructors More... | |
| virtual void | init () |
| rerun every time instruments/referenceDate changes More... | |
| virtual DiscountFactor | discountFunction (const Array &x, Time t) const =0 |
| discount function called by FittedBondDiscountCurve More... | |
Protected Attributes inherited from FittedBondDiscountCurve::FittingMethod | |
| bool | constrainAtZero_ |
| constrains discount function to unity at \( T=0 \), if true More... | |
| FittedBondDiscountCurve * | curve_ |
| internal reference to the FittedBondDiscountCurve instance More... | |
| Array | solution_ |
| solution array found from optimization, set in calculate() More... | |
| Array | guessSolution_ |
| optional guess solution to be passed into constructor. More... | |
| ext::shared_ptr< FittingCost > | costFunction_ |
| base class sets this cost function used in the optimization routine More... | |
Svensson Fitting method.
Fits a discount function to the form \( d(t) = e^{-r t}, \) where the zero rate \(r\) is defined as
\[ r \equiv c_0 + (c_1 + c_2) \left( \frac {1 - e^{-\kappa t}}{\kappa t} \right) - c_2 e^{ - \kappa t} + c_3 \left( \frac{1 - e^{-\kappa_1 t}}{\kappa_1 t} -e^{-\kappa_1 t} \right). \]
See: Svensson, L. (1994). Estimating and interpreting forward interest rates: Sweden 1992-4. Discussion paper, Centre for Economic Policy Research(1051).
Definition at line 128 of file nonlinearfittingmethods.hpp.
| SvenssonFitting | ( | const Array & | weights = Array(), |
| const ext::shared_ptr< OptimizationMethod > & | optimizationMethod = {}, |
||
| const Array & | l2 = Array(), |
||
| Real | minCutoffTime = 0.0, |
||
| Real | maxCutoffTime = QL_MAX_REAL, |
||
| Constraint | constraint = NoConstraint() |
||
| ) |
Definition at line 143 of file nonlinearfittingmethods.cpp.
| SvenssonFitting | ( | const Array & | weights, |
| const Array & | l2, | ||
| Real | minCutoffTime = 0.0, |
||
| Real | maxCutoffTime = QL_MAX_REAL, |
||
| Constraint | constraint = NoConstraint() |
||
| ) |
Definition at line 152 of file nonlinearfittingmethods.cpp.
|
overridevirtual |
clone of the current object
Implements FittedBondDiscountCurve::FittingMethod.
Definition at line 161 of file nonlinearfittingmethods.cpp.
|
overrideprivatevirtual |
total number of coefficients to fit/solve for
Implements FittedBondDiscountCurve::FittingMethod.
Definition at line 165 of file nonlinearfittingmethods.cpp.
Here is the caller graph for this function:
|
overrideprivatevirtual |
discount function called by FittedBondDiscountCurve
Implements FittedBondDiscountCurve::FittingMethod.
Definition at line 169 of file nonlinearfittingmethods.cpp.
Here is the call graph for this function: