Interest rate curve estimating algorithm solving equation system [CFij] * [DFj] = [PRIZEi]. More...

#include <algebraicBootstrapper.hpp>

Inheritance diagram for julian::ir::AlgebraicBootstrapper:
julian::ir::Estimator

Public Member Functions

void calculate (const std::vector< SmartPointer< BuildingBlock > > &instruments, const CurveSettings &settings, SmartPointer< Curve > &discountingCurve, SmartPointer< Curve > &projectionCurve)
 estimates the curve More...
 
std::vector< double > getDF () const
 returns DFs More...
 
std::vector< DategetDates () const
 returns dates More...
 
std::string info () const
 returns name of estimator More...
 
AlgebraicBootstrapperclone () const
 virtual copy constructor More...
 
- Public Member Functions inherited from julian::ir::Estimator
 Estimator ()
 default constructor More...
 
virtual ~Estimator ()
 destructor More...
 

Private Member Functions

std::vector< DategetMaturityDates (const std::vector< SmartPointer< ir::BuildingBlock > > &instruments, const Date &today)
 Extracts maturity dates from benchmark instruments. More...
 
void getGridDates (const std::vector< SmartPointer< ir::BuildingBlock > > &instruments)
 Extracts grid dates from benchmark instruments. More...
 
std::vector< DategetLackingDates (const std::vector< Date > &maturity_dates)
 Extracts lacking dates from benchmark instruments. More...
 
std::vector< CashFlowVectorcreateCFsVector (const std::vector< SmartPointer< ir::BuildingBlock > > &instruments, const std::vector< Date > &lacking_dates, Date today)
 Creates IRS contract for lacking dates. More...
 
arma::mat prepareEquationSystem (const std::vector< CashFlowVector > &cfs_vecs)
 Creates CF matrix defining system of equation. More...
 

Private Attributes

std::vector< double > DFs_
 Vector of discount factors. More...
 
std::vector< Datedates_
 Vector of grid dates. More...
 

Detailed Description

Interest rate curve estimating algorithm solving equation system [CFij] * [DFj] = [PRIZEi].

Algebraic bootstrapper creates the matrix of [CFij] which is used to create the system of linear equations. By solving the system the discount factors are estimated. Discount factors are used to construct the interest rate curve.

For example: if we want to build curve using following trades: Deposit 6M, FRA 6x12, IRS 2Y below matrix is constructed

\[ CF = \left(\begin{array}{@{}cccc@{}} 1 & 0 & 0 & 0 \\ -1 & 1+r_{Depo6M} & 0 & 0 \\ 0 & -1 & 1+r_{FRA 6x12} & 0 \\ -1 & 0 & r_{IRS 2Y} & 1+r_{IRS 2Y} \\ \end{array}\right) \]

where second row represents CF of deposit, third represents CF of FRA and the last one contains CF of IRS. First column contains CF for today, second for 6M and next columns contain CF for 1Y and 2Y.

Then following system of equation is solved:

\[ \left(\begin{array}{@{}cccc@{}} 1 & 0 & 0 & 0 \\ -1 & 1+r_{Depo6M} & 0 & 0 \\ 0 & -1 & 1+r_{FRA 6x12} & 0 \\ -1 & 0 & r_{IRS 2Y} & 1+r_{IRS 2Y} \\ \end{array}\right) \times \left( \begin{array}{@{}c@{}} DF_{today} \\ DF_{6M} \\ DF_{1Y} \\ DF_{2Y}\end{array}\right) = \left( \begin{array}{@{}c@{}} 1 \\0 \\ 0 \\ 0 \end{array}\right) \]

To solve the equation number of dates when CF occurs must be equal to number of instruments. Sometimes this condition is not satisfied. Usually there are not quotings for IRS11Y, but IRS12Y generates CF occurring on 11Y. This issue is resolved by creating a IRS with maturity equal to lacking date using linear interpolated IRS quote.

Warning
AlgebraicBootstrapper does not have multi-curve functionality.
Todo:
Multi-curve functionality is not implemented
Examples:
algebraicBootstrapperExample.cpp, and bootstrapperComparison.cpp.

Member Function Documentation

void julian::ir::AlgebraicBootstrapper::calculate ( const std::vector< SmartPointer< BuildingBlock > > &  instruments,
const CurveSettings settings,
SmartPointer< Curve > &  discountingCurve,
SmartPointer< Curve > &  projectionCurve 
)
virtual

estimates the curve

calculates method estimates the curve and saves the result into the class members

Implements julian::ir::Estimator.

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

virtual copy constructor

Implements julian::ir::Estimator.

std::vector< CashFlowVector > julian::ir::AlgebraicBootstrapper::createCFsVector ( const std::vector< SmartPointer< ir::BuildingBlock > > &  instruments,
const std::vector< Date > &  lacking_dates,
Date  today 
)
private

Creates IRS contract for lacking dates.

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

returns dates

Method should be called after calling method Estimator::calculate

Implements julian::ir::Estimator.

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

returns DFs

Method should be called after calling method Estimator::calculate

Implements julian::ir::Estimator.

void julian::ir::AlgebraicBootstrapper::getGridDates ( const std::vector< SmartPointer< ir::BuildingBlock > > &  instruments)
private

Extracts grid dates from benchmark instruments.

Grid dates are dates of all CFs associated with benchmark instruments

std::vector< Date > julian::ir::AlgebraicBootstrapper::getLackingDates ( const std::vector< Date > &  maturity_dates)
private

Extracts lacking dates from benchmark instruments.

Lacking dates are grid dates that are not maturity dates. IRS contracts settled on this dates are created using interpolation of market quotings of swaps. This is done to ensure unique solution of system of linear equations that are solved in process of estimating the curve,

std::vector< Date > julian::ir::AlgebraicBootstrapper::getMaturityDates ( const std::vector< SmartPointer< ir::BuildingBlock > > &  instruments,
const Date today 
)
private

Extracts maturity dates from benchmark instruments.

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

returns name of estimator

Implements julian::ir::Estimator.

arma::mat julian::ir::AlgebraicBootstrapper::prepareEquationSystem ( const std::vector< CashFlowVector > &  cfs_vecs)
private

Creates CF matrix defining system of equation.

For trades: Deposit 6M, FRA 6x12, IRS 2Y following matrix is constructed

\[ \left(\begin{array}{@{}cccc@{}} 1 & 0 & 0 & 0 \\ -1 & 1+r_{Depo6M} & 0 & 0 \\ 0 & -1 & 1+r_{FRA 6x12} & 0 \\ -1 & 0 & r_{IRS 2Y} & 1+r_{IRS 2Y} \\ \end{array}\right) \]

where second row represents CF of deposit, thirg represents CG of FRA and the last one contains CF of IRS. First column contains CF for today, second for 6M and next columns contain CF for 1Y and 2Y.

Member Data Documentation

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

Vector of grid dates.

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

Vector of discount factors.


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