QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
SpreadFittingMethod Class Reference

Spread fitting method helper. More...

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

Inheritance diagram for SpreadFittingMethod:

Public Member Functions

 SpreadFittingMethod (const ext::shared_ptr< FittingMethod > &method, Handle< YieldTermStructure > discountCurve, Real minCutoffTime=0.0, Real maxCutoffTime=QL_MAX_REAL)
std::unique_ptr< FittedBondDiscountCurve::FittingMethodclone () const override
 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
EndCriteria::Type errorCode () const
 error code of the 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
ext::shared_ptr< OptimizationMethodoptimizationMethod () const
 return optimization method being used
const Constraintconstraint () const
 return optimization contraint
DiscountFactor discount (const Array &x, Time t) const
 open discountFunction to public

Protected Member Functions

void init () override
 rerun every time instruments/referenceDate changes
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

Additional Inherited Members

Protected Attributes inherited from FittedBondDiscountCurve::FittingMethod
bool constrainAtZero_
 constrains discount function to unity at \( T=0 \), if true
FittedBondDiscountCurvecurve_
 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.
ext::shared_ptr< FittingCost > costFunction_
 base class sets this cost function used in the optimization routine

Detailed Description

Spread fitting method helper.

Fits a spread curve on top of a discount function according to the given parametric method

Examples
FittedBondCurve.cpp.

Member Function Documentation

◆ clone()

std::unique_ptr< FittedBondDiscountCurve::FittingMethod > clone ( ) const
overridevirtual

clone of the current object

Implements FittedBondDiscountCurve::FittingMethod.

◆ init()

void init ( )
overrideprotectedvirtual

rerun every time instruments/referenceDate changes

Reimplemented from FittedBondDiscountCurve::FittingMethod.