Interface for Smoother Cost Function decorator. More...
#include <SmootherCostFunction.hpp>
Public Member Functions | |
SmootherCostFunction () | |
constructor More... | |
virtual arma::mat | giveQmatrix (const InterpolatedCurve &) const =0 |
returns Q matrix, the quadratic term of optimization cost function More... | |
virtual arma::mat | giveCvector (const InterpolatedCurve &) const =0 |
returns C vector, the linear term of optimization cost function More... | |
virtual double | calculateCost (const InterpolatedCurve &) const =0 |
calculates value of cost function More... | |
virtual std::vector< double > | giveSmoothedCurve (const InterpolatedCurve &) const =0 |
returns curve as vector of doubles More... | |
virtual void | updateSmoothedCurve (InterpolatedCurve &, const std::vector< double > &) const =0 |
updates the curve as with the vector of doubles More... | |
virtual SmootherCostFunction * | clone () const =0 |
virtual copy constructor More... | |
virtual | ~SmootherCostFunction () |
destructor More... | |
Detailed Description
Interface for Smoother Cost Function decorator.
The SmootherCostFunction is used by ir::InterpolatedCurve estimators that base on optimization techniques. SmootherCostFunction implements the cost function that is minimized in optimization algorithm. Generally the cost function $f(x)$ is given by formula
where:
- is a curve representation, it can be zero-coupon rate or forward rates. It is selected by using appropriate concrete component in decorator structure. Concrete Component is a class that contains basic behaviour that can be altered by decorators.
- are weights, can be set to 0. These components and weights are set by selecting appropriate concrete decorator. Concrete Decorator is a class that altered alters the behaviour of Concrete Component.
- are respectively the earliest and the latest grid date of the curve
If we want to estimate discounting curve by finding the shortest curve of zero-coupon rates, we simply choose the SmoothZeroCouponRates as concrete component and FirstDerivativeCostFunction as concrete decorator, as minimizing the integral is equivalent to minimizing the integral which express the length of the curve. If we want to minimize the function variance we should choose the SecondDerivativeCostFunction as decorator class. Thanks to using the Decorator Pattern defining the cost function is flexible and simple.
It is worth noting that algorithm does not evaluate integrals exactly. Numerical approximation is used. We calculate the first and second derivative numerically
where is a matrix representing first order differentiation and are grid dates of the curve.
Constructor & Destructor Documentation
|
inline |
constructor
|
inlinevirtual |
destructor
Member Function Documentation
|
pure virtual |
calculates value of cost function
Implemented in julian::ir::FirstDerivativeCostFunction, julian::ir::SmoothForwardRates, julian::ir::SmoothZeroCouponRates, julian::ir::SecondDerivativeCostFunction, and julian::ir::CostFunctionDecorator.
|
pure virtual |
virtual copy constructor
Implemented in julian::ir::FirstDerivativeCostFunction, julian::ir::SmoothForwardRates, julian::ir::SmoothZeroCouponRates, julian::ir::CostFunctionDecorator, and julian::ir::SecondDerivativeCostFunction.
|
pure virtual |
returns C vector, the linear term of optimization cost function
Implemented in julian::ir::FirstDerivativeCostFunction, julian::ir::SmoothForwardRates, julian::ir::SmoothZeroCouponRates, julian::ir::SecondDerivativeCostFunction, and julian::ir::CostFunctionDecorator.
|
pure virtual |
returns Q matrix, the quadratic term of optimization cost function
Implemented in julian::ir::FirstDerivativeCostFunction, julian::ir::SmoothForwardRates, julian::ir::SmoothZeroCouponRates, julian::ir::SecondDerivativeCostFunction, and julian::ir::CostFunctionDecorator.
|
pure virtual |
returns curve as vector of doubles
Implemented in julian::ir::SmoothForwardRates, julian::ir::SmoothZeroCouponRates, and julian::ir::CostFunctionDecorator.
|
pure virtual |
updates the curve as with the vector of doubles
Implemented in julian::ir::SmoothForwardRates, julian::ir::SmoothZeroCouponRates, and julian::ir::CostFunctionDecorator.
The documentation for this class was generated from the following file:
- C:/Unix/home/OEM/jULIAN/src/marketData/interestRateCurves/estimators/costFunctions/SmootherCostFunction.hpp