java.lang.Object
net.finmath.montecarlo.AbstractMonteCarloProduct
- All Implemented Interfaces:
Product
,MonteCarloProduct
- Direct Known Subclasses:
AbstractAssetMonteCarloProduct
,AbstractTermStructureMonteCarloProduct
,HybridAssetMonteCarloProduct
,PortfolioMonteCarloProduct
,SwaprateCovarianceAnalyticApproximation
Base class for products requiring an MonteCarloSimulationModel for valuation.
- Version:
- 1.0
- Author:
- Christian Fries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the currency string of this product.Return the valuation of the product using the given model.abstract RandomVariable
getValue(double evaluationTime, MonteCarloSimulationModel model)
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.double
getValue(MonteCarloSimulationModel model)
This method returns the value of the product under the specified model.Return the valuation of the product using the given model.getValues(double evaluationTime, MonteCarloSimulationModel model)
This method returns the value of the product under the specified model and other information in a key-value map.getValues(MonteCarloSimulationModel model)
This method returns the value of the product under the specified model and other information in a key-value map.getValuesForModifiedData(double evaluationTime, MonteCarloSimulationModel model, String entityKey, Object dataModified)
This method returns the value under shifted market data (or model parameters).getValuesForModifiedData(double evaluationTime, MonteCarloSimulationModel model, Map<String,Object> dataModified)
This method returns the value under shifted market data (or model parameters).getValuesForModifiedData(MonteCarloSimulationModel model, String entityKey, Object dataModified)
This method returns the value under shifted market data (or model parameters).getValuesForModifiedData(MonteCarloSimulationModel model, Map<String,Object> dataModified)
This method returns the value under shifted market data (or model parameters).toString()
-
Constructor Details
-
AbstractMonteCarloProduct
-
AbstractMonteCarloProduct
public AbstractMonteCarloProduct()
-
-
Method Details
-
getValue
Description copied from interface:Product
Return the valuation of the product using the given model. Implement this method using a checked cast of the model to a derived model for which the product provides a valuation algorithm. Example: an interest rate product requires that the passed model object implements the interface of an interest rate model. Since there is no polymorphism on arguments (see Double Dynamic Dispatch), we reply on a checked cast.- Specified by:
getValue
in interfaceMonteCarloProduct
- Specified by:
getValue
in interfaceProduct
- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.model
- The model under which the product is valued.- Returns:
- Object containing the value of the product using the given model.
-
getValues
Description copied from interface:Product
Return the valuation of the product using the given model. Implement this method using a checked cast of the model to a derived model for which the product provides a valuation algorithm. Example: an interest rate product requires that the passed model object implements the interface of an interest rate model. Since there is no polymorphism on arguments (see Double Dynamic Dispatch), we reply on a checked cast.- Specified by:
getValues
in interfaceMonteCarloProduct
- Specified by:
getValues
in interfaceProduct
- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.model
- The model under which the product is valued.- Returns:
- Map containing the value of the product using the given model.
-
getValue
public abstract RandomVariable getValue(double evaluationTime, MonteCarloSimulationModel model) throws CalculationExceptionDescription copied from interface:MonteCarloProduct
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time. More generally: The value random variable is a random variable V*(t) such that the time-t conditional expectation of V*(t) is equal to the value of the financial product in time t. An example for V*(t) is the sum of t-discounted payoffs. Cashflows prior evaluationTime are not considered.- Specified by:
getValue
in interfaceMonteCarloProduct
- Parameters:
evaluationTime
- The time on which this products value should be observed.model
- The model used to price the product.- Returns:
- The random variable representing the value of the product discounted to evaluation time
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValue
Description copied from interface:MonteCarloProduct
This method returns the value of the product under the specified model.- Specified by:
getValue
in interfaceMonteCarloProduct
- Parameters:
model
- A model used to evaluate the product.- Returns:
- The value of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValues
public Map<String,Object> getValues(double evaluationTime, MonteCarloSimulationModel model) throws CalculationExceptionDescription copied from interface:MonteCarloProduct
This method returns the value of the product under the specified model and other information in a key-value map.- Specified by:
getValues
in interfaceMonteCarloProduct
- Parameters:
evaluationTime
- The time on which this products value should be observed.model
- A model used to evaluate the product.- Returns:
- The values of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValuesForModifiedData
public Map<String,Object> getValuesForModifiedData(double evaluationTime, MonteCarloSimulationModel model, Map<String,Object> dataModified) throws CalculationExceptionDescription copied from interface:MonteCarloProduct
This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).- Specified by:
getValuesForModifiedData
in interfaceMonteCarloProduct
- Parameters:
evaluationTime
- The time on which this products value should be observed.model
- The model used to price the product, except for the market data to modifydataModified
- The new market data object to use (could be of different types)- Returns:
- The values of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValuesForModifiedData
public Map<String,Object> getValuesForModifiedData(double evaluationTime, MonteCarloSimulationModel model, String entityKey, Object dataModified) throws CalculationExceptionDescription copied from interface:MonteCarloProduct
This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).- Specified by:
getValuesForModifiedData
in interfaceMonteCarloProduct
- Parameters:
evaluationTime
- The time on which this products value should be observed.model
- The model used to price the product, except for the market data to modifyentityKey
- The entity to change, it depends on the model if the model reacts to this key.dataModified
- The new market data object to use (could be of different types)- Returns:
- The values of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValues
Description copied from interface:MonteCarloProduct
This method returns the value of the product under the specified model and other information in a key-value map.- Specified by:
getValues
in interfaceMonteCarloProduct
- Parameters:
model
- A model used to evaluate the product.- Returns:
- The values of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValuesForModifiedData
public Map<String,Object> getValuesForModifiedData(MonteCarloSimulationModel model, Map<String,Object> dataModified) throws CalculationExceptionDescription copied from interface:MonteCarloProduct
This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).- Specified by:
getValuesForModifiedData
in interfaceMonteCarloProduct
- Parameters:
model
- The model used to price the product, except for the market data to modifydataModified
- The new market data object to use (could be of different types)- Returns:
- The values of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getValuesForModifiedData
public Map<String,Object> getValuesForModifiedData(MonteCarloSimulationModel model, String entityKey, Object dataModified) throws CalculationExceptionDescription copied from interface:MonteCarloProduct
This method returns the value under shifted market data (or model parameters). In its default implementation it does bump (creating a new model) and revalue. Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).- Specified by:
getValuesForModifiedData
in interfaceMonteCarloProduct
- Parameters:
model
- The model used to price the product, except for the market data to modifyentityKey
- The entity to change, it depends on the model if the model reacts to this key.dataModified
- The new market data object to use (could be of different types)- Returns:
- The values of the product.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getCurrency
Description copied from interface:MonteCarloProduct
Returns the currency string of this product.- Specified by:
getCurrency
in interfaceMonteCarloProduct
- Returns:
- the currency
-
toString
-