CFL
Public Member Functions | List of all members
cfl::AssetModel Class Reference

Concrete class for financial models with a single asset. More...

#include <cfl/AssetModel.hpp>

Public Member Functions

 AssetModel (IAssetModel *pNewModel, const Extended &rExtended)
 
unsigned addState (const PathDependent &rState)
 
void assignEventTimes (const std::vector< double > &rEventTimes)
 
Slice cash (unsigned iEventTime, double dAmount) const
 
Slice discount (unsigned iEventTime, double dBondMaturity) const
 
const std::vector< double > & eventTimes () const
 
Slice forward (unsigned iEventTime, double dForwardMaturity) const
 
double initialTime () const
 
unsigned numberOfStates () const
 
Slice spot (unsigned iEventTime) const
 
Slice state (unsigned iEventTime, unsigned iState) const
 

Detailed Description

This is the universal class for financial models with a single asset. It is constructed using an implementation of the interface class IModel.

Constructor & Destructor Documentation

cfl::AssetModel::AssetModel ( IAssetModel pNewModel,
const Extended rExtended 
)

The constructor.

Parameters
pNewModelDynamic implementation of the interface class IAssetModel.
rExtendedAn instance of the class Extended. This class is used to implement function AssetModel::addState to allow the valuation of path dependent derivatives.

Member Function Documentation

unsigned cfl::AssetModel::addState ( const PathDependent rState)

Adds another state process to the model.

Parameters
rStateThe description of a path dependent process which becomes additional state process in the model.
Returns
The index of the additional state process.
void cfl::AssetModel::assignEventTimes ( const std::vector< double > &  rEventTimes)

Resets the vector of event times to rEventTimes. This function also resets the vector of state processes. All state processes created previously by the function AssetModel::addState will be deleted.

Parameters
rEventTimesThe new vector of event times for the model. The front element of this vector should equal the initial time of the model. Otherwise, an error is thrown.
Slice cfl::AssetModel::cash ( unsigned  iEventTime,
double  dAmount 
) const

Constructs constant payoff in the amount dAmount at the event time with index iEventTime.

Parameters
iEventTimeIndex of event time.
dAmountThe amount of cash.
Returns
Representation of constant payoff in the amount dAmount taking place at the event time with index iEventTime.
Slice cfl::AssetModel::discount ( unsigned  iEventTime,
double  dBondMaturity 
) const

Constructs discount factor with maturity dBondMaturity at event time with index iEventTime.

Parameters
iEventTimeIndex of event time where the discount factor is constructed.
dBondMaturityThe maturity of the discount factor.
Returns
Discount factor with maturity dBondMaturity at event time with index iEventTime.
const std::vector<double>& cfl::AssetModel::eventTimes ( ) const

Accessor function to the vector of event times in the model. Event times are sorted in increasing order and are given as year fractions. The front event time equals the initial time.

Returns
Vector of event times in the model.
Slice cfl::AssetModel::forward ( unsigned  iEventTime,
double  dForwardMaturity 
) const

Returns forward price for delivery time dForwardMaturity at event time with index iEventTime.

Parameters
iEventTimeThe index of an event time.
dForwardMaturityThe maturity of the forward contract.
Returns
Forward price of underlying asset for the contract with delivery time dForwardMaturity at event time with index iEventTime.
double cfl::AssetModel::initialTime ( ) const

Returns the initial time of the model. Same as AssetModel::eventTimes().front().

Returns
Initial time of the model.
unsigned cfl::AssetModel::numberOfStates ( ) const

Returns the dimension of the model, that is, the number of state processes.

Returns
The number of state processes in the model.
Slice cfl::AssetModel::spot ( unsigned  iEventTime) const

Returns spot price at event time with index iEventTime.

Parameters
iEventTimeIndex of an event time.
Returns
Spot price of underlying asset at event time with index iEventTime.
Slice cfl::AssetModel::state ( unsigned  iEventTime,
unsigned  iState 
) const

Returns the representation of the state process with index iState at the event time with index iEventTime.

Parameters
iEventTimeThe index of the event time.
iStateThe index of the state process.
Returns
State process with index iState at event time with index iEventTime.

The documentation for this class was generated from the following file: