CFL EXAMPLES
Functions
Path dependent options.

Functions

cfl::MultiFunction prb::asianCall (const std::vector< double > &rAverageTimes, double dStrike, double dMaturity, cfl::AssetModel &rModel)
 
cfl::MultiFunction prb::barrierUpOrDownAndOut_path (double dNotional, double dLowerBarrier, double dUpperBarrier, const std::vector< double > &rBarrierTimes, cfl::AssetModel &rModel)
 
cfl::MultiFunction prb::savingsAccount (double dPeriod, unsigned iNumberOfPeriods, double dNotional, cfl::InterestRateModel &rModel)
 
cfl::MultiFunction prb::putOnSavingsAccount (const cfl::Data::CashFlow &rAccount, cfl::InterestRateModel &rModel)
 

Detailed Description

This module contains functions that compute prices of path dependent options in cfl::AssetModel and cfl::InterestRateModel.

Function Documentation

cfl::MultiFunction prb::asianCall ( const std::vector< double > &  rAverageTimes,
double  dStrike,
double  dMaturity,
cfl::AssetModel rModel 
)

Computes the price of the Asian call option. At maturity dMaturity holder of the option can exercise it by paying strike dStrike and receiving the historical average of the price of the stock computed over the set of averaging times rAverageTimes.

Parameters
rAverageTimesThe vector of times participating in the computation of the historical average for the price of the stock.
dStrikeThe strike of the option.
dMaturityThe maturity of the option. The maturity is strictly greater than the largest time from rAverageTimes.
rModelReference to implementation of AssetModel.
Returns
The price of the option as the function of the initial values of the state processes in the model.
cfl::MultiFunction prb::barrierUpOrDownAndOut_path ( double  dNotional,
double  dLowerBarrier,
double  dUpperBarrier,
const std::vector< double > &  rBarrierTimes,
cfl::AssetModel rModel 
)

Computes the value of the up-or-down-and-out barrier option. The payoff of the option at maturity (last barrier time) is given by the notional amount dNotional if the stock price has not crossed the lower and upper barriers for all barrier times. Otherwise, the option expires worthless.

Parameters
dLowerBarrierThe lower barrier.
dUpperBarrierThe upper barrier.
dNotionalThe notional amount.
rBarrierTimesThe vector of barrier times. The first time is greater than the initial time. The last barrier time is the maturity of the option.
rModelReference to implementation of AssetModel.
Returns
The price of the option as the function of the initial values of the state processes in the model. This implementation views barrier option as a path dependent derivative security: a new state process representing barrier event is added to rModel.
cfl::MultiFunction prb::putOnSavingsAccount ( const cfl::Data::CashFlow rAccount,
cfl::InterestRateModel rModel 
)

Computes the price of put option on savings account. At maturity the holder of the option has the right to receive the capital accumulated on the account with fixed rate rAccount.rate in exchange for the capital accumulated on the account with float rate (savings account). Both accounts are issued at the initial time of the model.

Parameters
rAccountThe parameters of the fixed and floating accounts. The fixed rate is given by rAccount.rate.
rModelReference to implementation of InterestRateModel.
Returns
The price of the option as the function of the initial values of the state processes in the model.
cfl::MultiFunction prb::savingsAccount ( double  dPeriod,
unsigned  iNumberOfPeriods,
double  dNotional,
cfl::InterestRateModel rModel 
)

Computes the price of savings account. Savings account starts with notional amount dNotional and then invests the capital at regular time intervals at float rate.

Parameters
dPeriodThe period between two payments.
iNumberOfPeriodsThe number of payments.
dNotionalThe notional amount.
rModelReference to implementation of InterestRateModel.
Returns
The price of the option as the function of the initial values of the state processes in the model.