public class MonteCarloMultiAssetBlackScholesModel extends AbstractProcessModel implements AssetModelMonteCarloSimulationModel
BlackScholeModel and a Monte-Carlo implementation of a MonteCarloProcessFromProcessModel
and forms a Monte-Carlo implementation of the Black-Scholes Model by implementing AssetModelMonteCarloSimulationModel.
The model is
\[
dS_{i} = r S_{i} dt + \sigma_{i} S_{i} dW_{i}, \quad S_{i}(0) = S_{i,0},
\]
\[
dN = r N dt, \quad N(0) = N_{0},
\]
\[
dW_{i} dW_{j} = \rho_{i,j} dt,
\]
The class provides the model of \( S_{i} \) to an MonteCarloProcess via the specification of
\( f = exp \), \( \mu_{i} = r - \frac{1}{2} \sigma_{i}^2 \), \( \lambda_{i,j} = \sigma_{i} g_{i,j} \), i.e.,
of the SDE
\[
dX_{i} = \mu_{i} dt + \lambda_{i,j} dW, \quad X_{i}(0) = \log(S_{i,0}),
\]
with \( S = f(X) \). See MonteCarloProcess for the notation.The interface for numerical schemes.,
The interface for models provinding parameters to numerical schemes.| Constructor and Description |
|---|
MonteCarloMultiAssetBlackScholesModel(BrownianMotion brownianMotion,
double[] initialValues,
double riskFreeRate,
double[] volatilities,
double[][] correlations)
Create a Monte-Carlo simulation using given time discretization.
|
MonteCarloMultiAssetBlackScholesModel(TimeDiscretization timeDiscretization,
int numberOfPaths,
double[] initialValues,
double riskFreeRate,
double[] volatilities,
double[][] correlations)
Create a Monte-Carlo simulation using given time discretization.
|
| Modifier and Type | Method and Description |
|---|---|
RandomVariable |
applyStateSpaceTransform(int componentIndex,
RandomVariable randomVariable)
Applies the state space transform fi to the given state random variable
such that Yi → fi(Yi) =: Xi.
|
RandomVariable |
applyStateSpaceTransformInverse(int componentIndex,
RandomVariable randomVariable) |
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.
|
MonteCarloMultiAssetBlackScholesModel |
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[] |
getDrift(int timeIndex,
RandomVariable[] realizationAtTimeIndex,
RandomVariable[] realizationPredictor)
This method has to be implemented to return the drift, i.e.
|
RandomVariable[] |
getFactorLoading(int timeIndex,
int component,
RandomVariable[] realizationAtTimeIndex)
This method has to be implemented to return the factor loadings, i.e.
|
RandomVariable[] |
getInitialState()
Returns the initial value of the state variable of the process Y, not to be
confused with the initial value of the model X (which is the state space transform
applied to this state value.
|
RandomVariable |
getMonteCarloWeights(double time)
This method returns the weights of a weighted Monte Carlo method (the probability density).
|
int |
getNumberOfAssets()
Returns the number of asset price processes.
|
int |
getNumberOfComponents()
Returns the number of components
|
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. |
double |
getRiskFreeRate()
Returns the risk free rate parameter of this model.
|
double[] |
getVolatilities()
Returns the volatility parameters of this model.
|
String |
toString() |
getInitialValue, getMonteCarloWeights, getNumberOfFactors, getProcess, getProcessValue, getReferenceDate, getTime, getTimeDiscretization, getTimeIndex, setProcessclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMonteCarloWeights, getReferenceDate, getTime, getTimeDiscretization, getTimeIndexpublic MonteCarloMultiAssetBlackScholesModel(BrownianMotion brownianMotion, double[] initialValues, double riskFreeRate, double[] volatilities, double[][] correlations)
brownianMotion - The Brownian motion to be used for the numerical scheme.initialValues - Spot values.riskFreeRate - The risk free rate.volatilities - The log volatilities.correlations - A correlation matrix.public MonteCarloMultiAssetBlackScholesModel(TimeDiscretization timeDiscretization, int numberOfPaths, double[] initialValues, double riskFreeRate, double[] volatilities, double[][] correlations)
timeDiscretization - The time discretization.numberOfPaths - The number of Monte-Carlo path to be used.initialValues - Spot values.riskFreeRate - The risk free rate.volatilities - The log volatilities.correlations - A correlation matrix.public RandomVariable[] getInitialState()
ProcessModelgetInitialState in interface ProcessModelpublic RandomVariable[] getDrift(int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
ProcessModelgetDrift in interface ProcessModeltimeIndex - The time index (related to the model times discretization).realizationAtTimeIndex - The given realization at timeIndexrealizationPredictor - The given realization at timeIndex+1 or null if no predictor is available.public RandomVariable[] getFactorLoading(int timeIndex, int component, RandomVariable[] realizationAtTimeIndex)
ProcessModelgetFactorLoading in interface ProcessModeltimeIndex - The time index (related to the model times discretization).component - The index j of the driven component.realizationAtTimeIndex - The realization of X at the time corresponding to timeIndex (in order to implement local and stochastic volatlity models).public RandomVariable applyStateSpaceTransform(int componentIndex, RandomVariable randomVariable)
ProcessModelapplyStateSpaceTransform in interface ProcessModelcomponentIndex - The component index i.randomVariable - The state random variable Yi.public RandomVariable applyStateSpaceTransformInverse(int componentIndex, RandomVariable randomVariable)
applyStateSpaceTransformInverse in interface ProcessModelpublic 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 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 RandomVariable getNumeraire(int timeIndex)
AssetModelMonteCarloSimulationModelgetNumeraire in interface AssetModelMonteCarloSimulationModeltimeIndex - The time index (associated with this models time discretization).public RandomVariable getNumeraire(double time)
AssetModelMonteCarloSimulationModelgetNumeraire in interface AssetModelMonteCarloSimulationModelgetNumeraire in interface ProcessModeltime - The time for which the numeraire is requested.public RandomVariable getRandomVariableForConstant(double value)
MonteCarloSimulationModelMonteCarloSimulationModel.getRandomVariableForConstant in interface ProcessModelgetRandomVariableForConstant in interface MonteCarloSimulationModelvalue - The constant value to be used for initialized the random variable.public int getNumberOfComponents()
ProcessModelgetNumberOfComponents in interface ProcessModelpublic int getNumberOfAssets()
AssetModelMonteCarloSimulationModelgetNumberOfAssets in interface AssetModelMonteCarloSimulationModelpublic double getRiskFreeRate()
public double[] getVolatilities()
public int getNumberOfPaths()
MonteCarloSimulationModelgetNumberOfPaths in interface MonteCarloSimulationModelMonteCarloProcess.getNumberOfPaths()public MonteCarloMultiAssetBlackScholesModel getCloneWithModifiedData(Map<String,Object> dataModified)
AssetModelMonteCarloSimulationModelgetCloneWithModifiedData in interface AssetModelMonteCarloSimulationModelgetCloneWithModifiedData in interface ProcessModelgetCloneWithModifiedData 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.Copyright © 2019. All rights reserved.