public class MonteCarloMertonModel extends Object implements AssetModelMonteCarloSimulationInterface
MertonModel and a Monte-Carlo implementation of a AbstractProcess, namely ProcessEulerScheme,
and forms a Monte-Carlo implementation of the Merton model by implementing AssetModelMonteCarloSimulationInterface.
The model is
\[
dS = \mu S dt + \sigma S dW + S dJ, \quad S(0) = S_{0},
\]
\[
dN = r N dt, \quad N(0) = N_{0},
\]
where \( W \) is Brownian motion and \( J \) is a jump process (compound Poisson process).
The process \( J \) is given by \( J(t) = \sum_{i=1}^{N(t)} (Y_{i}-1) \), where
\( \log(Y_{i}) \) are i.i.d. normals with mean \( a - \frac{1}{2} b^{2} \) and standard deviation \( b \).
Here \( a \) is the jump size mean and \( b \) is the jump size std. dev.
For details on the construction of the model see MertonModel.MertonModel,
The interface for numerical schemes.,
The interface for models provinding parameters to numerical schemes.| Constructor and Description |
|---|
MonteCarloMertonModel(TimeDiscretizationInterface timeDiscretization,
int numberOfPaths,
int seed,
double initialValue,
double riskFreeRate,
double volatility,
double jumpIntensity,
double jumpSizeMean,
double jumpSizeStDev)
Create a Monte-Carlo simulation using given time discretization and given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
RandomVariableInterface |
getAssetValue(double time,
int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.
|
RandomVariableInterface |
getAssetValue(int timeIndex,
int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.
|
AssetModelMonteCarloSimulationInterface |
getCloneWithModifiedData(Map<String,Object> dataModified)
Create a clone of this simulation modifying some of its properties (if any).
|
AssetModelMonteCarloSimulationInterface |
getCloneWithModifiedSeed(int seed)
Create a clone of the object implementing
AssetModelMonteCarloSimulationInterface
using a different Monte-Carlo seed. |
RandomVariableInterface |
getMonteCarloWeights(double time)
This method returns the weights of a weighted Monte Carlo method (the probability density).
|
RandomVariableInterface |
getMonteCarloWeights(int timeIndex)
This method returns the weights of a weighted Monte Carlo method (the probability density).
|
int |
getNumberOfAssets()
Returns the number of asset price processes.
|
int |
getNumberOfPaths()
Returns the numberOfPaths.
|
RandomVariableInterface |
getNumeraire(double time)
Returns the numeraire associated with the valuation measure used by this model.
|
RandomVariableInterface |
getNumeraire(int timeIndex)
Returns the numeraire associated with the valuation measure used by this model.
|
RandomVariableInterface |
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 this
MonteCarloSimulationInterface. |
double |
getTime(int timeIndex)
Returns the time for a given time index.
|
TimeDiscretizationInterface |
getTimeDiscretization()
Returns the timeDiscretization.
|
int |
getTimeIndex(double time)
Returns the time index for a given time.
|
public MonteCarloMertonModel(TimeDiscretizationInterface timeDiscretization, int numberOfPaths, int seed, double initialValue, double riskFreeRate, double volatility, double jumpIntensity, double jumpSizeMean, double jumpSizeStDev)
timeDiscretization - The time discretization.numberOfPaths - The number of Monte-Carlo path to be used.seed - The seed used for the random number generator.initialValue - Spot value.riskFreeRate - The risk free rate.volatility - The log volatility.jumpIntensity - The intensity parameter lambda of the compound Poisson process.jumpSizeMean - The mean jump size of the normal distributes jump sizes of the compound Poisson process.jumpSizeStDev - The standard deviation of the normal distributes jump sizes of the compound Poisson process.public RandomVariableInterface getAssetValue(double time, int assetIndex) throws CalculationException
AssetModelMonteCarloSimulationInterfacegetAssetValue in interface AssetModelMonteCarloSimulationInterfacetime - Simulation timeassetIndex - Index of the asset (0 for a single asset model)CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.public RandomVariableInterface getAssetValue(int timeIndex, int assetIndex) throws CalculationException
AssetModelMonteCarloSimulationInterfacegetAssetValue in interface AssetModelMonteCarloSimulationInterfacetimeIndex - Index of simulation timeassetIndex - Index of the asset (0 for a single asset model)CalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.public RandomVariableInterface getNumeraire(int timeIndex) throws CalculationException
AssetModelMonteCarloSimulationInterfacegetNumeraire in interface AssetModelMonteCarloSimulationInterfacetimeIndex - The time index (associated with this models time discretization).CalculationException - Thrown if calculation of numeraire fails.public RandomVariableInterface getNumeraire(double time) throws CalculationException
AssetModelMonteCarloSimulationInterfacegetNumeraire in interface AssetModelMonteCarloSimulationInterfacetime - The time for which the numeraire is requested.CalculationException - Thrown if calculation of numeraire fails.public RandomVariableInterface getMonteCarloWeights(double time) throws CalculationException
MonteCarloSimulationInterfacegetMonteCarloWeights in interface MonteCarloSimulationInterfacetime - Time at which the process should be observedCalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.public int getNumberOfAssets()
AssetModelMonteCarloSimulationInterfacegetNumberOfAssets in interface AssetModelMonteCarloSimulationInterfacepublic AssetModelMonteCarloSimulationInterface getCloneWithModifiedData(Map<String,Object> dataModified)
AssetModelMonteCarloSimulationInterfacegetCloneWithModifiedData in interface AssetModelMonteCarloSimulationInterfacegetCloneWithModifiedData in interface MonteCarloSimulationInterfacedataModified - The data which should be changed in the new modelpublic AssetModelMonteCarloSimulationInterface getCloneWithModifiedSeed(int seed)
AssetModelMonteCarloSimulationInterfaceAssetModelMonteCarloSimulationInterface
using a different Monte-Carlo seed.getCloneWithModifiedSeed in interface AssetModelMonteCarloSimulationInterfaceseed - The seed of the underlying random number generator.public int getNumberOfPaths()
MonteCarloSimulationInterfacegetNumberOfPaths in interface MonteCarloSimulationInterfacepublic TimeDiscretizationInterface getTimeDiscretization()
MonteCarloSimulationInterfacegetTimeDiscretization in interface MonteCarloSimulationInterfacepublic double getTime(int timeIndex)
MonteCarloSimulationInterfacegetTime in interface MonteCarloSimulationInterfacetimeIndex - Time indexpublic int getTimeIndex(double time)
MonteCarloSimulationInterfacegetTimeIndex in interface MonteCarloSimulationInterfacetime - The time.public RandomVariableInterface getRandomVariableForConstant(double value)
MonteCarloSimulationInterfaceMonteCarloSimulationInterface.getRandomVariableForConstant in interface MonteCarloSimulationInterfacevalue - The constant value to be used for initialized the random variable.public RandomVariableInterface getMonteCarloWeights(int timeIndex) throws CalculationException
MonteCarloSimulationInterfacegetMonteCarloWeights in interface MonteCarloSimulationInterfacetimeIndex - Time index at which the process should be observedCalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.Copyright © 2017. All rights reserved.