webcab.lib.finance.pricing.contracts
Class FixedExchangeMarkovContractCommon
java.lang.Object
|
+--webcab.lib.finance.pricing.contracts.GeneralContractCommon
|
+--webcab.lib.finance.pricing.contracts.FixedExchangeMomentsContractCommon
|
+--webcab.lib.finance.pricing.contracts.FixedExchangeMarkovContractCommon
- All Implemented Interfaces:
- FixedExchangeMarkovContract, FixedExchangeMomentsContract, GeneralContract, Serializable
- Direct Known Subclasses:
- ExplicitBoundariesContractCommon, Forward, Future, RegularPayoffContractCommon
- public abstract class FixedExchangeMarkovContractCommon
- extends FixedExchangeMomentsContractCommon
- implements FixedExchangeMarkovContract
You will need to extend this abstract class in order to define a FixedExchangeMarkovContract.
- See Also:
- Serialized Form
|
Method Summary |
double |
getPayoff(int moment,
ContextGraph contextGraph,
Path paths,
StochasticDifferentialModel updatedModel)
Returns the amount exchanged at a moment specified by its index in the
payoff moments vector (the vector returned by method getMoments()). |
abstract double |
getPayoff(int moment,
ContextGraph contextGraph,
StochasticDifferentialModel updatedModel)
Returns the amount exchanged at a moment specified by its index in the
payoff moments vector (the vector returned by method getMoments()).
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedExchangeMarkovContractCommon
public FixedExchangeMarkovContractCommon()
getPayoff
public abstract double getPayoff(int moment,
ContextGraph contextGraph,
StochasticDifferentialModel updatedModel)
throws BondsException
- Description copied from interface:
FixedExchangeMarkovContract
- Returns the amount exchanged at a moment specified by its index in the
payoff moments vector (the vector returned by method
getMoments()).
Only the current values of the variables are available (the current context graph).
- Specified by:
getPayoff in interface FixedExchangeMarkovContract
- Parameters:
moment - the index of the moment for which the payoff is computed (the current moment)contextGraph - the context graph produced by the model. The context graph contains a
snapshot of the models' variables at the current moment. See ContextGraph
for information on how to search for a specific variable on which the contract
is dependent.updatedModel - an instance of the model used to price the contract.
It can be used with a pricer to evaluate an underlying contract (in case
we have a second-order contract like, for example, a bond option). The
initial values for this models' variables are implicitly set to the current values.
If the higher order contract is path dependent and needs the values from
the underlying contract at previous moments of time, you need to set the
initial values of the model to the values that existed at that moment
of time. You can use the path to find the historic context and then
use the updatedModel.setInitialContext()
method to set the initial values.
- Returns:
- double which represents the cash flow resulting from a contract at a given
point in time.
- Throws:
BondsException
getPayoff
public double getPayoff(int moment,
ContextGraph contextGraph,
Path paths,
StochasticDifferentialModel updatedModel)
throws BondsException
- Description copied from interface:
FixedExchangeMomentsContract
- Returns the amount exchanged at a moment specified by its index in the
payoff moments vector (the vector returned by method
getMoments()).
- Specified by:
getPayoff in interface FixedExchangeMomentsContract- Specified by:
getPayoff in class FixedExchangeMomentsContractCommon
- Parameters:
moment - the index of the moment for which the payoff is computed
(the current moment)contextGraph - the context graph produced by the model. The context graph contains a
snapshot of the models' variables at the current moment. See ContextGraph
for information on how to search for a specific variable on which the contract
is dependent.paths - provides access to previous values of all the models' variables.
The full history of the simulation between settlement and the current moment is
accessible.updatedModel - an instance of the model used to price the contract.
It can be used with a pricer to evaluate an underlying contract (in case
we have a second-order contract like, for example, a bond option). The
initial values for this models' variables are implicitly set to the current values.
If the higher order contract is path dependent and needs the values for
the underlying contract at previous moments of time, you need to set the
initial values of the model to the values that existed at that moment
of time. You can use the path to find the historic context and then
use the updatedModel.setInitialContext()
method to set the initial values.
- Returns:
- double
- Throws:
BondsException