CFL
Public Member Functions | List of all members

Concrete class for the basic financial model with Brownian motion. More...

#include <cfl/Brownian.hpp>

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

Public Member Functions

 Brownian (IBrownian *pNewP)
 
void addDependence (Slice &rSlice, const std::vector< unsigned > &rStates) const
 
void assign (const std::vector< double > &rVar, const std::vector< double > &rEventTimes, double dInterval)
 
const std::vector< double > & eventTimes () const
 
void indicator (Slice &rSlice, double dBarrier) const
 
MultiFunction interpolate (const Slice &rSlice) const
 
unsigned numberOfNodes (unsigned iEventTime, const std::vector< unsigned > &rStates) const
 
unsigned numberOfStates () const
 
std::valarray< double > origin () const
 
void rollback (Slice &rSlice, unsigned iEventTime) const
 
Slice state (unsigned iEventTime, unsigned iState) const
 

Detailed Description

This is the standard concrete class for the basic financial model where the interest rate equals to zero and the state process is given by a one-dimensional Brownian motion. This class is implemented by a dynamically allocated implementation of the interface class IBrownian.

See also
IBrownian

Constructor & Destructor Documentation

cfl::Brownian::Brownian ( IBrownian pNewP)
explicit

Constructs *this from dynamically allocated implementation of the interface class IBrownian.

Parameters
pNewPA pointer to dynamically allocated implementation of the interface class IBrownian.

Member Function Documentation

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

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.

Implements cfl::IModel.

void cfl::Brownian::assign ( const std::vector< double > &  rVar,
const std::vector< double > &  rEventTimes,
double  dInterval 
)

Changes event times, variances and the interval of initial values for *this.

Parameters
rVarThe vector of average variances of the state process between initial and event times. The element with index i of this vector equals the average variance between the initial time and the event time with index i.
rEventTimesThe vector of event times in the model.
dIntervalThe width of the interval of initial values of the Brownian motion which plays the role of the state process. The center of the interval of initial values equals zero.
const std::vector<double>& cfl::Brownian::eventTimes ( ) const
virtual

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.

Implements cfl::IModel.

void cfl::Brownian::indicator ( Slice rSlice,
double  dBarrier 
) const
virtual

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.

Implements cfl::IModel.

MultiFunction cfl::Brownian::interpolate ( const Slice rSlice) const
virtual

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.

Implements cfl::IModel.

unsigned cfl::Brownian::numberOfNodes ( unsigned  iEventTime,
const std::vector< unsigned > &  rStates 
) const
virtual

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.

Implements cfl::IModel.

unsigned cfl::Brownian::numberOfStates ( ) const
virtual

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

Returns
The number of state processes in the model.

Implements cfl::IModel.

std::valarray<double> cfl::Brownian::origin ( ) const
virtual

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.

Implements cfl::IModel.

void cfl::Brownian::rollback ( Slice rSlice,
unsigned  iEventTime 
) const
virtual

"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.

Implements cfl::IModel.

Slice cfl::Brownian::state ( unsigned  iEventTime,
unsigned  iState 
) const
virtual

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.

Implements cfl::IModel.


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