Concrete class for the "extended" financial models.
More...
#include <cfl/Extended.hpp>
This class constructs "extended" financial models from some given model and a collection of path dependent state processes.
- See also
- IExtend, PathDependent and IResetValues
cfl::Extended::Extended |
( |
IExtend * |
pNewP = 0 | ) |
|
|
explicit |
The constructor.
- Parameters
-
pNewP | A dynamically allocated implementation of the interface class IExtend. |
The constructor.
- Parameters
-
rVecExtend | The vector of pointers to implementations of the interface class IExtend. |
void cfl::Extended::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
-
rSlice | The 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. |
rStates | Additional indexes of state processes on which rSlice will be dependent after this operation. |
Implements cfl::IModel.
Adds another state process to the model.
- Parameters
-
rState | The description of a path dependent process which becomes additional state process in the model. |
- Returns
- The index of the additional state process.
void cfl::Extended::assign |
( |
const IModel & |
rModel | ) |
|
Replaces the original (non-extended) model with rModel.
- Parameters
-
rModel | The constant reference to the original model. |
const std::vector<double>& cfl::Extended::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::Extended::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
-
rSlice | Before 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. |
dBarrier | The value of the barrier. |
Implements cfl::IModel.
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
-
rSlice | A random variable in the model. |
- Returns
- Multi-dimensional function object that shows the dependence of rSlice on state processes.
Implements cfl::IModel.
unsigned cfl::Extended::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
-
iEventTime | The index of event time. |
rStates | The 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::Extended::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.
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.
const IModel* cfl::Extended::ptrToModel |
( |
| ) |
const |
Accessor function to the original (non-extended) model.
- Returns
- A constant pointer to the implementation of the original (non-extended) model.
void cfl::Extended::rollback |
( |
Slice & |
rSlice, |
|
|
unsigned |
iEventTime |
|
) |
| const |
|
virtual |
"Rolls back" rSlice to the event time with index iEventTime.
- Parameters
-
rSlice | Before 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. |
iEventTime | The index of the "target" event time for rSlice. |
Implements cfl::IModel.
Slice cfl::Extended::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
-
iEventTime | The index of the event time. |
iState | The 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: