Module net.finmath.lib
Class MonteCarloAssetModel
java.lang.Object
net.finmath.montecarlo.assetderivativevaluation.MonteCarloAssetModel
- All Implemented Interfaces:
Model
,AssetModelMonteCarloSimulationModel
,MonteCarloSimulationModel
- Direct Known Subclasses:
MonteCarloBlackScholesModel
This class glues together an
AbstractProcessModel
and a Monte-Carlo implementation of a MonteCarloProcessFromProcessModel
and implements AssetModelMonteCarloSimulationModel
.
The model is specified via the object implementing ProcessModel
.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
The interface for numerical schemes.
,The interface for models provinding parameters to numerical schemes.
-
Constructor Summary
ConstructorsConstructorDescriptionMonteCarloAssetModel(ProcessModel model, IndependentIncrements stochasticDriver)
Convenient constructor being the same as this(new EulerSchemeFromProcessModel(model, stochasticDriver))MonteCarloAssetModel(ProcessModel model, MonteCarloProcess process)
Deprecated.May be made private in future releases.MonteCarloAssetModel(MonteCarloProcess process)
Create a Monte-Carlo simulation using given process discretization scheme. -
Method Summary
Modifier and TypeMethodDescriptiongetAssetValue(double time, int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.getAssetValue(int timeIndex, int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.getCloneWithModifiedData(Map<String,Object> dataModified)
Create a clone of this simulation modifying some of its properties (if any).getCloneWithModifiedSeed(int seed)
Deprecated.getModel()
Returns theProcessModel
used for this Monte-Carlo simulation.getMonteCarloWeights(double time)
This method returns the weights of a weighted Monte Carlo method (the probability density).getMonteCarloWeights(int timeIndex)
This method returns the weights of a weighted Monte Carlo method (the probability density).int
Returns the number of asset price processes.int
Returns the numberOfPaths.getNumeraire(double time)
Returns the numeraire associated with the valuation measure used by this model.getNumeraire(int timeIndex)
Returns the numeraire associated with the valuation measure used by this model.Returns theMonteCarloProcess
used for this Monte-Carlo simulation.getRandomVariableForConstant(double value)
Returns a random variable which is initialized to a constant, but has exactly the same number of paths or discretization points as the ones used by thisMonteCarloSimulationModel
.Returns the model's date corresponding to the time discretization's \( t = 0 \).double
getTime(int timeIndex)
Returns the time for a given time index.Returns the timeDiscretizationFromArray.int
getTimeIndex(double time)
Returns the time index for a given time.toString()
-
Constructor Details
-
MonteCarloAssetModel
Create a Monte-Carlo simulation using given process discretization scheme.- Parameters:
process
- The numerical scheme to be used.
-
MonteCarloAssetModel
Convenient constructor being the same as this(new EulerSchemeFromProcessModel(model, stochasticDriver))- Parameters:
model
- The model to use for the EulerSchemeFromProcessModel.stochasticDriver
- The stochatic driver to use.
-
MonteCarloAssetModel
Deprecated.May be made private in future releases.Create a Monte-Carlo simulation using given process discretization scheme.- Parameters:
model
- The model to be used.process
- The numerical scheme to be used.
-
-
Method Details
-
getAssetValue
Description copied from interface:AssetModelMonteCarloSimulationModel
Returns the random variable representing the asset's value at a given time for a given asset.- Specified by:
getAssetValue
in interfaceAssetModelMonteCarloSimulationModel
- Parameters:
time
- Simulation timeassetIndex
- Index of the asset (0 for a single asset model)- Returns:
- The asset process as seen on simulation time
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getAssetValue
Description copied from interface:AssetModelMonteCarloSimulationModel
Returns the random variable representing the asset's value at a given time for a given asset.- Specified by:
getAssetValue
in interfaceAssetModelMonteCarloSimulationModel
- Parameters:
timeIndex
- Index of simulation timeassetIndex
- Index of the asset (0 for a single asset model)- Returns:
- The asset process as seen on simulation time
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getNumeraire
Description copied from interface:AssetModelMonteCarloSimulationModel
Returns the numeraire associated with the valuation measure used by this model.- Specified by:
getNumeraire
in interfaceAssetModelMonteCarloSimulationModel
- Parameters:
timeIndex
- The time index (associated with this models time discretization).- Returns:
- The numeraire associated with the valuation measure used by this model.
- Throws:
CalculationException
- Thrown if calculation of numeraire fails.
-
getNumeraire
Description copied from interface:AssetModelMonteCarloSimulationModel
Returns the numeraire associated with the valuation measure used by this model.- Specified by:
getNumeraire
in interfaceAssetModelMonteCarloSimulationModel
- Parameters:
time
- The time for which the numeraire is requested.- Returns:
- The numeraire associated with the valuation measure used by this model.
- Throws:
CalculationException
- Thrown if calculation of numeraire fails.
-
getMonteCarloWeights
Description copied from interface:MonteCarloSimulationModel
This method returns the weights of a weighted Monte Carlo method (the probability density).- Specified by:
getMonteCarloWeights
in interfaceMonteCarloSimulationModel
- Parameters:
time
- Time at which the process should be observed- Returns:
- A vector of positive weights which sums up to one
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getNumberOfAssets
public int getNumberOfAssets()Description copied from interface:AssetModelMonteCarloSimulationModel
Returns the number of asset price processes.- Specified by:
getNumberOfAssets
in interfaceAssetModelMonteCarloSimulationModel
- Returns:
- The number of asset price processes
-
getCloneWithModifiedData
public MonteCarloAssetModel getCloneWithModifiedData(Map<String,Object> dataModified) throws CalculationExceptionDescription copied from interface:AssetModelMonteCarloSimulationModel
Create a clone of this simulation modifying some of its properties (if any).- Specified by:
getCloneWithModifiedData
in interfaceAssetModelMonteCarloSimulationModel
- Specified by:
getCloneWithModifiedData
in interfaceMonteCarloSimulationModel
- Parameters:
dataModified
- The data which should be changed in the new model- Returns:
- Returns a clone of this model, with some data modified (then it is no longer a clone :-)
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getCloneWithModifiedSeed
Deprecated.The method is not implemented. Instead call getCloneWithModifiedData on the model an create a new process from it.- Specified by:
getCloneWithModifiedSeed
in interfaceAssetModelMonteCarloSimulationModel
- Parameters:
seed
- The new seed.- Returns:
- Returns a clone of this model except for a modified Monte-Carlo seed.
-
getNumberOfPaths
public int getNumberOfPaths()Description copied from interface:MonteCarloSimulationModel
Returns the numberOfPaths.- Specified by:
getNumberOfPaths
in interfaceMonteCarloSimulationModel
- Returns:
- Returns the numberOfPaths.
-
getReferenceDate
Description copied from interface:MonteCarloSimulationModel
Returns the model's date corresponding to the time discretization's \( t = 0 \).- Specified by:
getReferenceDate
in interfaceMonteCarloSimulationModel
- Returns:
- The model's date corresponding to the time discretization's \( t = 0 \).
-
getTimeDiscretization
Description copied from interface:MonteCarloSimulationModel
Returns the timeDiscretizationFromArray.- Specified by:
getTimeDiscretization
in interfaceMonteCarloSimulationModel
- Returns:
- Returns the timeDiscretizationFromArray.
-
getTime
public double getTime(int timeIndex)Description copied from interface:MonteCarloSimulationModel
Returns the time for a given time index.- Specified by:
getTime
in interfaceMonteCarloSimulationModel
- Parameters:
timeIndex
- Time index- Returns:
- Returns the time for a given time index.
-
getTimeIndex
public int getTimeIndex(double time)Description copied from interface:MonteCarloSimulationModel
Returns the time index for a given time.- Specified by:
getTimeIndex
in interfaceMonteCarloSimulationModel
- Parameters:
time
- The time.- Returns:
- Returns the time index for a given time.
-
getRandomVariableForConstant
Description copied from interface:MonteCarloSimulationModel
Returns a random variable which is initialized to a constant, but has exactly the same number of paths or discretization points as the ones used by thisMonteCarloSimulationModel
.- Specified by:
getRandomVariableForConstant
in interfaceMonteCarloSimulationModel
- Parameters:
value
- The constant value to be used for initialized the random variable.- Returns:
- A new random variable.
-
getMonteCarloWeights
Description copied from interface:MonteCarloSimulationModel
This method returns the weights of a weighted Monte Carlo method (the probability density).- Specified by:
getMonteCarloWeights
in interfaceMonteCarloSimulationModel
- Parameters:
timeIndex
- Time index at which the process should be observed- Returns:
- A vector of positive weights which sums up to one
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getModel
Returns theProcessModel
used for this Monte-Carlo simulation.- Returns:
- the model
-
getProcess
Returns theMonteCarloProcess
used for this Monte-Carlo simulation.- Returns:
- the process
-
toString
-