Package net.finmath.montecarlo.model
Class AbstractProcessModel
- java.lang.Object
-
- net.finmath.montecarlo.model.AbstractProcessModel
-
- All Implemented Interfaces:
ProcessModel
- Direct Known Subclasses:
BachelierModel
,BlackScholesModel
,BlackScholesModelWithCurves
,DisplacedLognomalModelExperimental
,HestonModel
,HullWhiteModel
,HullWhiteModelWithConstantCoeff
,HullWhiteModelWithDirectSimulation
,HullWhiteModelWithShiftExtension
,InhomogeneousDisplacedLognomalModel
,InhomogenousBachelierModel
,LIBORMarketModelFromCovarianceModel
,LIBORMarketModelStandard
,LIBORMarketModelWithTenorRefinement
,MertonModel
,MonteCarloMultiAssetBlackScholesModel
,VarianceGammaModel
public abstract class AbstractProcessModel extends Object implements ProcessModel
This class is an abstract base class to implement a model provided to an MonteCarloProcessFromProcessModel. Manages the delegation to MonteCarloProcess. For details seeProcessModel
.- Version:
- 1.3
- Author:
- Christian Fries
- See Also:
The interface definition contains more details.
-
-
Constructor Summary
Constructors Constructor Description AbstractProcessModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomVariable[]
getInitialValue()
Returns the initial value of the model.RandomVariable
getMonteCarloWeights(int timeIndex)
int
getNumberOfFactors()
Returns the number of factors m, i.e., the number of independent Brownian drivers.MonteCarloProcess
getProcess()
Get the numerical scheme used to generate the stochastic process.RandomVariable
getProcessValue(int timeIndex, int componentIndex)
LocalDateTime
getReferenceDate()
Returns the model's date corresponding to the time discretization's \( t = 0 \).double
getTime(int timeIndex)
Return the simulation time for a given time index.TimeDiscretization
getTimeDiscretization()
Get the time discretization of the model (simulation time).int
getTimeIndex(double time)
Return the time index associated for the given simulation time.void
setProcess(MonteCarloProcess process)
Set the numerical scheme used to generate the stochastic process.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.finmath.montecarlo.model.ProcessModel
applyStateSpaceTransform, applyStateSpaceTransformInverse, getCloneWithModifiedData, getDrift, getFactorLoading, getInitialState, getNumberOfComponents, getNumeraire, getRandomVariableForConstant
-
-
-
-
Method Detail
-
getInitialValue
public RandomVariable[] getInitialValue()
Returns the initial value of the model.- Returns:
- The initial value of the model.
-
setProcess
public void setProcess(MonteCarloProcess process)
Description copied from interface:ProcessModel
Set the numerical scheme used to generate the stochastic process. The model needs the numerical scheme to calculate, e.g., the numeraire.- Specified by:
setProcess
in interfaceProcessModel
- Parameters:
process
- The process.
-
getProcess
public MonteCarloProcess getProcess()
Description copied from interface:ProcessModel
Get the numerical scheme used to generate the stochastic process. The model needs the numerical scheme to calculate, e.g., the numeraire.- Specified by:
getProcess
in interfaceProcessModel
- Returns:
- the process
-
getNumberOfFactors
public int getNumberOfFactors()
Description copied from interface:ProcessModel
Returns the number of factors m, i.e., the number of independent Brownian drivers.- Specified by:
getNumberOfFactors
in interfaceProcessModel
- Returns:
- The number of factors.
-
getProcessValue
public RandomVariable getProcessValue(int timeIndex, int componentIndex) throws CalculationException
- Parameters:
timeIndex
- The time index of evaluation time (using this models time discretization)componentIndex
- The component of the process vector- Returns:
- Process realization as a random variable
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.- See Also:
Process.getProcessValue(int, int)
-
getMonteCarloWeights
public RandomVariable getMonteCarloWeights(int timeIndex) throws CalculationException
- Parameters:
timeIndex
- The time index of evaluation time (using this models time discretization)- Returns:
- A random variable representing the Monte-Carlo probabilities.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.- See Also:
Process.getMonteCarloWeights(int)
-
getReferenceDate
public LocalDateTime getReferenceDate()
Description copied from interface:ProcessModel
Returns the model's date corresponding to the time discretization's \( t = 0 \). Note: Currently not all models provide a reference date. This will change in future versions.- Specified by:
getReferenceDate
in interfaceProcessModel
- Returns:
- The model's date corresponding to the time discretization's \( t = 0 \).
-
getTimeDiscretization
public final TimeDiscretization getTimeDiscretization()
Get the time discretization of the model (simulation time).- Specified by:
getTimeDiscretization
in interfaceProcessModel
- Returns:
- The time discretization of the model (simulation time).
- See Also:
MonteCarloProcessFromProcessModel.getTimeDiscretization()
-
getTime
public final double getTime(int timeIndex)
Return the simulation time for a given time index.- Parameters:
timeIndex
- Time index- Returns:
- Returns the time for a given time index.
- See Also:
MonteCarloProcessFromProcessModel.getTime(int)
-
getTimeIndex
public final int getTimeIndex(double time)
Return the time index associated for the given simulation time.- Parameters:
time
- A given time.- Returns:
- The time index corresponding to the given time.
- See Also:
MonteCarloProcessFromProcessModel.getTimeIndex(double)
-
-