-
- All Known Subinterfaces:
LIBORMarketModel,LIBORModel,TermStructureModel
- All Known Implementing Classes:
AbstractProcessModel,BachelierModel,BlackScholesModel,BlackScholesModelWithCurves,DisplacedLognomalModel,HestonModel,HullWhiteModel,HullWhiteModelWithConstantCoeff,HullWhiteModelWithDirectSimulation,HullWhiteModelWithShiftExtension,InhomogeneousDisplacedLognomalModel,InhomogenousBachelierModel,LIBORMarketModelFromCovarianceModel,LIBORMarketModelStandard,LIBORMarketModelWithTenorRefinement,MertonModel,MonteCarloMultiAssetBlackScholesModel,MultiAssetBlackScholesModel,VarianceGammaModel
public interface ProcessModelThe interface for a model of a stochastic process X where X(t) = f(t,Y(t)) and
\[ dY_{j} = \mu_{j} dt + \lambda_{1,j} dW_{1} + \ldots + \lambda_{m,j} dW_{m} \]- The value of Y(0) is provided by the method
getInitialState(net.finmath.montecarlo.process.MonteCarloProcess). - The value of μ is provided by the method
getDrift(net.finmath.montecarlo.process.MonteCarloProcess, int, net.finmath.stochastic.RandomVariable[], net.finmath.stochastic.RandomVariable[]). - The value λj is provided by the method
getFactorLoading(net.finmath.montecarlo.process.MonteCarloProcess, int, int, net.finmath.stochastic.RandomVariable[]). - The function f is provided by the method
applyStateSpaceTransform(net.finmath.montecarlo.process.MonteCarloProcess, int, int, net.finmath.stochastic.RandomVariable).
Examples:- The Black Scholes model can be modeled by S = X = Y (i.e. f is the identity) and μ1 = r S and λ1,1 = σ S.
- Alternatively, the Black Scholes model can be modeled by S = X = exp(Y) (i.e. f is exp) and μ1 = r - 0.5 σ σ and λ1,1 = σ.
- Version:
- 2.0
- Author:
- Christian Fries
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RandomVariableapplyStateSpaceTransform(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)Applies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.default RandomVariableapplyStateSpaceTransformInverse(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)Applies the inverse state space transform f-1i to the given random variable such that Xi → f-1i(Xi) =: Yi.ProcessModelgetCloneWithModifiedData(Map<String,Object> dataModified)Returns a clone of this model where the specified properties have been modified.RandomVariable[]getDrift(MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)This method has to be implemented to return the drift, i.e.RandomVariable[]getFactorLoading(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)This method has to be implemented to return the factor loadings, i.e.RandomVariable[]getInitialState(MonteCarloProcess process)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.intgetNumberOfComponents()Returns the number of componentsintgetNumberOfFactors()Returns the number of factors m, i.e., the number of independent Brownian drivers.RandomVariablegetNumeraire(MonteCarloProcess process, double time)Return the numeraire at a given time index.RandomVariablegetRandomVariableForConstant(double value)Return a random variable initialized with a constant using the models random variable factory.LocalDateTimegetReferenceDate()Returns the model's date corresponding to the time discretization's \( t = 0 \).
-
-
-
Method Detail
-
getReferenceDate
LocalDateTime getReferenceDate()
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.- Returns:
- The model's date corresponding to the time discretization's \( t = 0 \).
-
getNumberOfComponents
int getNumberOfComponents()
Returns the number of components- Returns:
- The number of components
-
applyStateSpaceTransform
RandomVariable applyStateSpaceTransform(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)
Applies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.- Parameters:
process- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex- The time index (related to the model times discretization).componentIndex- The component index i.randomVariable- The state random variable Yi.- Returns:
- New random variable holding the result of the state space transformation.
-
applyStateSpaceTransformInverse
default RandomVariable applyStateSpaceTransformInverse(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)
Applies the inverse state space transform f-1i to the given random variable such that Xi → f-1i(Xi) =: Yi.- Parameters:
process- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex- The time index (related to the model times discretization).componentIndex- The component index i.randomVariable- The state random variable Xi.- Returns:
- New random variable holding the result of the state space transformation.
-
getInitialState
RandomVariable[] getInitialState(MonteCarloProcess process)
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.- Parameters:
process- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.- Returns:
- The initial value of the state variable of the process Y(t=0).
-
getNumeraire
RandomVariable getNumeraire(MonteCarloProcess process, double time) throws CalculationException
Return the numeraire at a given time index. Note: The random variable returned is a defensive copy and may be modified.- Parameters:
process- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.time- The time t for which the numeraire N(t) should be returned.- Returns:
- The numeraire at the specified time as
RandomVariable - Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getDrift
RandomVariable[] getDrift(MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
This method has to be implemented to return the drift, i.e. the coefficient vector
μ = (μ1, ..., μn) such that X = f(Y) and
dYj = μj dt + λ1,j dW1 + ... + λm,j dWm
in an m-factor model. Here j denotes index of the component of the resulting process. Since the model is provided only on a time discretization, the method may also (should try to) return the drift as \( \frac{1}{t_{i+1}-t_{i}} \int_{t_{i}}^{t_{i+1}} \mu(\tau) \mathrm{d}\tau \).- Parameters:
process- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex- The time index (related to the model times discretization).realizationAtTimeIndex- The given realization at timeIndexrealizationPredictor- The given realization attimeIndex+1or null if no predictor is available.- Returns:
- The drift or average drift from timeIndex to timeIndex+1, i.e. \( \frac{1}{t_{i+1}-t_{i}} \int_{t_{i}}^{t_{i+1}} \mu(\tau) \mathrm{d}\tau \) (or a suitable approximation).
-
getNumberOfFactors
int getNumberOfFactors()
Returns the number of factors m, i.e., the number of independent Brownian drivers.- Returns:
- The number of factors.
-
getFactorLoading
RandomVariable[] getFactorLoading(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)
This method has to be implemented to return the factor loadings, i.e. the coefficient vector
λj = (λ1,j, ..., λm,j) such that X = f(Y) and
dYj = μj dt + λ1,j dW1 + ... + λm,j dWm
in an m-factor model. Here j denotes index of the component of the resulting process.- Parameters:
process- The discretization process generating this model. The process provides call backs for TimeDiscretization and allows calls to getProcessValue for timeIndices less or equal the given one.timeIndex- The time index (related to the model times discretization).componentIndex- 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).- Returns:
- The factor loading for given factor and component.
-
getRandomVariableForConstant
RandomVariable getRandomVariableForConstant(double value)
Return a random variable initialized with a constant using the models random variable factory.- Parameters:
value- The constant value.- Returns:
- A new random variable initialized with a constant value.
-
getCloneWithModifiedData
ProcessModel getCloneWithModifiedData(Map<String,Object> dataModified) throws CalculationException
Returns a clone of this model where the specified properties have been modified. Note that there is no guarantee that a model reacts on a specification of a properties in the parameter mapdataModified. If data is provided which is ignored by the model no exception may be thrown.- Parameters:
dataModified- Key-value-map of parameters to modify.- Returns:
- A clone of this model (or this model if no parameter was modified).
- Throws:
CalculationException- Thrown when the model could not be created.
-
-