CFL
Namespaces | Classes | Functions
Collaboration diagram for Data structures.:

Namespaces

 cfl::Data
 Data structures.
 

Classes

class  cfl::Data::CashFlow
 Cash flow at fixed rate over regular time intervals. More...
 
class  cfl::Data::Swap
 Interest rate swap. More...
 

Functions

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)
 

Detailed Description

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 Documentation

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
dLambdaThe mean-reversion rate.
dInitialTimeThe 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
dLambdaThe mean-reversion rate.
dInitialTimeThe 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
dYieldThe constant continuously compounded yield.
dInitialTimeThe 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
rYieldThe continuously compounded yield curve.
dInitialTimeThe 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
dSpotThe spot price.
dCostOfCarryThe cost-of-carry rate.
dInitialTimeThe 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
dSpotThe spot price.
rCostOfCarryThe cost-of-carry rate curve.
dInitialTimeThe 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
dSpotThe spot price.
dDividendYieldThe dividend yield for the stock.
rDiscountThe current discount curve.
dInitialTimeThe 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
dSigmaThe short-term volatility
dLambdaThe mean-reversion coefficient.
dInitialTimeThe initial time as year fraction.
Returns
The stationary volatility curve.