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

Concrete class for interest rate models. More...

#include <cfl/InterestRateModel.hpp>

Public Member Functions

 InterestRateModel (IInterestRateModel *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
 
double initialTime () const
 
unsigned numberOfStates () const
 
Slice state (unsigned iEventTime, unsigned iState) const
 

Detailed Description

This is the main concrete class for interest rate models.

See also
IInterestRateModel

Constructor & Destructor Documentation

cfl::InterestRateModel::InterestRateModel ( IInterestRateModel pNewModel,
const Extended rExtended 
)

The constructor.

Parameters
pNewModelDynamically allocated implementation of the interface class IInterestRateModel.
rExtendedAn instance of the class Extended.

Member Function Documentation

unsigned cfl::InterestRateModel::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::InterestRateModel::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 InterestRateModel::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::InterestRateModel::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::InterestRateModel::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::InterestRateModel::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.
double cfl::InterestRateModel::initialTime ( ) const

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

Returns
Initial time of the model.
unsigned cfl::InterestRateModel::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::InterestRateModel::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: