Module net.finmath.lib
Class LIBORCovarianceModelStochasticVolatility
java.lang.Object
net.finmath.montecarlo.interestrate.models.covariance.AbstractLIBORCovarianceModel
net.finmath.montecarlo.interestrate.models.covariance.AbstractLIBORCovarianceModelParametric
net.finmath.montecarlo.interestrate.models.covariance.LIBORCovarianceModelStochasticVolatility
- All Implemented Interfaces:
Serializable,LIBORCovarianceModel,LIBORCovarianceModelCalibrateable
public class LIBORCovarianceModelStochasticVolatility
extends AbstractLIBORCovarianceModelParametric
Simple stochastic volatility model, using a process
\[
d\lambda(t) = \nu \lambda(t) \left( \rho \mathrm{d} W_{1}(t) + \sqrt{1-\rho^{2}} \mathrm{d} W_{2}(t) \right) \text{,}
\]
where \( \lambda(0) = 1 \) to scale all factor loadings \( f_{i} \) returned by a given covariance model.
The model constructed is \( \lambda(t) F(t) \) where \( \lambda(t) \) is
the (Euler discretization of the) above process and \( F = ( f_{1}, \ldots, f_{m} ) \) is the factor loading
from the given covariance model.
The process uses the first two factors of the Brownian motion provided by an object implementing
BrownianMotion. This can be used to generate correlations to
other objects. If you like to reuse a factor of another Brownian motion use a
BrownianMotionView
to delegate \( ( \mathrm{d} W_{1}(t) , \mathrm{d} W_{2}(t) ) \) to a different object.
The parameter of this model is a joint parameter vector, consisting
of the parameter vector of the given base covariance model and
appending the parameters ν and ρ at the end.
If this model is not calibrateable, its parameter vector is that of the
covariance model, i.e., ν and ρ will be not
part of the calibration.
For an illustration of its usage see the associated unit test.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionLIBORCovarianceModelStochasticVolatility(AbstractLIBORCovarianceModelParametric covarianceModel, BrownianMotion brownianMotion, double nu, double rho, boolean isCalibrateable)Create a modification of a givenAbstractLIBORCovarianceModelParametricwith a stochastic volatility scaling.LIBORCovarianceModelStochasticVolatility(AbstractLIBORCovarianceModelParametric covarianceModel, BrownianMotion brownianMotion, RandomVariable nu, RandomVariable rho, boolean isCalibrateable)Create a modification of a givenAbstractLIBORCovarianceModelParametricwith a stochastic volatility scaling. -
Method Summary
Modifier and TypeMethodDescriptionclone()getCloneWithModifiedData(Map<String,Object> dataModified)Returns a clone of this model where the specified properties have been modified.getCloneWithModifiedParameters(double[] parameters)Return an instance of this model using a new set of parameters.getCloneWithModifiedParameters(RandomVariable[] parameters)Return an instance of this model using a new set of parameters.getFactorLoading(int timeIndex, int component, RandomVariable[] realizationAtTimeIndex)Return the factor loading for a given time index and component index.getFactorLoadingPseudoInverse(int timeIndex, int component, int factor, RandomVariable[] realizationAtTimeIndex)Returns the pseudo inverse of the factor matrix.Get the parameters of determining this parametric covariance model.double[]Get the parameters of determining this parametric covariance model.Methods inherited from class net.finmath.montecarlo.interestrate.models.covariance.AbstractLIBORCovarianceModelParametric
getCloneCalibrated, getCloneCalibrated, getCloneCalibratedLegazy, toStringMethods inherited from class net.finmath.montecarlo.interestrate.models.covariance.AbstractLIBORCovarianceModel
getCovariance, getCovariance, getFactorLoading, getFactorLoading, getLiborPeriodDiscretization, getNumberOfFactors, getTimeDiscretizationMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.finmath.montecarlo.interestrate.models.covariance.LIBORCovarianceModel
getCovariance, getCovariance, getFactorLoading, getFactorLoading, getLiborPeriodDiscretization, getNumberOfFactors, getTimeDiscretization
-
Constructor Details
-
LIBORCovarianceModelStochasticVolatility
public LIBORCovarianceModelStochasticVolatility(AbstractLIBORCovarianceModelParametric covarianceModel, BrownianMotion brownianMotion, RandomVariable nu, RandomVariable rho, boolean isCalibrateable)Create a modification of a givenAbstractLIBORCovarianceModelParametricwith a stochastic volatility scaling.- Parameters:
covarianceModel- A given AbstractLIBORCovarianceModelParametric.brownianMotion- An object implementingBrownianMotionwith at least two factors. This class uses the first two factors, but you may useBrownianMotionViewto change this.nu- The initial value for ν, the volatility of the volatility.rho- The initial value for ρ the correlation to the first factor.isCalibrateable- If true, the parameters ν and ρ are parameters. Note that the covariance model (covarianceModel) may have its own parameter calibration settings.
-
LIBORCovarianceModelStochasticVolatility
public LIBORCovarianceModelStochasticVolatility(AbstractLIBORCovarianceModelParametric covarianceModel, BrownianMotion brownianMotion, double nu, double rho, boolean isCalibrateable)Create a modification of a givenAbstractLIBORCovarianceModelParametricwith a stochastic volatility scaling.- Parameters:
covarianceModel- A given AbstractLIBORCovarianceModelParametric.brownianMotion- An object implementingBrownianMotionwith at least two factors. This class uses the first two factors, but you may useBrownianMotionViewto change this.nu- The initial value for ν, the volatility of the volatility.rho- The initial value for ρ the correlation to the first factor.isCalibrateable- If true, the parameters ν and ρ are parameters. Note that the covariance model (covarianceModel) may have its own parameter calibration settings.
-
-
Method Details
-
getParameter
Description copied from class:AbstractLIBORCovarianceModelParametricGet the parameters of determining this parametric covariance model. The parameters are usually free parameters which may be used in calibration.- Overrides:
getParameterin classAbstractLIBORCovarianceModelParametric- Returns:
- Parameter vector.
-
clone
- Specified by:
clonein classAbstractLIBORCovarianceModelParametric
-
getCloneWithModifiedParameters
public AbstractLIBORCovarianceModelParametric getCloneWithModifiedParameters(RandomVariable[] parameters)Description copied from class:AbstractLIBORCovarianceModelParametricReturn an instance of this model using a new set of parameters. Note: To improve performance it is admissible to return the same instance of the object given that the parameters have not changed. Models should be immutable.- Overrides:
getCloneWithModifiedParametersin classAbstractLIBORCovarianceModelParametric- Parameters:
parameters- The new set of parameters.- Returns:
- An instance of AbstractLIBORCovarianceModelParametric with modified parameters.
-
getCloneWithModifiedParameters
Description copied from class:AbstractLIBORCovarianceModelParametricReturn an instance of this model using a new set of parameters. Note: To improve performance it is admissible to return the same instance of the object given that the parameters have not changed. Models should be immutable.- Specified by:
getCloneWithModifiedParametersin classAbstractLIBORCovarianceModelParametric- Parameters:
parameters- The new set of parameters.- Returns:
- An instance of AbstractLIBORCovarianceModelParametric with modified parameters.
-
getParameterAsDouble
public double[] getParameterAsDouble()Description copied from class:AbstractLIBORCovarianceModelParametricGet the parameters of determining this parametric covariance model. The parameters are usually free parameters which may be used in calibration.- Specified by:
getParameterAsDoublein classAbstractLIBORCovarianceModelParametric- Returns:
- Parameter vector.
-
getFactorLoading
public RandomVariable[] getFactorLoading(int timeIndex, int component, RandomVariable[] realizationAtTimeIndex)Description copied from interface:LIBORCovarianceModelReturn the factor loading for a given time index and component index. The factor loading is the vector fi such that the scalar product
fjfk = fj,1fk,1 + ... + fj,mfk,m
is the instantaneous covariance of the component j and k.- Specified by:
getFactorLoadingin interfaceLIBORCovarianceModel- Specified by:
getFactorLoadingin classAbstractLIBORCovarianceModel- Parameters:
timeIndex- The time index at which factor loading is requested.component- The index of the component i.realizationAtTimeIndex- The realization of the stochastic process (may be used to implement local volatility/covariance/correlation models).- Returns:
- The factor loading fi(t).
-
getFactorLoadingPseudoInverse
public RandomVariable getFactorLoadingPseudoInverse(int timeIndex, int component, int factor, RandomVariable[] realizationAtTimeIndex)Description copied from interface:LIBORCovarianceModelReturns the pseudo inverse of the factor matrix.- Specified by:
getFactorLoadingPseudoInversein interfaceLIBORCovarianceModel- Specified by:
getFactorLoadingPseudoInversein classAbstractLIBORCovarianceModel- Parameters:
timeIndex- The time index at which factor loading inverse is requested.component- The index of the component i.factor- The index of the factor j.realizationAtTimeIndex- The realization of the stochastic process (may be used to implement local volatility/covariance/correlation models).- Returns:
- The entry of the pseudo-inverse of the factor loading matrix.
-
getCloneWithModifiedData
public AbstractLIBORCovarianceModelParametric getCloneWithModifiedData(Map<String,Object> dataModified) throws CalculationExceptionDescription copied from interface:LIBORCovarianceModelReturns 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. Furthermore the structure of the covariance model has to match changed data. A change of the time discretizations may requires a change in the parameters but this function will just insert the new time discretization without changing the parameters. An exception may not be thrown.- Specified by:
getCloneWithModifiedDatain interfaceLIBORCovarianceModel- Specified by:
getCloneWithModifiedDatain classAbstractLIBORCovarianceModel- Parameters:
dataModified- Key-value-map of parameters to modify.- Returns:
- A clone of this model (or a new instance of this model if no parameter was modified).
- Throws:
CalculationException- Thrown when the model could not be created.
-