Module net.finmath.lib
Class MonteCarloBlackScholesModel
- java.lang.Object
-
- net.finmath.montecarlo.assetderivativevaluation.MonteCarloAssetModel
-
- net.finmath.montecarlo.assetderivativevaluation.MonteCarloBlackScholesModel
-
- All Implemented Interfaces:
Model
,AssetModelMonteCarloSimulationModel
,MonteCarloSimulationModel
public class MonteCarloBlackScholesModel extends MonteCarloAssetModel
This class glues together aBlackScholeModel
and a Monte-Carlo implementation of aMonteCarloProcessFromProcessModel
and forms a Monte-Carlo implementation of the Black-Scholes Model by implementingAssetModelMonteCarloSimulationModel
. The model is \[ dS = r S dt + \sigma S dW, \quad S(0) = S_{0}, \] \[ dN = r N dt, \quad N(0) = N_{0}, \] The class provides the model of S to an
via the specification of \( f = exp \), \( \mu = r - \frac{1}{2} \sigma^2 \), \( \lambda_{1,1} = \sigma \), i.e., of the SDE \[ dX = \mu dt + \lambda_{1,1} dW, \quad X(0) = \log(S_{0}), \] with \( S = f(X) \). SeeMonteCarloProcess
MonteCarloProcess
for the notation.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
The interface for numerical schemes.
,The interface for models provinding parameters to numerical schemes.
-
-
Constructor Summary
Constructors Constructor Description MonteCarloBlackScholesModel(double initialValue, double riskFreeRate, double volatility, BrownianMotion brownianMotion)
Create a Monte-Carlo simulation using given process discretization scheme.MonteCarloBlackScholesModel(TimeDiscretization timeDiscretization, int numberOfPaths, double initialValue, double riskFreeRate, double volatility)
Create a Monte-Carlo simulation using given time discretization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomVariable
getAssetValue(double time, int assetIndex)
Returns the random variable representing the asset's value at a given time for a given asset.MonteCarloBlackScholesModel
getCloneWithModifiedData(Map<String,Object> dataModified)
Create a clone of this simulation modifying some of its properties (if any).AssetModelMonteCarloSimulationModel
getCloneWithModifiedSeed(int seed)
The method is not implemented.BlackScholesModel
getModel()
Returns theBlackScholesModel
used for this Monte-Carlo simulation.-
Methods inherited from class net.finmath.montecarlo.assetderivativevaluation.MonteCarloAssetModel
getAssetValue, getMonteCarloWeights, getMonteCarloWeights, getNumberOfAssets, getNumberOfPaths, getNumeraire, getNumeraire, getProcess, getRandomVariableForConstant, getReferenceDate, getTime, getTimeDiscretization, getTimeIndex, toString
-
-
-
-
Constructor Detail
-
MonteCarloBlackScholesModel
public MonteCarloBlackScholesModel(double initialValue, double riskFreeRate, double volatility, BrownianMotion brownianMotion)
Create a Monte-Carlo simulation using given process discretization scheme.- Parameters:
initialValue
- Spot valueriskFreeRate
- The risk free ratevolatility
- The log volatilitybrownianMotion
- The brownian motion driving the model.
-
MonteCarloBlackScholesModel
public MonteCarloBlackScholesModel(TimeDiscretization timeDiscretization, int numberOfPaths, double initialValue, double riskFreeRate, double volatility)
Create a Monte-Carlo simulation using given time discretization.- Parameters:
timeDiscretization
- The time discretization.numberOfPaths
- The number of Monte-Carlo path to be used.initialValue
- Spot value.riskFreeRate
- The risk free rate.volatility
- The log volatility.
-
-
Method Detail
-
getAssetValue
public RandomVariable getAssetValue(double time, int assetIndex) throws CalculationException
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
- Overrides:
getAssetValue
in classMonteCarloAssetModel
- 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.
-
getCloneWithModifiedData
public MonteCarloBlackScholesModel getCloneWithModifiedData(Map<String,Object> dataModified)
Description 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
- Overrides:
getCloneWithModifiedData
in classMonteCarloAssetModel
- 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 :-)
-
getCloneWithModifiedSeed
public AssetModelMonteCarloSimulationModel getCloneWithModifiedSeed(int seed)
Description copied from class:MonteCarloAssetModel
The method is not implemented. Instead call getCloneWithModifiedData on the model an create a new process from it.- Specified by:
getCloneWithModifiedSeed
in interfaceAssetModelMonteCarloSimulationModel
- Overrides:
getCloneWithModifiedSeed
in classMonteCarloAssetModel
- Parameters:
seed
- The new seed.- Returns:
- Returns a clone of this model except for a modified Monte-Carlo seed.
-
getModel
public BlackScholesModel getModel()
Returns theBlackScholesModel
used for this Monte-Carlo simulation.- Overrides:
getModel
in classMonteCarloAssetModel
- Returns:
- the model
-
-