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 aBlackScholeModeland a Monte-Carlo implementation of aMonteCarloProcessFromProcessModeland 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 anvia 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) \). SeeMonteCarloProcessMonteCarloProcessfor 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 RandomVariablegetAssetValue(double time, int assetIndex)Returns the random variable representing the asset's value at a given time for a given asset.MonteCarloBlackScholesModelgetCloneWithModifiedData(Map<String,Object> dataModified)Create a clone of this simulation modifying some of its properties (if any).AssetModelMonteCarloSimulationModelgetCloneWithModifiedSeed(int seed)The method is not implemented.BlackScholesModelgetModel()Returns theBlackScholesModelused 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:AssetModelMonteCarloSimulationModelReturns the random variable representing the asset's value at a given time for a given asset.- Specified by:
getAssetValuein interfaceAssetModelMonteCarloSimulationModel- Overrides:
getAssetValuein 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:AssetModelMonteCarloSimulationModelCreate a clone of this simulation modifying some of its properties (if any).- Specified by:
getCloneWithModifiedDatain interfaceAssetModelMonteCarloSimulationModel- Specified by:
getCloneWithModifiedDatain interfaceMonteCarloSimulationModel- Overrides:
getCloneWithModifiedDatain 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:MonteCarloAssetModelThe method is not implemented. Instead call getCloneWithModifiedData on the model an create a new process from it.- Specified by:
getCloneWithModifiedSeedin interfaceAssetModelMonteCarloSimulationModel- Overrides:
getCloneWithModifiedSeedin 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 theBlackScholesModelused for this Monte-Carlo simulation.- Overrides:
getModelin classMonteCarloAssetModel- Returns:
- the model
-
-