SAMPLE EXAM 3
|
Functions | |
cfl::Function | prb::volatilityLinearInterpOfVar (const std::vector< double > &rMaturities, const std::vector< double > &rVolatilities, double dInitialTime) |
This module contains functions that construct input data curves, such as volatility, forward, and discount, for financial models.
cfl::Function prb::volatilityLinearInterpOfVar | ( | const std::vector< double > & | rMaturities, |
const std::vector< double > & | rVolatilities, | ||
double | dInitialTime | ||
) |
Computes the volatility curve by applying the linear interpolation to the variance curve
. The relation between the two curves is
where (= dInitialTime) is the initial time. Note that the resulting volatility curve will be constant on the interval
[dInitialTime, rMaturities.front()]
and given by rVolatilities.front()
.
rMaturities | The maturities of known volatilities. We assume that rMaturities.front() > dInitialTime . |
rVolatilities | The vector of known volatilities. |
dInitialTime | The initial time. |
[dInitialTime, rMaturities.back()]
.