public class MonteCarloMultiAssetBlackScholesModel extends AbstractModel implements AssetModelMonteCarloSimulationInterface
BlackScholeModel and a Monte-Carlo implementation of a AbstractProcess
and forms a Monte-Carlo implementation of the Black-Scholes Model by implementing AssetModelMonteCarloSimulationInterface.
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 AbstractProcessInterface 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 AbstractProcessInterface for the notation.The interface for numerical schemes.,
The interface for models provinding parameters to numerical schemes.| Constructor and Description |
|---|
MonteCarloMultiAssetBlackScholesModel(BrownianMotionInterface brownianMotion,
double[] initialValues,
double riskFreeRate,
double[] volatilities,
double[][] correlations)
Create a Monte-Carlo simulation using given time discretization.
|
MonteCarloMultiAssetBlackScholesModel(TimeDiscretizationInterface 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 |
|---|---|
RandomVariableInterface |
applyStateSpaceTransform(int componentIndex,
RandomVariableInterface randomVariable)
Applies the state space transform fi to the given state random variable
such that Yi → fi(Yi) =: Xi.
|
RandomVariableInterface |
applyStateSpaceTransformInverse(int componentIndex,
RandomVariableInterface randomVariable) |
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.
|
MonteCarloMultiAssetBlackScholesModel |
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[] |
getDrift(int timeIndex,
RandomVariableInterface[] realizationAtTimeIndex,
RandomVariableInterface[] realizationPredictor)
This method has to be implemented to return the drift, i.e.
|
RandomVariableInterface[] |
getFactorLoading(int timeIndex,
int component,
RandomVariableInterface[] realizationAtTimeIndex)
This method has to be implemented to return the factor loadings, i.e.
|
RandomVariableInterface[] |
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.
|
RandomVariableInterface |
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.
|
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 |
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, getTime, getTimeDiscretization, getTimeIndex, setProcessclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMonteCarloWeights, getTime, getTimeDiscretization, getTimeIndexpublic MonteCarloMultiAssetBlackScholesModel(BrownianMotionInterface 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(TimeDiscretizationInterface 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 RandomVariableInterface[] getInitialState()
AbstractModelInterfacegetInitialState in interface AbstractModelInterfacepublic RandomVariableInterface[] getDrift(int timeIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)
AbstractModelInterfacegetDrift in interface AbstractModelInterfacetimeIndex - 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 RandomVariableInterface[] getFactorLoading(int timeIndex, int component, RandomVariableInterface[] realizationAtTimeIndex)
AbstractModelInterfacegetFactorLoading in interface AbstractModelInterfacetimeIndex - 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 RandomVariableInterface applyStateSpaceTransform(int componentIndex, RandomVariableInterface randomVariable)
AbstractModelInterfaceapplyStateSpaceTransform in interface AbstractModelInterfacecomponentIndex - The component index i.randomVariable - The state random variable Yi.public RandomVariableInterface applyStateSpaceTransformInverse(int componentIndex, RandomVariableInterface randomVariable)
applyStateSpaceTransformInverse in interface AbstractModelInterfacepublic 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 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 RandomVariableInterface getNumeraire(int timeIndex)
AssetModelMonteCarloSimulationInterfacegetNumeraire in interface AssetModelMonteCarloSimulationInterfacetimeIndex - The time index (associated with this models time discretization).public RandomVariableInterface getNumeraire(double time)
AssetModelMonteCarloSimulationInterfacegetNumeraire in interface AssetModelMonteCarloSimulationInterfacegetNumeraire in interface AbstractModelInterfacetime - The time for which the numeraire is requested.public RandomVariableInterface getRandomVariableForConstant(double value)
MonteCarloSimulationInterfaceMonteCarloSimulationInterface.getRandomVariableForConstant in interface AbstractModelInterfacegetRandomVariableForConstant in interface MonteCarloSimulationInterfacevalue - The constant value to be used for initialized the random variable.public int getNumberOfComponents()
AbstractModelInterfacegetNumberOfComponents in interface AbstractModelInterfacepublic int getNumberOfAssets()
AssetModelMonteCarloSimulationInterfacegetNumberOfAssets in interface AssetModelMonteCarloSimulationInterfacepublic double getRiskFreeRate()
public double[] getVolatilities()
public int getNumberOfPaths()
MonteCarloSimulationInterfacegetNumberOfPaths in interface MonteCarloSimulationInterfaceAbstractProcessInterface.getNumberOfPaths()public MonteCarloMultiAssetBlackScholesModel getCloneWithModifiedData(Map<String,Object> dataModified) throws CalculationException
AssetModelMonteCarloSimulationInterfacegetCloneWithModifiedData in interface AssetModelMonteCarloSimulationInterfacegetCloneWithModifiedData in interface AbstractModelInterfacegetCloneWithModifiedData in interface MonteCarloSimulationInterfacedataModified - The data which should be changed in the new modelCalculationException - Thrown when the model could not be created.public AssetModelMonteCarloSimulationInterface getCloneWithModifiedSeed(int seed)
AssetModelMonteCarloSimulationInterfaceAssetModelMonteCarloSimulationInterface
using a different Monte-Carlo seed.getCloneWithModifiedSeed in interface AssetModelMonteCarloSimulationInterfaceseed - The seed of the underlying random number generator.Copyright © 2017. All rights reserved.