Concrete class for financial models with a single asset.
More...
#include <cfl/AssetModel.hpp>
This is the universal class for financial models with a single asset. It is constructed using an implementation of the interface class IModel.
The constructor.
- Parameters
-
pNewModel | Dynamic implementation of the interface class IAssetModel. |
rExtended | An instance of the class Extended. This class is used to implement function AssetModel::addState to allow the valuation of path dependent derivatives. |
unsigned cfl::AssetModel::addState |
( |
const PathDependent & |
rState | ) |
|
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::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
-
rEventTimes | The 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
-
iEventTime | Index of event time. |
dAmount | The 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
-
iEventTime | Index of event time where the discount factor is constructed. |
dBondMaturity | The 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
-
iEventTime | The index of an event time. |
dForwardMaturity | The 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 |
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
-
iEventTime | Index 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
-
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.
The documentation for this class was generated from the following file: