SAMPLE EXAM 2
Functions
Construction of data curves.

Functions

cfl::Function prb::discountSwapLogLinearInterp (const std::vector< double > &rSwapRates, double dPeriod, double dInitialTime)
 

Detailed Description

This module contains functions that construct input data curves, such as volatility, forward, and discount, for financial models.

Function Documentation

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
rSwapRatesThe 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.
dPeriodThe period between two payments. This is also the time interval between maturities of the adjacent swap contracts.
dInitialTimeThe initial time.
Returns
The discount curve obtained from known swap rates by log-linear interpolation of discount factors.