CFL
Public Member Functions | List of all members
cfl::IAssetModel Class Referenceabstract

Interface class for a single asset model. More...

#include <cfl/AssetModel.hpp>

Inheritance diagram for cfl::IAssetModel:
Inheritance graph
[legend]

Public Member Functions

virtual ~IAssetModel ()
 
virtual void addDependence (Slice &rSlice, const std::vector< unsigned > &rStates) const =0
 
virtual Slice discount (unsigned iEventTime, double dBondMaturity) const =0
 
virtual const std::vector< double > & eventTimes () const =0
 
virtual Slice forward (unsigned iEventTime, double dForwardMaturity) const =0
 
virtual void indicator (Slice &rSlice, double dBarrier) const =0
 
virtual MultiFunction interpolate (const Slice &rSlice) const =0
 
virtual IAssetModelnewModel (const std::vector< double > &rEventTimes) const =0
 
virtual unsigned numberOfNodes (unsigned iEventTime, const std::vector< unsigned > &rStates) const =0
 
virtual unsigned numberOfStates () const =0
 
virtual std::valarray< double > origin () const =0
 
virtual void rollback (Slice &rSlice, unsigned iEventTime) const =0
 
virtual Slice state (unsigned iEventTime, unsigned iState) const =0
 

Detailed Description

This is the abstract class for single asset model. It is used to implement the class AssetModel.

See also
AssetModel

Constructor & Destructor Documentation

virtual cfl::IAssetModel::~IAssetModel ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

virtual void cfl::IModel::addDependence ( Slice rSlice,
const std::vector< unsigned > &  rStates 
) const
pure virtualinherited

Transforms rSlice into the equivalent Slice object which, in addition, depends on the state processes with indexes rStates. This function is used to define arithmetic operations between objects of type Slice relying on different state processes.

Parameters
rSliceThe representation of some random variable in the model. After this operation this random variable will also be dependent on the state processes with indexes rStates.
rStatesAdditional indexes of state processes on which rSlice will be dependent after this operation.

Implemented in cfl::Brownian, and cfl::Extended.

virtual Slice cfl::IAssetModel::discount ( unsigned  iEventTime,
double  dBondMaturity 
) const
pure virtual

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.
virtual const std::vector<double>& cfl::IModel::eventTimes ( ) const
pure virtualinherited

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.

Implemented in cfl::Brownian, and cfl::Extended.

virtual Slice cfl::IAssetModel::forward ( unsigned  iEventTime,
double  dForwardMaturity 
) const
pure virtual

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.
virtual void cfl::IModel::indicator ( Slice rSlice,
double  dBarrier 
) const
pure virtualinherited

Transforms rSlice into the indicator function of the event that the random variable represented by rSlice is greater than the barrier dBarrier.

Parameters
rSliceBefore the operation rSlice represents some random variable. After the operation rSlice becomes equal the indicator of the event that this random variable is greater than dBarrier.
dBarrierThe value of the barrier.

Implemented in cfl::Brownian, and cfl::Extended.

virtual MultiFunction cfl::IModel::interpolate ( const Slice rSlice) const
pure virtualinherited

This function explicitly defines the dependence of the given Slice object on the state processes. The dimension of the returned MultiFunction object coincides with the number of state processes on which rSlice is dependent.

Parameters
rSliceA random variable in the model.
Returns
Multi-dimensional function object that shows the dependence of rSlice on state processes.

Implemented in cfl::Brownian, and cfl::Extended.

virtual IAssetModel* cfl::IAssetModel::newModel ( const std::vector< double > &  rEventTimes) const
pure virtual

Virtual constructor. Constructs a dynamically allocated implementation of the same model but with a new vector of event times.

Parameters
rEventTimesNew vector of event times for the model. The first element is the initial time.
Returns
Dynamically allocated implementation of the interface class IAssetModel with the vector of event times rEventTimes.
virtual unsigned cfl::IModel::numberOfNodes ( unsigned  iEventTime,
const std::vector< unsigned > &  rStates 
) const
pure virtualinherited

Returns the size of array used in the representation of random variables (objects of the type Slice) defined at a given event time and dependent on a given state processes.

Parameters
iEventTimeThe index of event time.
rStatesThe indexes of state processes.
Returns
The size of array needed to construct Slice object at event time iEventTime that depends on the state processes with indexes rStates.

Implemented in cfl::Brownian, and cfl::Extended.

virtual unsigned cfl::IModel::numberOfStates ( ) const
pure virtualinherited

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

Returns
The number of state processes in the model.

Implemented in cfl::Brownian, and cfl::Extended.

virtual std::valarray<double> cfl::IModel::origin ( ) const
pure virtualinherited

Returns the initial values of all state processes, that is, those values that correspond to the initial data structure of the model.

Returns
The initial values of the state processes.

Implemented in cfl::Brownian, and cfl::Extended.

virtual void cfl::IModel::rollback ( Slice rSlice,
unsigned  iEventTime 
) const
pure virtualinherited

"Rolls back" rSlice to the event time with index iEventTime.

Parameters
rSliceBefore the rollback operator this object represents the payoff of a financial security at an event time which index is larger than iEventTime. After the rollback operator it defines the equivalent value of this payoff at the event time with index iEventTime.
iEventTimeThe index of the "target" event time for rSlice.

Implemented in cfl::Brownian, and cfl::Extended.

virtual Slice cfl::IModel::state ( unsigned  iEventTime,
unsigned  iState 
) const
pure virtualinherited

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.

Implemented in cfl::Brownian, and cfl::Extended.


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