CFL EXAMPLES
|
Functions | |
cfl::Function | prb::yieldShapeHullWhite (double dLambda, double dInitialTime) |
cfl::Function | prb::discountLogLinearInterp (const std::vector< double > &rDiscountTimes, const std::vector< double > &rDiscountFactors, double dInitialTime) |
cfl::Function | prb::discountFitHullWhite (const std::vector< double > &rDiscountTimes, const std::vector< double > &rDiscountFactors, double dLambda, double dInitialTime) |
This module contains functions that construct input data curves, such as volatility, forward, and discount, for financial models.
cfl::Function prb::discountFitHullWhite | ( | const std::vector< double > & | rDiscountTimes, |
const std::vector< double > & | rDiscountFactors, | ||
double | dLambda, | ||
double | dInitialTime | ||
) |
Returns the stationary form of discount curve in Hull and White model by the least square fit of market yields. In the stationary form the discount factor with maturity is given by
where (= dLambda) is the mean reversion rate,
(= dInitialTime) is the initial time and
is a constant determined from the least square fit.
rDiscountTimes | The vector of times when discount factors are known. |
rDiscountFactors | The vector of known discount factors. |
dLambda | The mean-reversion rate. |
dInitialTime | The initial time. |
cfl::Function prb::discountLogLinearInterp | ( | const std::vector< double > & | rDiscountTimes, |
const std::vector< double > & | rDiscountFactors, | ||
double | dInitialTime | ||
) |
Computes discount curve by log-linear interpolation of a given collection of discount factors.
rDiscountTimes | The vector of times, when the discount factors are known. |
rDiscountFactors | The vector of known discount factors. |
dInitialTime | The initial time. |
cfl::Function prb::yieldShapeHullWhite | ( | double | dLambda, |
double | dInitialTime | ||
) |
Computes the stationary form for changes in yield curve in the framework of Hull and White model. In other words, returns the function
where (= dLambda) is the mean-reversion parameter,
is the maturity, and
(= dInitialTime) is the initial time.
dLambda | The mean-reversion parameter. |
dInitialTime | The initial time. |