This module contains functions that construct input data curves, such as volatility, forward, and discount, for financial models.
cfl::Function prb::discountSwapLogLinearInterp |
( |
const std::vector< double > & |
rSwapRates, |
|
|
double |
dPeriod, |
|
|
double |
dInitialTime |
|
) |
| |
Computes discount curve from a family of swap rates. The computation is done in two steps. First, we deduce discount factors for the maturities of swap contracts. Second, we compute discount curve using log-linear interpolation of discount factors obtained in the first step.
- Parameters
-
rSwapRates | The vector of known swap rates. The maturity of the first swap is given by dInitialTime+dPeriod. Two adjacent swap contracts are separated by the time interval dPeriod. |
dPeriod | The period between two payments. This is also the time interval between maturities of the adjacent swap contracts. |
dInitialTime | The initial time. |
- Returns
- The discount curve obtained from known swap rates by log-linear interpolation of discount factors.