public class MonteCarloVarianceGammaModel extends Object implements AssetModelMonteCarloSimulationModel
VarianceGammaModel and a Monte-Carlo implementation of a MonteCarloProcessFromProcessModel
and forms a Monte-Carlo implementation of the Variance Gamma Model by implementing AssetModelMonteCarloSimulationModel.| Constructor and Description |
|---|
MonteCarloVarianceGammaModel(TimeDiscretization timeDiscretization,
int numberOfPaths,
int seed,
double initialValue,
double riskFreeRate,
double sigma,
double theta,
double nu)
Create a Monte Carlo simulation using a given time discretization.
|
| Modifier and Type | Method and Description |
|---|---|
RandomVariable |
getAssetValue(double time,
int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.
|
RandomVariable |
getAssetValue(int timeIndex,
int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.
|
AssetModelMonteCarloSimulationModel |
getCloneWithModifiedData(Map<String,Object> dataModified)
Create a clone of this simulation modifying some of its properties (if any).
|
AssetModelMonteCarloSimulationModel |
getCloneWithModifiedSeed(int seed)
Create a clone of the object implementing
AssetModelMonteCarloSimulationModel
using a different Monte-Carlo seed. |
RandomVariable |
getMonteCarloWeights(double time)
This method returns the weights of a weighted Monte Carlo method (the probability density).
|
RandomVariable |
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.
|
RandomVariable |
getNumeraire(double time)
Returns the numeraire associated with the valuation measure used by this model.
|
RandomVariable |
getNumeraire(int timeIndex)
Returns the numeraire associated with the valuation measure used by this model.
|
RandomVariable |
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
MonteCarloSimulationModel. |
LocalDateTime |
getReferenceDate()
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.
|
TimeDiscretization |
getTimeDiscretization()
Returns the timeDiscretizationFromArray.
|
int |
getTimeIndex(double time)
Returns the time index for a given time.
|
public MonteCarloVarianceGammaModel(TimeDiscretization timeDiscretization, int numberOfPaths, int seed, double initialValue, double riskFreeRate, double sigma, double theta, double nu)
timeDiscretization - The time discretization.numberOfPaths - The number of Monte-Carlo paths to be used.seed - The seed used for the random number generator.initialValue - \( S_0 \) The spot value.riskFreeRate - The risk free rate.sigma - The parameter \( \sigma \)theta - The parameter \( \theta \)nu - The parameter \( \nu \)public LocalDateTime getReferenceDate()
MonteCarloSimulationModelgetReferenceDate in interface MonteCarloSimulationModelpublic RandomVariable getAssetValue(double time, int assetIndex) throws CalculationException
AssetModelMonteCarloSimulationModelgetAssetValue in interface AssetModelMonteCarloSimulationModeltime - 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 RandomVariable getAssetValue(int timeIndex, int assetIndex) throws CalculationException
AssetModelMonteCarloSimulationModelgetAssetValue in interface AssetModelMonteCarloSimulationModeltimeIndex - 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 RandomVariable getNumeraire(int timeIndex) throws CalculationException
AssetModelMonteCarloSimulationModelgetNumeraire in interface AssetModelMonteCarloSimulationModeltimeIndex - The time index (associated with this models time discretization).CalculationException - Thrown if calculation of numeraire fails.public RandomVariable getNumeraire(double time) throws CalculationException
AssetModelMonteCarloSimulationModelgetNumeraire in interface AssetModelMonteCarloSimulationModeltime - The time for which the numeraire is requested.CalculationException - Thrown if calculation of numeraire fails.public RandomVariable getMonteCarloWeights(double time) throws CalculationException
MonteCarloSimulationModelgetMonteCarloWeights in interface MonteCarloSimulationModeltime - 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()
AssetModelMonteCarloSimulationModelgetNumberOfAssets in interface AssetModelMonteCarloSimulationModelpublic AssetModelMonteCarloSimulationModel getCloneWithModifiedData(Map<String,Object> dataModified)
AssetModelMonteCarloSimulationModelgetCloneWithModifiedData in interface AssetModelMonteCarloSimulationModelgetCloneWithModifiedData in interface MonteCarloSimulationModeldataModified - The data which should be changed in the new modelpublic AssetModelMonteCarloSimulationModel getCloneWithModifiedSeed(int seed)
AssetModelMonteCarloSimulationModelAssetModelMonteCarloSimulationModel
using a different Monte-Carlo seed.getCloneWithModifiedSeed in interface AssetModelMonteCarloSimulationModelseed - The seed of the underlying random number generator.public int getNumberOfPaths()
MonteCarloSimulationModelgetNumberOfPaths in interface MonteCarloSimulationModelpublic TimeDiscretization getTimeDiscretization()
MonteCarloSimulationModelgetTimeDiscretization in interface MonteCarloSimulationModelpublic double getTime(int timeIndex)
MonteCarloSimulationModelgetTime in interface MonteCarloSimulationModeltimeIndex - Time indexpublic int getTimeIndex(double time)
MonteCarloSimulationModelgetTimeIndex in interface MonteCarloSimulationModeltime - The time.public RandomVariable getRandomVariableForConstant(double value)
MonteCarloSimulationModelMonteCarloSimulationModel.getRandomVariableForConstant in interface MonteCarloSimulationModelvalue - The constant value to be used for initialized the random variable.public RandomVariable getMonteCarloWeights(int timeIndex) throws CalculationException
MonteCarloSimulationModelgetMonteCarloWeights in interface MonteCarloSimulationModeltimeIndex - Time index at which the process should be observedCalculationException - Thrown if the valuation fails, specific cause may be available via the cause() method.Copyright © 2019. All rights reserved.