Class implements. More...

#include <constrainedSmoother.hpp>

Inheritance diagram for julian::ir::ConstrainedSmoother:
julian::ir::Estimator

Public Member Functions

 ConstrainedSmoother (SmartPointer< SmootherCostFunction > cf, const std::vector< double > &lT, const std::vector< double > &uT, int number_of_iterations)
 Constructor. More...
 
 ConstrainedSmoother (SmartPointer< SmootherCostFunction > cf, double tolerance, int number_of_iterations)
 Constructor. More...
 
virtual void calculate (const std::vector< SmartPointer< BuildingBlock > > &instruments, const CurveSettings &settings, SmartPointer< ir::Curve > &discounting_curve, SmartPointer< ir::Curve > &projection_curve)
 Estimates the curve. More...
 
virtual std::vector< double > getDF () const
 Returns estimated DF. More...
 
virtual std::vector< DategetDates () const
 Returns grid dates of the curve. More...
 
virtual ConstrainedSmootherclone () const
 Virtual Copy Constructor. More...
 
virtual std::string info () const
 Returns estimator's name. More...
 
- Public Member Functions inherited from julian::ir::Estimator
 Estimator ()
 default constructor More...
 
virtual ~Estimator ()
 destructor More...
 

Private Member Functions

arma::mat calculateJacobian (SmartPointer< ir::Curve >, SmartPointer< ir::Curve >, InterpolatedCurve, const std::vector< SmartPointer< BuildingBlock > > &)
 Method used by SQP algorithm to calculate Jacobian for constrains' approximation. More...
 
arma::mat calculateParRates (const SmartPointer< ir::Curve > &, const SmartPointer< ir::Curve > &, const SmartPointer< ir::Curve > &, const std::vector< SmartPointer< BuildingBlock > > &)
 Calculates the vector of par rates for instruments. More...
 

Private Attributes

SmartPointer< SmootherCostFunctioncost_function_
 Cost Function. More...
 
std::vector< double > lower_tolerance_
 Lower tolerances for par rate generated by curve. More...
 
std::vector< double > upper_tolerance_
 Upper tolerances for par rate generated by curve. More...
 
int number_of_iterations_
 Number of iterations of Sequential Quadratic Programming. More...
 
double tolerance_
 Tolerance for par rate generated by curve. More...
 
std::vector< double > DFs_
 Vector holding the Discount Factors being result of estimation. More...
 
std::vector< Datedates_
 Grid dates of resulting curve. More...
 

Detailed Description

Class implements.

The idea of this estimator is to find the minimum of function (see SmootherCostFunction)

\[Cost_{f} = a \int^{tN}_{t0} \Big(\frac{df(x)}{dx}\Big)^2 dx + b \int^{tN}_{t0} \Big(\frac{df^2(x)}{dx^2}\Big)^2 dx \]

with following constrains:

\[q_i -tolerante_{lower} < r_i < q_i + tolerance_{upper}\]

where:

  • $q_i$
To document:
Describe the algorithm more precisly
Examples:
constrainedBootstrapperExample.cpp.

Constructor & Destructor Documentation

julian::ir::ConstrainedSmoother::ConstrainedSmoother ( SmartPointer< SmootherCostFunction cf,
const std::vector< double > &  lT,
const std::vector< double > &  uT,
int  number_of_iterations 
)

Constructor.

Parameters
cfCost function
lTlower tolerance vector
uTupper tolerance vector
number_of_iterationsNumber of iteration of Sequential Quadratic Programming algorithm
julian::ir::ConstrainedSmoother::ConstrainedSmoother ( SmartPointer< SmootherCostFunction cf,
double  tolerance,
int  number_of_iterations 
)

Constructor.

Parameters
cfCost function
toleranceMaximal deviation from market quote
number_of_iterationsNumber of iteration of Sequential Quadratic Programming algorithm

Member Function Documentation

void julian::ir::ConstrainedSmoother::calculate ( const std::vector< SmartPointer< BuildingBlock > > &  instruments,
const CurveSettings settings,
SmartPointer< ir::Curve > &  discounting_curve,
SmartPointer< ir::Curve > &  projection_curve 
)
virtual

Estimates the curve.

Algorithm uses the SQP algorithm to estimate the curve.

Implements julian::ir::Estimator.

arma::mat julian::ir::ConstrainedSmoother::calculateJacobian ( SmartPointer< ir::Curve disc,
SmartPointer< ir::Curve proj,
InterpolatedCurve  smoothed,
const std::vector< SmartPointer< BuildingBlock > > &  instruments 
)
private

Method used by SQP algorithm to calculate Jacobian for constrains' approximation.

arma::mat julian::ir::ConstrainedSmoother::calculateParRates ( const SmartPointer< ir::Curve > &  disc,
const SmartPointer< ir::Curve > &  proj,
const SmartPointer< ir::Curve > &  smoothed,
const std::vector< SmartPointer< BuildingBlock > > &  instruments 
)
private

Calculates the vector of par rates for instruments.

ConstrainedSmoother * julian::ir::ConstrainedSmoother::clone ( ) const
virtual

Virtual Copy Constructor.

Implements julian::ir::Estimator.

std::vector< Date > julian::ir::ConstrainedSmoother::getDates ( ) const
virtual

Returns grid dates of the curve.

Implements julian::ir::Estimator.

std::vector< double > julian::ir::ConstrainedSmoother::getDF ( ) const
virtual

Returns estimated DF.

Implements julian::ir::Estimator.

std::string julian::ir::ConstrainedSmoother::info ( ) const
virtual

Returns estimator's name.

Implements julian::ir::Estimator.

Member Data Documentation

SmartPointer<SmootherCostFunction> julian::ir::ConstrainedSmoother::cost_function_
private

Cost Function.

std::vector<Date> julian::ir::ConstrainedSmoother::dates_
private

Grid dates of resulting curve.

std::vector<double> julian::ir::ConstrainedSmoother::DFs_
private

Vector holding the Discount Factors being result of estimation.

std::vector<double> julian::ir::ConstrainedSmoother::lower_tolerance_
private

Lower tolerances for par rate generated by curve.

The tolerances are set for each instrument separately. The n-th number in vector is applied to n-th instrument

int julian::ir::ConstrainedSmoother::number_of_iterations_
private

Number of iterations of Sequential Quadratic Programming.

double julian::ir::ConstrainedSmoother::tolerance_
private

Tolerance for par rate generated by curve.

Applied to all instruments. The par rate implied from the curve will be in range (quote - tolerance, quote + tolerance)

std::vector<double> julian::ir::ConstrainedSmoother::upper_tolerance_
private

Upper tolerances for par rate generated by curve.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/marketData/interestRateCurves/estimators/constrainedSmoother.hpp
  • C:/Unix/home/OEM/jULIAN/src/marketData/interestRateCurves/estimators/constrainedSmoother.cpp