Module net.finmath.lib
Class LIBORMarketModelFromCovarianceModel
- java.lang.Object
-
- net.finmath.montecarlo.model.AbstractProcessModel
-
- net.finmath.montecarlo.interestrate.models.LIBORMarketModelFromCovarianceModel
-
- All Implemented Interfaces:
Serializable
,IndependentModelParameterProvider
,LIBORMarketModel
,LIBORModel
,TermStructureModel
,ProcessModel
public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel implements LIBORMarketModel, Serializable
Implements a (generalized) LIBOR market model with generic covariance structure (lognormal, normal, displaced or stochastic volatility) with some drift approximation methods.
In its default case the class specifies a multi-factor LIBOR market model in its log-normal formulation, that is Lj = exp(Yj) where \[ dY_{j} = \mu_{j} dt + \lambda_{1,j} dW_{1} + \ldots + \lambda_{m,j} dW_{m} \]
The model uses anLIBORCovarianceModel
for the specification of (λ1,j,...,λm,j) as a covariance model. SeeProcessModel
for details on the implemented interface
However, the class is more general:- The model may be log-normal or normal specification with a given local volatility.
- The class implements different measure(drift) / numeraire pairs: terminal measure and spot measure.
- The class allows to configure a discounting curve (e.g. for "OIS discounting") using a simple deterministic zero spread. In this case, the numeraire \( N(t) \) is adjusted by \( \exp( \int_0^t -\lambda(\tau) d\tau ) \).
The class specifies a LIBOR market model, that is Lj = f(Yj) where- f is f(x) = exp(x) (default, log-normal LIBOR Market Model) or
-
f is f(x) = x (normal model, used if
property.set("stateSpace","NORMAL"))
dYj = μj dt + λ1,j dW1 + ... + λm,j dWm
seeProcessModel
for details on the implemented interface.
The model uses anAbstractLIBORCovarianceModel
as a covariance model. If the covariance model is of typeAbstractLIBORCovarianceModelParametric
a calibration to swaptions can be performed.
Note that λ may still depend on L, hence generating a log-normal dynamic for L even if the stateSpace property has been set to NORMAL.
The mapproperties
allows to configure the model. The following keys may be used:-
measure
: Possible values:-
SPOT
: Simulate under spot measure. In this case, the single curve numeraire is \( N(T_{i}) = \prod_{j=0}^{i-1} (1 + L(T_{j},T_{j+1};T_{j}) (T_{j+1}-T_{j})) \). -
TERMINAL
: Simulate under terminal measure. In this case, the single curve numeraire is \( N(T_{i}) = P(T_{n};T_{i}) = \prod_{j=i}^{n-1} (1 + L(T_{j},T_{j+1};T_{i}) (T_{j+1}-T_{j}))^{-1} \).
-
-
stateSpace
: Possible values:-
LOGNORMAL
: The state space transform is set to exp, i.e., L = exp(Y). When the covariance model is deterministic, then this is the classical lognormal LIBOR market model. Note that the covariance model may still provide a local volatility function. -
NORMAL
: The state space transform is set to identity, i.e., L = Y. When the covariance model is deterministic, then this is a normal LIBOR market model. Note that the covariance model may still provide a local volatility function.
-
-
liborCap
: An optionalDouble
value applied as a cap to the LIBOR rates. May be used to limit the simulated valued to prevent values attaining POSITIVE_INFINITY and numerical problems. To disable the cap, setliborCap
toDouble.POSITIVE_INFINITY
.
The main task of this class is to calculate the risk-neutral drift and the corresponding numeraire given the covariance model. The calibration of the covariance structure is not part of this class. For the calibration of parametric models of the instantaneous covariance seeAbstractLIBORCovarianceModelParametric.getCloneCalibrated(LIBORMarketModel, CalibrationProduct[], Map)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LIBORMarketModelFromCovarianceModel.Driftapproximation
static class
LIBORMarketModelFromCovarianceModel.InterpolationMethod
static class
LIBORMarketModelFromCovarianceModel.Measure
static class
LIBORMarketModelFromCovarianceModel.StateSpace
-
Constructor Summary
Constructors Constructor Description LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationItems, Map<String,?> properties)
Deprecated.Use LIBORMarketModelFromCovarianceModel.of() instead.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, RandomVariableFactory randomVariableFactory, LIBORCovarianceModel covarianceModel, Map<String,?> properties)
Creates a LIBOR Market Model for given covariance.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, RandomVariableFactory randomVariableFactory, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationProducts, Map<String,?> properties)
Creates a LIBOR Market Model for given covariance.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel)
Creates a LIBOR Market Model for given covariance.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, SwaptionMarketData swaptionMarketData)
Creates a LIBOR Market Model for given covariance.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, SwaptionMarketData swaptionMarketData, Map<String,?> properties)
Creates a LIBOR Market Model for given covariance.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationItems, Map<String,?> properties)
Deprecated.Use LIBORMarketModelFromCovarianceModel.of() instead.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, LIBORCovarianceModel covarianceModel)
Creates a LIBOR Market Model for given covariance.LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, LIBORCovarianceModel covarianceModel, SwaptionMarketData swaptionMarketData)
Creates a LIBOR Market Model using a given covariance model and calibrating this model to given swaption volatility data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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.Object
clone()
AnalyticModel
getAnalyticModel()
Return the associated analytic model, a collection of market date object like discount curve, forward curve and volatility surfaces.LIBORMarketModelFromCovarianceModel
getCloneWithModifiedCovarianceModel(LIBORCovarianceModel covarianceModel)
Create a new object implementing LIBORMarketModel, using the new covariance model.LIBORMarketModelFromCovarianceModel
getCloneWithModifiedData(Map<String,Object> dataModified)
Create a new object implementing LIBORModel, using the new data.LIBORCovarianceModel
getCovarianceModel()
Return the forward rate (LIBOR) covariance model.DiscountCurve
getDiscountCurve()
Return the discount curve associated the forwards.RandomVariable[]
getDrift(MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
Return the complete vector of the drift for the time index timeIndex, given that current state is realizationAtTimeIndex.LIBORMarketModelFromCovarianceModel.Driftapproximation
getDriftApproximationMethod()
RandomVariable[]
getFactorLoading(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)
This method has to be implemented to return the factor loadings, i.e.RandomVariable
getForwardDiscountBond(MonteCarloProcess process, double time, double maturity)
Returns the time \( t \) forward bond derived from the numeraire, i.e., \( P(T;t) = E( \frac{N(t)}{N(T)} \vert \mathcal{F}_{t} ) \).ForwardCurve
getForwardRateCurve()
Return the initial forward rate curve.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.double[][][]
getIntegratedLIBORCovariance(TimeDiscretization simulationTimeDiscretization)
Returns the integrated instantaneous log-forward rate covariance, i.e., \( \int_{0}^{t_i} \mathrm{d} \log(L_{j}) \mathrm{d} \log(L_{k}) \mathrm{d}t \).LIBORMarketModelFromCovarianceModel.InterpolationMethod
getInterpolationMethod()
RandomVariable
getLIBOR(MonteCarloProcess process, double time, double periodStart, double periodEnd)
Returns the time \( t \) forward rate on the models forward curve.RandomVariable
getLIBOR(MonteCarloProcess process, int timeIndex, int liborIndex)
Return the forward rate at a given timeIndex and for a given liborIndex.double
getLiborPeriod(int timeIndex)
The period start corresponding to a given forward rate discretization index.TimeDiscretization
getLiborPeriodDiscretization()
The tenor time discretization of the forward rate curve.int
getLiborPeriodIndex(double time)
Same as java.util.Arrays.binarySearch(liborPeriodDiscretization,time).LIBORMarketModelFromCovarianceModel.Measure
getMeasure()
Map<String,RandomVariable>
getModelParameters()
Returns a map of independent model parameters of this model.int
getNumberOfComponents()
Returns the number of componentsint
getNumberOfFactors()
Returns the number of factors m, i.e., the number of independent Brownian drivers.int
getNumberOfLibors()
Get the number of LIBORs in the LIBOR discretization.RandomVariable
getNumeraire(MonteCarloProcess process, double time)
Return the numeraire at a given time.Map<Double,RandomVariable>
getNumeraireAdjustments()
protected RandomVariable
getNumerairetUnAdjusted(MonteCarloProcess process, double time)
protected RandomVariable
getNumerairetUnAdjustedAtLIBORIndex(MonteCarloProcess process, int liborTimeIndex)
RandomVariable
getRandomVariableForConstant(double value)
Return a random variable initialized with a constant using the models random variable factory.LocalDateTime
getReferenceDate()
Returns the model's date corresponding to the time discretization's \( t = 0 \).SwaptionMarketData
getSwaptionMarketData()
Return the swaption market data used for calibration (if any, may be null).static LIBORMarketModelFromCovarianceModel
of(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, RandomVariableFactory randomVariableFactory, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationProducts, Map<String,?> properties)
Creates a LIBOR Market Model for given covariance with a calibration (if calibration items are given).String
toString()
-
Methods inherited from class net.finmath.montecarlo.model.AbstractProcessModel
getInitialValue
-
-
-
-
Constructor Detail
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, RandomVariableFactory randomVariableFactory, LIBORCovarianceModel covarianceModel, Map<String,?> properties) throws CalculationException
Creates a LIBOR Market Model for given covariance. The mapproperties
allows to configure the model. The following keys may be used:-
measure
: Possible values:-
SPOT
(String
): Simulate under spot measure. -
TERMINAL
(String
): Simulate under terminal measure.
-
-
stateSpace
: Possible values:-
LOGNORMAL
(String
): Simulate L = exp(Y). -
NORMAL
(String
): Simulate L = Y.
-
-
liborCap
: An optionalDouble
value applied as a cap to the LIBOR rates. May be used to limit the simulated valued to prevent values attaining POSITIVE_INFINITY and numerical problems. To disable the cap, setliborCap
toDouble.POSITIVE_INFINITY
. -
calibrationParameters
: Possible values:-
Map<String,Object>
a parameter map with the following key/value pairs:-
accuracy
:Double
specifying the required solver accuracy. -
maxIterations
:Integer
specifying the maximum iterations for the solver.
-
-
- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).analyticModel
- The associated analytic model of this model (containing the associated market data objects like curve).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.randomVariableFactory
- The random variable factory used to create the initial values of the model.covarianceModel
- The covariance model to use.properties
- Key value map specifying properties likemeasure
andstateSpace
.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, RandomVariableFactory randomVariableFactory, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationProducts, Map<String,?> properties) throws CalculationException
Creates a LIBOR Market Model for given covariance.
If calibrationItems in non-empty and the covariance model is a parametric model, the covariance will be replaced by a calibrate version of the same model, i.e., the LIBOR Market Model will be calibrated.
The mapproperties
allows to configure the model. The following keys may be used:-
measure
: Possible values:-
SPOT
(String
): Simulate under spot measure. -
TERMINAL
(String
): Simulate under terminal measure.
-
-
stateSpace
: Possible values:-
LOGNORMAL
(String
): Simulate L = exp(Y). -
NORMAL
(String
): Simulate L = Y.
-
-
liborCap
: An optionalDouble
value applied as a cap to the LIBOR rates. May be used to limit the simulated valued to prevent values attaining POSITIVE_INFINITY and numerical problems. To disable the cap, setliborCap
toDouble.POSITIVE_INFINITY
. -
calibrationParameters
: Possible values:-
Map<String,Object>
a parameter map with the following key/value pairs:-
accuracy
:Double
specifying the required solver accuracy. -
maxIterations
:Integer
specifying the maximum iterations for the solver.
-
-
- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).analyticModel
- The associated analytic model of this model (containing the associated market data objects like curve).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.randomVariableFactory
- The random variable factory used to create the initial values of the model.covarianceModel
- The covariance model to use.calibrationProducts
- The vector of calibration items (a union of a product, target value and weight) for the objective function sum weight(i) * (modelValue(i)-targetValue(i).properties
- Key value map specifying properties likemeasure
andstateSpace
.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
-
LIBORMarketModelFromCovarianceModel
@Deprecated public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationItems, Map<String,?> properties) throws CalculationException
Deprecated.Use LIBORMarketModelFromCovarianceModel.of() instead.Creates a LIBOR Market Model for given covariance.
If calibrationItems in non-empty and the covariance model is a parametric model, the covariance will be replaced by a calibrate version of the same model, i.e., the LIBOR Market Model will be calibrated.
The mapproperties
allows to configure the model. The following keys may be used:-
measure
: Possible values:-
SPOT
(String
): Simulate under spot measure. -
TERMINAL
(String
): Simulate under terminal measure.
-
-
stateSpace
: Possible values:-
LOGNORMAL
(String
): Simulate L = exp(Y). -
NORMAL
(String
): Simulate L = Y.
-
-
liborCap
: An optionalDouble
value applied as a cap to the LIBOR rates. May be used to limit the simulated valued to prevent values attaining POSITIVE_INFINITY and numerical problems. To disable the cap, setliborCap
toDouble.POSITIVE_INFINITY
. -
calibrationParameters
: Possible values:-
Map<String,Object>
a parameter map with the following key/value pairs:-
accuracy
:Double
specifying the required solver accuracy. -
maxIterations
:Integer
specifying the maximum iterations for the solver.
-
-
- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).analyticModel
- The associated analytic model of this model (containing the associated market data objects like curve).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.covarianceModel
- The covariance model to use.calibrationItems
- The vector of calibration items (a union of a product, target value and weight) for the objective function sum weight(i) * (modelValue(i)-targetValue(i).properties
- Key value map specifying properties likemeasure
andstateSpace
.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, LIBORCovarianceModel covarianceModel) throws CalculationException
Creates a LIBOR Market Model for given covariance.- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).forwardRateCurve
- The initial values for the forward rates.covarianceModel
- The covariance model to use.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel) throws CalculationException
Creates a LIBOR Market Model for given covariance.- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.covarianceModel
- The covariance model to use.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, LIBORCovarianceModel covarianceModel, SwaptionMarketData swaptionMarketData) throws CalculationException
Creates a LIBOR Market Model using a given covariance model and calibrating this model to given swaption volatility data.- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).forwardRateCurve
- The initial values for the forward rates.covarianceModel
- The covariance model to use.swaptionMarketData
- The set of swaption values to calibrate to.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, SwaptionMarketData swaptionMarketData) throws CalculationException
Creates a LIBOR Market Model for given covariance.- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.covarianceModel
- The covariance model to use.swaptionMarketData
- The set of swaption values to calibrate to.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
LIBORMarketModelFromCovarianceModel
public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, SwaptionMarketData swaptionMarketData, Map<String,?> properties) throws CalculationException
Creates a LIBOR Market Model for given covariance.- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.covarianceModel
- The covariance model to use.swaptionMarketData
- The set of swaption values to calibrate to.properties
- Key value map specifying properties likemeasure
andstateSpace
.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
LIBORMarketModelFromCovarianceModel
@Deprecated public LIBORMarketModelFromCovarianceModel(TimeDiscretization liborPeriodDiscretization, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationItems, Map<String,?> properties) throws CalculationException
Deprecated.Use LIBORMarketModelFromCovarianceModel.of() instead.Creates a LIBOR Market Model for given covariance.
If calibrationItems in non-empty and the covariance model is a parametric model, the covariance will be replaced by a calibrate version of the same model, i.e., the LIBOR Market Model will be calibrated.
The mapproperties
allows to configure the model. The following keys may be used:-
measure
: Possible values:-
SPOT
(String
): Simulate under spot measure. -
TERMINAL
(String
): Simulate under terminal measure.
-
-
stateSpace
: Possible values:-
LOGNORMAL
(String
): Simulate L = exp(Y). -
NORMAL
(String
): Simulate L = Y.
-
-
calibrationParameters
: Possible values:-
Map<String,Object>
a parameter map with the following key/value pairs:-
accuracy
:Double
specifying the required solver accuracy. -
maxIterations
:Integer
specifying the maximum iterations for the solver.
-
-
- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.covarianceModel
- The covariance model to use.calibrationItems
- The vector of calibration items (a union of a product, target value and weight) for the objective function sum weight(i) * (modelValue(i)-targetValue(i).properties
- Key value map specifying properties likemeasure
andstateSpace
.- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
-
-
Method Detail
-
of
public static LIBORMarketModelFromCovarianceModel of(TimeDiscretization liborPeriodDiscretization, AnalyticModel analyticModel, ForwardCurve forwardRateCurve, DiscountCurve discountCurve, RandomVariableFactory randomVariableFactory, LIBORCovarianceModel covarianceModel, CalibrationProduct[] calibrationProducts, Map<String,?> properties) throws CalculationException
Creates a LIBOR Market Model for given covariance with a calibration (if calibration items are given).
If calibrationItems in non-empty and the covariance model is a parametric model, the covariance will be replaced by a calibrate version of the same model, i.e., the LIBOR Market Model will be calibrated. Note: Calibration is not lazy.
The mapproperties
allows to configure the model. The following keys may be used:-
measure
: Possible values:-
SPOT
(String
): Simulate under spot measure. -
TERMINAL
(String
): Simulate under terminal measure.
-
-
stateSpace
: Possible values:-
LOGNORMAL
(String
): Simulate L = exp(Y). -
NORMAL
(String
): Simulate L = Y.
-
-
liborCap
: An optionalDouble
value applied as a cap to the LIBOR rates. May be used to limit the simulated valued to prevent values attaining POSITIVE_INFINITY and numerical problems. To disable the cap, setliborCap
toDouble.POSITIVE_INFINITY
. -
calibrationParameters
: Possible values:-
Map<String,Object>
a parameter map with the following key/value pairs:-
accuracy
:Double
specifying the required solver accuracy. -
maxIterations
:Integer
specifying the maximum iterations for the solver.
-
-
- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).analyticModel
- The associated analytic model of this model (containing the associated market data objects like curve).forwardRateCurve
- The initial values for the forward rates.discountCurve
- The discount curve to use. This will create an LMM model with a deterministic zero-spread discounting adjustment.randomVariableFactory
- The random variable factory used to create the initial values of the model.covarianceModel
- The covariance model to use.calibrationProducts
- The vector of calibration items (a union of a product, target value and weight) for the objective function sum weight(i) * (modelValue(i)-targetValue(i).properties
- Key value map specifying properties likemeasure
andstateSpace
.- Returns:
- A new instance of LIBORMarketModelFromCovarianceModel, possibly calibrated.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
-
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
- Overrides:
getReferenceDate
in classAbstractProcessModel
- Returns:
- The model's date corresponding to the time discretization's \( t = 0 \).
-
getNumeraire
public RandomVariable getNumeraire(MonteCarloProcess process, double time) throws CalculationException
Return the numeraire at a given time. The numeraire is provided for interpolated points. If requested on points which are not part of the tenor discretization, the numeraire uses a linear interpolation of the reciprocal value. See ISBN 0470047224 for details.- Specified by:
getNumeraire
in interfaceProcessModel
- Parameters:
time
- Time time t for which the numeraire should be returned N(t).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 numeraire at the specified time as
RandomVariable
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getForwardDiscountBond
public RandomVariable getForwardDiscountBond(MonteCarloProcess process, double time, double maturity) throws CalculationException
Description copied from interface:TermStructureModel
Returns the time \( t \) forward bond derived from the numeraire, i.e., \( P(T;t) = E( \frac{N(t)}{N(T)} \vert \mathcal{F}_{t} ) \). Note: It is guaranteed that the random variabble returned by this method is \( \mathcal{F}_{t} ) \)-measurable.- Specified by:
getForwardDiscountBond
in interfaceTermStructureModel
- 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 evaluation time.maturity
- The maturity.- Returns:
- The forward bond P(T;t).
- Throws:
CalculationException
- Thrown if model fails to calculate the random variable.
-
getNumerairetUnAdjusted
protected RandomVariable getNumerairetUnAdjusted(MonteCarloProcess process, double time) throws CalculationException
- Throws:
CalculationException
-
getNumerairetUnAdjustedAtLIBORIndex
protected RandomVariable getNumerairetUnAdjustedAtLIBORIndex(MonteCarloProcess process, int liborTimeIndex) throws CalculationException
- Throws:
CalculationException
-
getNumeraireAdjustments
public Map<Double,RandomVariable> getNumeraireAdjustments()
-
getInitialState
public RandomVariable[] getInitialState(MonteCarloProcess process)
Description copied from interface:ProcessModel
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.- Specified by:
getInitialState
in interfaceProcessModel
- 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).
-
getDrift
public RandomVariable[] getDrift(MonteCarloProcess process, int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
Return the complete vector of the drift for the time index timeIndex, given that current state is realizationAtTimeIndex. The drift will be zero for rates being already fixed. The method currently provides the drift for eitherMeasure.SPOT
orMeasure.TERMINAL
- depending how the model object was constructed. ForMeasure.TERMINAL
the j-th entry of the return value is the random variable \[ \mu_{j}^{\mathbb{Q}^{P(T_{n})}}(t) \ = \ - \mathop{\sum_{l\geq j+1}}_{l\leq n-1} \frac{\delta_{l}}{1+\delta_{l} L_{l}(t)} (\lambda_{j}(t) \cdot \lambda_{l}(t)) \] and forMeasure.SPOT
the j-th entry of the return value is the random variable \[ \mu_{j}^{\mathbb{Q}^{N}}(t) \ = \ \sum_{m(t) < l\leq j} \frac{\delta_{l}}{1+\delta_{l} L_{l}(t)} (\lambda_{j}(t) \cdot \lambda_{l}(t)) \] where \( \lambda_{j} \) is the vector for factor loadings for the j-th component of the stochastic process (that is, the diffusion part is \( \sum_{k=1}^m \lambda_{j,k} \mathrm{d}W_{k} \)). Note: The scalar product of the factor loadings determines the instantaneous covariance. If the model is written in log-coordinates (using exp as a state space transform), we find \(\lambda_{j} \cdot \lambda_{l} = \sum_{k=1}^m \lambda_{j,k} \lambda_{l,k} = \sigma_{j} \sigma_{l} \rho_{j,l} \). If the model is written without a state space transformation (in its orignial coordinates) then \(\lambda_{j} \cdot \lambda_{l} = \sum_{k=1}^m \lambda_{j,k} \lambda_{l,k} = L_{j} L_{l} \sigma_{j} \sigma_{l} \rho_{j,l} \).- Specified by:
getDrift
in interfaceProcessModel
- 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
- Time index i for which the drift should be returned μ(ti).realizationAtTimeIndex
- Time current forward rate vector at time index i which should be used in the calculation.realizationPredictor
- The given realization attimeIndex+1
or null if no predictor is available.- Returns:
- The drift vector μ(ti) as
RandomVariableFromDoubleArray[]
- See Also:
The calculation of the drift is consistent with the calculation of the numeraire in getNumeraire.
,The factor loading \( \lambda_{j,k} \).
-
getFactorLoading
public RandomVariable[] getFactorLoading(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex)
Description copied from interface:ProcessModel
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.- Specified by:
getFactorLoading
in interfaceProcessModel
- 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.
-
applyStateSpaceTransform
public RandomVariable applyStateSpaceTransform(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)
Description copied from interface:ProcessModel
Applies the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.- Specified by:
applyStateSpaceTransform
in interfaceProcessModel
- 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
public RandomVariable applyStateSpaceTransformInverse(MonteCarloProcess process, int timeIndex, int componentIndex, RandomVariable randomVariable)
Description copied from interface:ProcessModel
Applies the inverse state space transform f-1i to the given random variable such that Xi → f-1i(Xi) =: Yi.- Specified by:
applyStateSpaceTransformInverse
in interfaceProcessModel
- 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.
-
getRandomVariableForConstant
public RandomVariable getRandomVariableForConstant(double value)
Description copied from interface:ProcessModel
Return a random variable initialized with a constant using the models random variable factory.- Specified by:
getRandomVariableForConstant
in interfaceProcessModel
- Parameters:
value
- The constant value.- Returns:
- A new random variable initialized with a constant value.
-
getDriftApproximationMethod
public LIBORMarketModelFromCovarianceModel.Driftapproximation getDriftApproximationMethod()
- Returns:
- Returns the driftApproximationMethod.
-
getLIBOR
public RandomVariable getLIBOR(MonteCarloProcess process, double time, double periodStart, double periodEnd) throws CalculationException
Description copied from interface:TermStructureModel
Returns the time \( t \) forward rate on the models forward curve. Note: It is guaranteed that the random variable returned by this method is \( \mathcal{F}_{t} ) \)-measurable.- Specified by:
getLIBOR
in interfaceTermStructureModel
- 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 evaluation time.periodStart
- The period start of the forward rate.periodEnd
- The period end of the forward rate.- Returns:
- The forward rate.
- Throws:
CalculationException
- Thrown if model fails to calculate the random variable.
-
getLIBOR
public RandomVariable getLIBOR(MonteCarloProcess process, int timeIndex, int liborIndex) throws CalculationException
Description copied from interface:LIBORModel
Return the forward rate at a given timeIndex and for a given liborIndex.- Specified by:
getLIBOR
in interfaceLIBORModel
- 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 (associated withProcess.getTimeDiscretization()
.liborIndex
- The forward rate index (associated withLIBORModel.getLiborPeriodDiscretization()
.- Returns:
- The forward rate.
- Throws:
CalculationException
- Thrown if calculation failed.
-
getNumberOfComponents
public int getNumberOfComponents()
Description copied from interface:ProcessModel
Returns the number of components- Specified by:
getNumberOfComponents
in interfaceProcessModel
- Returns:
- The number of components
-
getNumberOfLibors
public int getNumberOfLibors()
Description copied from interface:LIBORModel
Get the number of LIBORs in the LIBOR discretization.- Specified by:
getNumberOfLibors
in interfaceLIBORModel
- Returns:
- The number of LIBORs in the LIBOR discretization
-
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.
-
getLiborPeriod
public double getLiborPeriod(int timeIndex)
Description copied from interface:LIBORModel
The period start corresponding to a given forward rate discretization index.- Specified by:
getLiborPeriod
in interfaceLIBORModel
- Parameters:
timeIndex
- The index corresponding to a given time (interpretation is start of period)- Returns:
- The period start corresponding to a given forward rate discretization index.
-
getLiborPeriodIndex
public int getLiborPeriodIndex(double time)
Description copied from interface:LIBORModel
Same as java.util.Arrays.binarySearch(liborPeriodDiscretization,time). Will return a negative value if the time is not found, but then -index-1 corresponds to the index of the smallest time greater than the given one.- Specified by:
getLiborPeriodIndex
in interfaceLIBORModel
- Parameters:
time
- The period start.- Returns:
- The index corresponding to a given time (interpretation is start of period)
-
getLiborPeriodDiscretization
public TimeDiscretization getLiborPeriodDiscretization()
Description copied from interface:LIBORModel
The tenor time discretization of the forward rate curve.- Specified by:
getLiborPeriodDiscretization
in interfaceLIBORModel
- Returns:
- The tenor time discretization of the forward rate curve.
-
getInterpolationMethod
public LIBORMarketModelFromCovarianceModel.InterpolationMethod getInterpolationMethod()
- Returns:
- Returns the LIBOR rates interpolation method. See
LIBORMarketModelFromCovarianceModel.InterpolationMethod
.
-
getMeasure
public LIBORMarketModelFromCovarianceModel.Measure getMeasure()
- Returns:
- Returns the measure. See
LIBORMarketModelFromCovarianceModel.Measure
.
-
getIntegratedLIBORCovariance
public double[][][] getIntegratedLIBORCovariance(TimeDiscretization simulationTimeDiscretization)
Description copied from interface:LIBORMarketModel
Returns the integrated instantaneous log-forward rate covariance, i.e., \( \int_{0}^{t_i} \mathrm{d} \log(L_{j}) \mathrm{d} \log(L_{k}) \mathrm{d}t \). The array returned has the parametrization [i][j][k], i.e.,integratedLIBORCovariance[timeIndex][componentIndex1][componentIndex2]
.- Specified by:
getIntegratedLIBORCovariance
in interfaceLIBORMarketModel
- Parameters:
simulationTimeDiscretization
- The timeDiscretization used for the integration.- Returns:
- The integrated instantaneous log-LIBOR covariance.
-
getAnalyticModel
public AnalyticModel getAnalyticModel()
Description copied from interface:TermStructureModel
Return the associated analytic model, a collection of market date object like discount curve, forward curve and volatility surfaces.- Specified by:
getAnalyticModel
in interfaceTermStructureModel
- Returns:
- The associated analytic model.
-
getDiscountCurve
public DiscountCurve getDiscountCurve()
Description copied from interface:TermStructureModel
Return the discount curve associated the forwards.- Specified by:
getDiscountCurve
in interfaceTermStructureModel
- Returns:
- the discount curve associated the forwards.
-
getForwardRateCurve
public ForwardCurve getForwardRateCurve()
Description copied from interface:TermStructureModel
Return the initial forward rate curve.- Specified by:
getForwardRateCurve
in interfaceTermStructureModel
- Returns:
- the forward rate curve
-
getSwaptionMarketData
public SwaptionMarketData getSwaptionMarketData()
Return the swaption market data used for calibration (if any, may be null).- Returns:
- The swaption market data used for calibration (if any, may be null).
-
getCovarianceModel
public LIBORCovarianceModel getCovarianceModel()
Description copied from interface:LIBORMarketModel
Return the forward rate (LIBOR) covariance model.- Specified by:
getCovarianceModel
in interfaceLIBORMarketModel
- Returns:
- The covariance model.
-
getCloneWithModifiedCovarianceModel
public LIBORMarketModelFromCovarianceModel getCloneWithModifiedCovarianceModel(LIBORCovarianceModel covarianceModel)
Description copied from interface:LIBORMarketModel
Create a new object implementing LIBORMarketModel, using the new covariance model.- Specified by:
getCloneWithModifiedCovarianceModel
in interfaceLIBORMarketModel
- Parameters:
covarianceModel
- A covariance model- Returns:
- A new
LIBORMarketModelFromCovarianceModel
using the specified covariance model.
-
getCloneWithModifiedData
public LIBORMarketModelFromCovarianceModel getCloneWithModifiedData(Map<String,Object> dataModified) throws CalculationException
Description copied from interface:LIBORModel
Create a new object implementing LIBORModel, using the new data.- Specified by:
getCloneWithModifiedData
in interfaceLIBORModel
- Specified by:
getCloneWithModifiedData
in interfaceProcessModel
- Specified by:
getCloneWithModifiedData
in interfaceTermStructureModel
- Parameters:
dataModified
- A map with values to be used in constructions (keys are identical to parameter names of the constructors).- Returns:
- A new object implementing LIBORModel, using the new data.
- Throws:
CalculationException
- Thrown if the valuation fails, specific cause may be available via thecause()
method.
-
getModelParameters
public Map<String,RandomVariable> getModelParameters()
Description copied from interface:IndependentModelParameterProvider
Returns a map of independent model parameters of this model.- Specified by:
getModelParameters
in interfaceIndependentModelParameterProvider
- Returns:
- Map of independent model parameters of this model.
-
-