net.finmath.montecarlo
Class AbstractMonteCarloProduct
- java.lang.Object
-
- net.finmath.montecarlo.AbstractMonteCarloProduct
-
- All Implemented Interfaces:
- ProductInterface
- Direct Known Subclasses:
- AbstractAssetMonteCarloProduct, AbstractLIBORMonteCarloProduct, PortfolioMonteCarloProduct, SwaprateCovarianceAnalyticApproximation
public abstract class AbstractMonteCarloProduct extends java.lang.Object implements ProductInterface
Base class for products requiring an MonteCarloSimulationInterface for valuation.
-
-
Constructor Summary
Constructors Constructor and Description AbstractMonteCarloProduct()AbstractMonteCarloProduct(java.lang.String currency)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetCurrency()Returns the currency string of this notional.java.lang.ObjectgetValue(double evaluationTime, ModelInterface model)Return the valuation of the product using the given model.abstract RandomVariableInterfacegetValue(double evaluationTime, MonteCarloSimulationInterface model)This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.doublegetValue(MonteCarloSimulationInterface model)This method returns the value of the product under the specified model.java.util.Map<java.lang.String,java.lang.Object>getValues(double evaluationTime, MonteCarloSimulationInterface model)This method returns the value of the product under the specified model and other information in a key-value map.java.util.Map<java.lang.String,java.lang.Object>getValues(MonteCarloSimulationInterface model)This method returns the value of the product under the specified model and other information in a key-value map.java.util.Map<java.lang.String,java.lang.Object>getValuesForModifiedData(double evaluationTime, MonteCarloSimulationInterface model, java.util.Map<java.lang.String,java.lang.Object> dataModified)This method returns the value under shifted market data (or model parameters).java.util.Map<java.lang.String,java.lang.Object>getValuesForModifiedData(double evaluationTime, MonteCarloSimulationInterface model, java.lang.String entityKey, java.lang.Object dataModified)This method returns the value under shifted market data (or model parameters).java.util.Map<java.lang.String,java.lang.Object>getValuesForModifiedData(MonteCarloSimulationInterface model, java.util.Map<java.lang.String,java.lang.Object> dataModified)This method returns the value under shifted market data (or model parameters).java.util.Map<java.lang.String,java.lang.Object>getValuesForModifiedData(MonteCarloSimulationInterface model, java.lang.String entityKey, java.lang.Object dataModified)This method returns the value under shifted market data (or model parameters).java.lang.StringtoString()
-
-
-
Constructor Detail
-
AbstractMonteCarloProduct
public AbstractMonteCarloProduct(java.lang.String currency)
-
AbstractMonteCarloProduct
public AbstractMonteCarloProduct()
-
-
Method Detail
-
getValue
public java.lang.Object getValue(double evaluationTime, ModelInterface model)Description copied from interface:ProductInterfaceReturn the valuation of the product using the given model.- Specified by:
getValuein interfaceProductInterface- 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:
- The value of the product using the given model.
-
getValue
public abstract RandomVariableInterface getValue(double evaluationTime, MonteCarloSimulationInterface model) throws CalculationException
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.- 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
public double getValue(MonteCarloSimulationInterface model) throws CalculationException
This method returns the value of the product under the specified model.- 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 java.util.Map<java.lang.String,java.lang.Object> getValues(double evaluationTime, MonteCarloSimulationInterface model) throws CalculationExceptionThis method returns the value of the product under the specified model and other information in a key-value map.- 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 java.util.Map<java.lang.String,java.lang.Object> getValuesForModifiedData(double evaluationTime, MonteCarloSimulationInterface model, java.util.Map<java.lang.String,java.lang.Object> dataModified) throws CalculationExceptionThis 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).- 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 java.util.Map<java.lang.String,java.lang.Object> getValuesForModifiedData(double evaluationTime, MonteCarloSimulationInterface model, java.lang.String entityKey, java.lang.Object dataModified) throws CalculationExceptionThis 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).- 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
public java.util.Map<java.lang.String,java.lang.Object> getValues(MonteCarloSimulationInterface model) throws CalculationException
This method returns the value of the product under the specified model and other information in a key-value map.- 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 java.util.Map<java.lang.String,java.lang.Object> getValuesForModifiedData(MonteCarloSimulationInterface model, java.util.Map<java.lang.String,java.lang.Object> dataModified) throws CalculationException
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).- 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 java.util.Map<java.lang.String,java.lang.Object> getValuesForModifiedData(MonteCarloSimulationInterface model, java.lang.String entityKey, java.lang.Object dataModified) throws CalculationException
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).- 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
public java.lang.String getCurrency()
Returns the currency string of this notional.- Returns:
- the currency
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG