net.finmath.montecarlo.interestrate
Class LIBORMarketModelStandard
- java.lang.Object
-
- net.finmath.montecarlo.model.AbstractModel
-
- net.finmath.montecarlo.interestrate.LIBORMarketModelStandard
-
- All Implemented Interfaces:
- LIBORMarketModelInterface, AbstractModelInterface
public class LIBORMarketModelStandard extends AbstractModel implements LIBORMarketModelInterface
Implements a basic LIBOR market model with some drift approximation methods.
The class implements different measure(drift) / numeraire pairs (terminal and spot).
The class specifies a LIBOR market model in its log-normal formulation, that is Lj = exp(Yj) where
dYj = μj dt + λ1,j dW1 + ... + λm,j dWm
seeAbstractModelInterfacefor details on the implemented interface.
The model uses anAbstractLIBORCovarianceModelfor the specification of (λ1,j,...,λm,j) as a covariance model, which may have the ability to calibrate to swaptions.- See Also:
AbstractLIBORCovarianceModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classLIBORMarketModelStandard.CalibrationItemstatic classLIBORMarketModelStandard.Driftapproximationstatic classLIBORMarketModelStandard.Measure
-
Constructor Summary
Constructors Constructor and Description LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, AbstractLIBORCovarianceModel covarianceModel)Creates a LIBOR Market Model for given covariance.LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, AbstractLIBORCovarianceModel covarianceModel, AbstractSwaptionMarketData swaptionMarketData)Creates a LIBOR Market Model using a given covariance model and calibrating this model to given swaption volatility data.LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, DiscountCurveInterface discountCurve, AbstractLIBORCovarianceModel covarianceModel)Creates a LIBOR Market Model for given covariance.LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, DiscountCurveInterface discountCurve, AbstractLIBORCovarianceModel covarianceModel, AbstractSwaptionMarketData swaptionMarketData)Creates a LIBOR Market Model for given covariance.LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, DiscountCurveInterface discountCurve, AbstractLIBORCovarianceModel covarianceModel, LIBORMarketModelStandard.CalibrationItem[] calibrationItems)Creates a LIBOR Market Model for given covariance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RandomVariableInterfaceapplyStateSpaceTransform(int componentIndex, RandomVariableInterface randomVariable)Applied the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.java.lang.Objectclone()AnalyticModelInterfacegetAnalyticModel()Return the associated analytic model, a collection of market date object like discount curve, forward curve and volatility surfaces.LIBORMarketModelStandardgetCloneWithModifiedCovarianceModel(AbstractLIBORCovarianceModel covarianceModel)Create a new object implementing LIBORMarketModelInterface, using the new covariance model.LIBORMarketModelgetCloneWithModifiedData(java.util.Map<java.lang.String,java.lang.Object> dataModified)Create a new object implementing LIBORMarketModelInterface, using the new data.AbstractLIBORCovarianceModelgetCovarianceModel()Return the covariance model.DiscountCurveInterfacegetDiscountCurve()Return the discount curve associated the forwards.RandomVariableInterface[]getDrift(int timeIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)Return the complete vector of the drift for the time index timeIndex, given that current state is realizationAtTimeIndex.LIBORMarketModelStandard.DriftapproximationgetDriftApproximationMethod()RandomVariableInterface[]getFactorLoading(int timeIndex, int componentIndex, RandomVariableInterface[] realizationAtTimeIndex)This method has to be implemented to return the factor loadings, i.e.ForwardCurveInterfacegetForwardRateCurve()Return the initial forward rate curve.RandomVariableInterface[]getInitialState()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()Returns the integrated instantaneous log-forward rate covariance, i.e., \int_0^t_i d log(L_j) d log(L_k) dt.RandomVariableInterfacegetLIBOR(int timeIndex, int liborIndex)doublegetLiborPeriod(int timeIndex)The period start corresponding to a given forward rate discretization index.TimeDiscretizationInterfacegetLiborPeriodDiscretization()The tenor time discretization of the forward rate curve.intgetLiborPeriodIndex(double time)Same as java.util.Arrays.binarySearch(liborPeriodDiscretization,time).LIBORMarketModelStandard.MeasuregetMeasure()intgetNumberOfComponents()This method is just a synonym to getNumberOfLiborsintgetNumberOfLibors()Get the number of LIBORs in the LIBOR discretization.RandomVariableInterfacegetNumeraire(double time)Return the numeraire at a given time.AbstractSwaptionMarketDatagetSwaptionMarketData()Return the swaption market data used for calibration (if any, may be null).voidsetDriftApproximationMethod(LIBORMarketModelStandard.Driftapproximation driftApproximationMethod)voidsetMeasure(LIBORMarketModelStandard.Measure measure)-
Methods inherited from class net.finmath.montecarlo.model.AbstractModel
getInitialValue, getMonteCarloWeights, getNumberOfFactors, getProcess, getProcessValue, getTime, getTimeDiscretization, getTimeIndex, setProcess
-
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
getNumberOfFactors, getProcess, getTimeDiscretization, setProcess
-
-
-
-
Constructor Detail
-
LIBORMarketModelStandard
public LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, AbstractLIBORCovarianceModel covarianceModel)
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.
-
LIBORMarketModelStandard
public LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, DiscountCurveInterface discountCurve, AbstractLIBORCovarianceModel covarianceModel)
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.
-
LIBORMarketModelStandard
public LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, AbstractLIBORCovarianceModel covarianceModel, AbstractSwaptionMarketData 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.
-
LIBORMarketModelStandard
public LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, DiscountCurveInterface discountCurve, AbstractLIBORCovarianceModel covarianceModel, AbstractSwaptionMarketData 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.
-
LIBORMarketModelStandard
public LIBORMarketModelStandard(TimeDiscretizationInterface liborPeriodDiscretization, ForwardCurveInterface forwardRateCurve, DiscountCurveInterface discountCurve, AbstractLIBORCovarianceModel covarianceModel, LIBORMarketModelStandard.CalibrationItem[] calibrationItems) 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.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).- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
-
Method Detail
-
getNumeraire
public RandomVariableInterface getNumeraire(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:
getNumerairein interfaceAbstractModelInterface- Parameters:
time- Time time t for which the numeraire should be returned N(t).- Returns:
- The numeraire at the specified time as
RandomVariable - Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getInitialState
public RandomVariableInterface[] getInitialState()
Description copied from interface:AbstractModelInterfaceReturns 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:
getInitialStatein interfaceAbstractModelInterface- Returns:
- The initial value of the state variable of the process Y(t=0).
-
getDrift
public RandomVariableInterface[] getDrift(int timeIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)
Return the complete vector of the drift for the time index timeIndex, given that current state is realizationAtTimeIndex. Note: The random variable returned is a defensive copy and may be modified. The drift will be zero for rates being already fixed.- Specified by:
getDriftin interfaceAbstractModelInterface- Parameters:
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+1or null of no predictor is available.- Returns:
- The drift vector μ(ti) as
RandomVariable[] - See Also:
The calculation of the drift is consistent with the calculation of the numeraire ingetNumeraire.
-
getFactorLoading
public RandomVariableInterface[] getFactorLoading(int timeIndex, int componentIndex, RandomVariableInterface[] realizationAtTimeIndex)
Description copied from interface:AbstractModelInterfaceThis 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:
getFactorLoadingin interfaceAbstractModelInterface- Parameters:
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 RandomVariableInterface applyStateSpaceTransform(int componentIndex, RandomVariableInterface randomVariable)
Description copied from interface:AbstractModelInterfaceApplied the state space transform fi to the given state random variable such that Yi → fi(Yi) =: Xi.- Specified by:
applyStateSpaceTransformin interfaceAbstractModelInterface- Parameters:
componentIndex- The component index i.randomVariable- The state random variable Yi.- Returns:
- New random variable holding the result of the state space transformation.
-
getDriftApproximationMethod
public LIBORMarketModelStandard.Driftapproximation getDriftApproximationMethod()
- Returns:
- Returns the driftApproximationMethod.
-
getLIBOR
public RandomVariableInterface getLIBOR(int timeIndex, int liborIndex) throws CalculationException
- Specified by:
getLIBORin interfaceLIBORMarketModelInterface- Throws:
CalculationException
-
getNumberOfComponents
public int getNumberOfComponents()
This method is just a synonym to getNumberOfLibors- Specified by:
getNumberOfComponentsin interfaceAbstractModelInterface- Returns:
- The number of components
-
getNumberOfLibors
public int getNumberOfLibors()
Description copied from interface:LIBORMarketModelInterfaceGet the number of LIBORs in the LIBOR discretization.- Specified by:
getNumberOfLiborsin interfaceLIBORMarketModelInterface- Returns:
- The number of LIBORs in the LIBOR discretization
-
getLiborPeriod
public double getLiborPeriod(int timeIndex)
Description copied from interface:LIBORMarketModelInterfaceThe period start corresponding to a given forward rate discretization index.- Specified by:
getLiborPeriodin interfaceLIBORMarketModelInterface- 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:LIBORMarketModelInterfaceSame 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:
getLiborPeriodIndexin interfaceLIBORMarketModelInterface- Parameters:
time- The period start.- Returns:
- The index corresponding to a given time (interpretation is start of period)
-
getLiborPeriodDiscretization
public TimeDiscretizationInterface getLiborPeriodDiscretization()
Description copied from interface:LIBORMarketModelInterfaceThe tenor time discretization of the forward rate curve.- Specified by:
getLiborPeriodDiscretizationin interfaceLIBORMarketModelInterface- Returns:
- The tenor time discretization of the forward rate curve.
-
getMeasure
public LIBORMarketModelStandard.Measure getMeasure()
- Returns:
- Returns the measure.
-
getIntegratedLIBORCovariance
public double[][][] getIntegratedLIBORCovariance()
Description copied from interface:LIBORMarketModelInterfaceReturns the integrated instantaneous log-forward rate covariance, i.e., \int_0^t_i d log(L_j) d log(L_k) dt. The array returned has the parametrization [i][j][k], i.e.,integratedLIBORCovariance[timeIndex][componentIndex1][componentIndex2].- Specified by:
getIntegratedLIBORCovariancein interfaceLIBORMarketModelInterface- Returns:
- The integrated instantaneous log-LIBOR covariance.
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object
-
setDriftApproximationMethod
public void setDriftApproximationMethod(LIBORMarketModelStandard.Driftapproximation driftApproximationMethod)
- Parameters:
driftApproximationMethod- The driftApproximationMethod to set.
-
setMeasure
public void setMeasure(LIBORMarketModelStandard.Measure measure)
- Parameters:
measure- The measure to set.
-
getAnalyticModel
public AnalyticModelInterface getAnalyticModel()
Description copied from interface:LIBORMarketModelInterfaceReturn the associated analytic model, a collection of market date object like discount curve, forward curve and volatility surfaces.- Specified by:
getAnalyticModelin interfaceLIBORMarketModelInterface- Returns:
- The associated analytic model.
-
getDiscountCurve
public DiscountCurveInterface getDiscountCurve()
Description copied from interface:LIBORMarketModelInterfaceReturn the discount curve associated the forwards.- Specified by:
getDiscountCurvein interfaceLIBORMarketModelInterface- Returns:
- the discount curve associated the forwards.
-
getForwardRateCurve
public ForwardCurveInterface getForwardRateCurve()
Description copied from interface:LIBORMarketModelInterfaceReturn the initial forward rate curve.- Specified by:
getForwardRateCurvein interfaceLIBORMarketModelInterface- Returns:
- the forward rate curve
-
getSwaptionMarketData
public AbstractSwaptionMarketData 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 AbstractLIBORCovarianceModel getCovarianceModel()
Description copied from interface:LIBORMarketModelInterfaceReturn the covariance model.- Specified by:
getCovarianceModelin interfaceLIBORMarketModelInterface- Returns:
- The covariance model.
-
getCloneWithModifiedCovarianceModel
public LIBORMarketModelStandard getCloneWithModifiedCovarianceModel(AbstractLIBORCovarianceModel covarianceModel)
Description copied from interface:LIBORMarketModelInterfaceCreate a new object implementing LIBORMarketModelInterface, using the new covariance model.- Specified by:
getCloneWithModifiedCovarianceModelin interfaceLIBORMarketModelInterface- Parameters:
covarianceModel- A covariance model- Returns:
- A new
LIBORMarketModelStandardusing the specified covariance model.
-
getCloneWithModifiedData
public LIBORMarketModel getCloneWithModifiedData(java.util.Map<java.lang.String,java.lang.Object> dataModified) throws CalculationException
Description copied from interface:LIBORMarketModelInterfaceCreate a new object implementing LIBORMarketModelInterface, using the new data.- Specified by:
getCloneWithModifiedDatain interfaceLIBORMarketModelInterface- 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 LIBORMarketModelInterface, using the new data.
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG