Module net.finmath.lib
Class AbstractShortRateVolatilityModelParametric
java.lang.Object
net.finmath.montecarlo.interestrate.models.covariance.AbstractShortRateVolatilityModel
net.finmath.montecarlo.interestrate.models.covariance.AbstractShortRateVolatilityModelParametric
- All Implemented Interfaces:
Serializable
,ShortRateVolatilityModel
,ShortRateVolatilityModelCalibrateable
,ShortRateVolatilityModelParametric
- Direct Known Subclasses:
ShortRateVolatilityModelPiecewiseConstant
public abstract class AbstractShortRateVolatilityModelParametric
extends AbstractShortRateVolatilityModel
implements ShortRateVolatilityModelParametric, ShortRateVolatilityModelCalibrateable
Base class for parametric volatility models, see also
AbstractShortRateVolatilityModel
.
Parametric models feature a parameter vector which can be inspected
and modified for calibration purposes.
The parameter vector may have zero length, which indicated that the model
is not calibrateable.
This class includes the implementation of a generic calibration algorithm.
If you provide an arbitrary list of calibration products, the class can return
a new instance where the parameters are chosen such that the (weighted) root-mean-square
error of the difference of the value of the calibration products and given target
values is minimized.- Version:
- 1.1
- Author:
- Ruben Duarte
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractShortRateVolatilityModelParametric(TimeDiscretization timeDiscretization)
Constructor consuming time discretization. -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
clone()
getCloneCalibrated(ShortRateModel calibrationModel, CalibrationProduct[] calibrationProducts, Map<String,Object> calibrationParameters)
Performs a generic calibration of the parametric model by trying to match a given vector of calibration product to a given vector of target values using a given vector of weights.getCloneCalibratedLegazy(ShortRateModel calibrationModel, CalibrationProduct[] calibrationProducts, Map<String,Object> calibrationParameters)
Performs a generic calibration of the parametric model by trying to match a given vector of calibration product to a given vector of target values using a given vector of weights.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.abstract RandomVariable[]
Get the parameters of determining this parametric volatility model.double[]
Get the parameters of determining this parametric volatility model.toString()
Methods inherited from class net.finmath.montecarlo.interestrate.models.covariance.AbstractShortRateVolatilityModel
getTimeDiscretization
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.finmath.montecarlo.interestrate.models.covariance.ShortRateVolatilityModel
getMeanReversion, getTimeDiscretization, getVolatility
-
Constructor Details
-
AbstractShortRateVolatilityModelParametric
Constructor consuming time discretization.- Parameters:
timeDiscretization
- The vector of simulation time discretization points.
-
-
Method Details
-
getParameter
Get the parameters of determining this parametric volatility model. The parameters are usually free parameters which may be used in calibration.- Specified by:
getParameter
in interfaceShortRateVolatilityModelParametric
- Returns:
- Parameter vector.
-
clone
-
getParameterAsDouble
public double[] getParameterAsDouble()Description copied from interface:ShortRateVolatilityModelParametric
Get the parameters of determining this parametric volatility model. The parameters are usually free parameters which may be used in calibration.- Specified by:
getParameterAsDouble
in interfaceShortRateVolatilityModelParametric
- Returns:
- Parameter vector.
-
getCloneWithModifiedParameters
public abstract AbstractShortRateVolatilityModelParametric getCloneWithModifiedParameters(double[] parameters)Return 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:
getCloneWithModifiedParameters
in interfaceShortRateVolatilityModelParametric
- Parameters:
parameters
- The new set of parameters.- Returns:
- An instance of AbstractShortRateVolatilityModel with modified parameters.
-
getCloneWithModifiedParameters
public abstract AbstractShortRateVolatilityModelParametric getCloneWithModifiedParameters(RandomVariable[] parameters)Return 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:
getCloneWithModifiedParameters
in interfaceShortRateVolatilityModelParametric
- Parameters:
parameters
- The new set of parameters.- Returns:
- An instance of AbstractShortRateVolatilityModel with modified parameters.
-
getCloneCalibrated
public AbstractShortRateVolatilityModelParametric getCloneCalibrated(ShortRateModel calibrationModel, CalibrationProduct[] calibrationProducts, Map<String,Object> calibrationParameters) throws CalculationExceptionPerforms a generic calibration of the parametric model by trying to match a given vector of calibration product to a given vector of target values using a given vector of weights. Optional calibration parameters may be passed using the map calibrationParameters. The keys are (String
s):brownianMotion
: Under this key an object implementingBrownianMotion
may be provided. If so, this Brownian motion is used to build the valuation model.maxIterations
: Under this key an object of type Integer may be provided specifying the maximum number of iterations.accuracy
: Under this key an object of type Double may be provided specifying the desired accuracy. Note that this is understood in the sense that the solver will stop if the iteration does not improve by more than this number.
- Specified by:
getCloneCalibrated
in interfaceShortRateVolatilityModelCalibrateable
- Parameters:
calibrationModel
- The LIBOR market model to be used for calibrations (specifies forward curve and tenor discretization).calibrationProducts
- The array of calibration products.calibrationParameters
- A map of type Map<String, Object> specifying some (optional) calibration parameters.- Returns:
- A new parametric model of the same type than
this
one, but with calibrated parameters. - Throws:
CalculationException
- Thrown if calibration has failed.
-
getCloneCalibratedLegazy
public AbstractShortRateVolatilityModelParametric getCloneCalibratedLegazy(ShortRateModel calibrationModel, CalibrationProduct[] calibrationProducts, Map<String,Object> calibrationParameters) throws CalculationExceptionPerforms a generic calibration of the parametric model by trying to match a given vector of calibration product to a given vector of target values using a given vector of weights. Optional calibration parameters may be passed using the map calibrationParameters. The keys are (String
s):brownianMotion
: Under this key an object implementingBrownianMotion
may be provided. If so, this Brownian motion is used to build the valuation model.maxIterations
: Under this key an object of type Integer may be provided specifying the maximum number of iterations.accuracy
: Under this key an object of type Double may be provided specifying the desired accuracy. Note that this is understood in the sense that the solver will stop if the iteration does not improve by more than this number.
- Parameters:
calibrationModel
- The LIBOR market model to be used for calibrations (specifies forward curve and tenor discretization).calibrationProducts
- The array of calibration products.calibrationParameters
- A map of type Map<String, Object> specifying some (optional) calibration parameters.- Returns:
- A new parametric model of the same type than
this
one, but with calibrated parameters. - Throws:
CalculationException
- Thrown if calibration has failed.
-
toString
-