net.finmath.montecarlo.model
Class AbstractModel
- java.lang.Object
-
- net.finmath.montecarlo.model.AbstractModel
-
- All Implemented Interfaces:
- AbstractModelInterface
- Direct Known Subclasses:
- LIBORMarketModel, LIBORMarketModelStandard, MonteCarloBlackScholesModel, MonteCarloMultiAssetBlackScholesModel
public abstract class AbstractModel extends java.lang.Object implements AbstractModelInterface
This class is an abstract base class to implement a model provided to an AbstractProcess. Manages the delegation to AbstractProcessInterface. For details seeAbstractModelInterface.
-
-
Constructor Summary
Constructors Constructor and Description AbstractModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RandomVariableInterface[]getInitialValue()Returns the initial value of the model.RandomVariableInterfacegetMonteCarloWeights(int timeIndex)intgetNumberOfFactors()Returns the number of factors m, i.e., the number of independent Brownian drivers.AbstractProcessInterfacegetProcess()Get the numerical scheme used to generate the stochastic process.RandomVariableInterfacegetProcessValue(int timeIndex, int componentIndex)doublegetTime(int timeIndex)Return the simulation time for a given time index.TimeDiscretizationInterfacegetTimeDiscretization()Get the time discretization of the model (simulation time).intgetTimeIndex(double time)Return the time index associated for the given simulation time.voidsetProcess(AbstractProcessInterface process)Set the numerical scheme used to generate the stochastic process.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.finmath.montecarlo.model.AbstractModelInterface
applyStateSpaceTransform, getDrift, getFactorLoading, getInitialState, getNumberOfComponents, getNumeraire
-
-
-
-
Method Detail
-
getInitialValue
public RandomVariableInterface[] getInitialValue()
Returns the initial value of the model.- Returns:
- The initial value of the model.
-
setProcess
public void setProcess(AbstractProcessInterface process)
Description copied from interface:AbstractModelInterfaceSet the numerical scheme used to generate the stochastic process. The model needs the numerical scheme to calculate, e.g., the numeraire.- Specified by:
setProcessin interfaceAbstractModelInterface- Parameters:
process- The process.
-
getProcess
public AbstractProcessInterface getProcess()
Description copied from interface:AbstractModelInterfaceGet the numerical scheme used to generate the stochastic process. The model needs the numerical scheme to calculate, e.g., the numeraire.- Specified by:
getProcessin interfaceAbstractModelInterface- Returns:
- the process
-
getNumberOfFactors
public int getNumberOfFactors()
Description copied from interface:AbstractModelInterfaceReturns the number of factors m, i.e., the number of independent Brownian drivers.- Specified by:
getNumberOfFactorsin interfaceAbstractModelInterface- Returns:
- The number of factors.
-
getProcessValue
public RandomVariableInterface 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:
ProcessInterface.getProcessValue(int, int)
-
getMonteCarloWeights
public RandomVariableInterface 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:
ProcessInterface.getMonteCarloWeights(int)
-
getTimeDiscretization
public final TimeDiscretizationInterface getTimeDiscretization()
Get the time discretization of the model (simulation time).- Specified by:
getTimeDiscretizationin interfaceAbstractModelInterface- Returns:
- The time discretization of the model (simulation time).
- See Also:
AbstractProcess.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:
AbstractProcess.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:
AbstractProcess.getTimeIndex(double)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG