|
Function | cfl::Data::assetShape (double dLambda, double dInitialTime) |
|
Function | cfl::Data::bondShape (double dLambda, double dInitialTime) |
|
Function | cfl::Data::discount (double dYield, double dInitialTime) |
|
Function | cfl::Data::discount (const Function &rYield, double dInitialTime) |
|
Function | cfl::Data::forward (double dSpot, double dCostOfCarry, double dInitialTime) |
|
Function | cfl::Data::forward (double dSpot, const Function &rCostOfCarry, double dInitialTime) |
|
Function | cfl::Data::forward (double dSpot, double dDividendYield, const Function &rDiscount, double dInitialTime) |
|
Function | cfl::Data::volatility (double dSigma, double dLambda, double dInitialTime) |
|
This module contains useful functions and classes that facilitate specifications of input data such as volatility, forward and discount curves and parameters of financial derivatives.
Function cfl::Data::assetShape |
( |
double |
dLambda, |
|
|
double |
dInitialTime |
|
) |
| |
Stationary form for relative changes in forward price curves. The value of this function at time dT
given as year fraction equals
exp(-dLambda*(dT-dInitialTime))
- Parameters
-
dLambda | The mean-reversion rate. |
dInitialTime | The initial time as year fraction. |
- Returns
- The stationary shape of relative changes in forward prices.
Function cfl::Data::bondShape |
( |
double |
dLambda, |
|
|
double |
dInitialTime |
|
) |
| |
Stationary form for changes in an yield curve. The value of this function at time dT
given as year fraction equals
(1-
exp(-dLambda*(dT-dInitialTime)))/dLambda
- Parameters
-
dLambda | The mean-reversion rate. |
dInitialTime | The initial time as year fraction. |
- Returns
- The stationary shape of changes in an yield curve.
Function cfl::Data::discount |
( |
double |
dYield, |
|
|
double |
dInitialTime |
|
) |
| |
Constructs discount curve. The discount factor for maturity dMaturity
is given by
exp(-dYield*(dMaturity - dInitialTime))
Both dMaturity and dInitialTime are given as year fractions.
- Parameters
-
dYield | The constant continuously compounded yield. |
dInitialTime | The initial time as year fraction. |
- Returns
- The discount curve as a function of maturity.
Function cfl::Data::discount |
( |
const Function & |
rYield, |
|
|
double |
dInitialTime |
|
) |
| |
Constructs discount curve. The discount factor for maturity dMaturity
is given by
exp(-rYield(dMaturity)*(dMaturity - dInitialTime))
Both dMaturity and dInitialTime are given as year fractions
- Parameters
-
rYield | The continuously compounded yield curve. |
dInitialTime | The initial time as year fraction. |
- Returns
- The discount curve as function of maturity.
Function cfl::Data::forward |
( |
double |
dSpot, |
|
|
double |
dCostOfCarry, |
|
|
double |
dInitialTime |
|
) |
| |
Constructs forward curve for an asset. The forward price at maturity dMaturity
equals
dSpot*
exp(dCostOfCarry*(dMaturity-dInitialTime))
- Parameters
-
dSpot | The spot price. |
dCostOfCarry | The cost-of-carry rate. |
dInitialTime | The initial time as year fraction. |
- Returns
- The forward curve computed by cost-of-carry formula.
Function cfl::Data::forward |
( |
double |
dSpot, |
|
|
const Function & |
rCostOfCarry, |
|
|
double |
dInitialTime |
|
) |
| |
Constructs forward curve for an asset. The forward price at maturity dMaturity
is given by
dSpot*
exp(rCostOfCarry(dMaturity)*(dMaturity-dInitialTime))
- Parameters
-
dSpot | The spot price. |
rCostOfCarry | The cost-of-carry rate curve. |
dInitialTime | The initial time as year fraction. |
- Returns
- The forward curve computed by cost-of-carry formula.
Function cfl::Data::forward |
( |
double |
dSpot, |
|
|
double |
dDividendYield, |
|
|
const Function & |
rDiscount, |
|
|
double |
dInitialTime |
|
) |
| |
Constructs forward curve for a stock. The forward price at maturity dMaturity
given as year fraction equals
dSpot*
exp(-dDividendYield*(dMaturity-dInitialTime)/rDiscount(dMaturity)
- Parameters
-
dSpot | The spot price. |
dDividendYield | The dividend yield for the stock. |
rDiscount | The current discount curve. |
dInitialTime | The initial time as year fraction. |
- Returns
- The forward curve for an asset paying constant continuous dividend yield.
Function cfl::Data::volatility |
( |
double |
dSigma, |
|
|
double |
dLambda, |
|
|
double |
dInitialTime |
|
) |
| |
Constructs stationary volatility curve. The value of volatility for time dT
, given as year fraction, equals
dSigma*
sqrt((
exp(2*m_dLambda*(dT-dInitialTime))-1)/(2*m_dLambda*(dT-dInitialTime)))
- Parameters
-
dSigma | The short-term volatility |
dLambda | The mean-reversion coefficient. |
dInitialTime | The initial time as year fraction. |
- Returns
- The stationary volatility curve.