Class SimpleLIBORMarketModel
java.lang.Object
net.finmath.montecarlo.templatemethoddesign.LogNormalProcess
net.finmath.montecarlo.interestrate.simple.AbstractLIBORMarketModel
net.finmath.montecarlo.interestrate.simple.SimpleLIBORMarketModel
- All Implemented Interfaces:
Model
,IndependentModelParameterProvider
,LIBORModelMonteCarloSimulationModel
,TermStructureMonteCarloSimulationModel
,MonteCarloSimulationModel
- Direct Known Subclasses:
SimpleLIBORMarketModelWithWMC
Implements a basic LIBOR market model with a some drift approximation methods.
- Since:
- finmath-lib 4.1.0
- Version:
- 0.5
- Author:
- Christian Fries
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class net.finmath.montecarlo.templatemethoddesign.LogNormalProcess
LogNormalProcess.Scheme
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleLIBORMarketModel(TimeDiscretization liborPeriodDiscretization, double[] liborInitialValues, LIBORCovarianceModel covarianceModel, BrownianMotionLazyInit brownianMotion)
Creates a LIBOR Market Model for given covariance.SimpleLIBORMarketModel(TimeDiscretization timeDiscretizationFromArray, TimeDiscretization liborPeriodDiscretization, int numberOfPaths, double[] liborInitialValues, LIBORCovarianceModel covarianceModel)
Creates a LIBOR Market Model for given covariance.SimpleLIBORMarketModel(TimeDiscretization timeDiscretizationFromArray, TimeDiscretization liborPeriodDiscretization, int numberOfPaths, double[] liborInitialValues, LIBORVolatilityModel volatilityModel)
Creates a one factor LIBOR Market Model (correlation = 1).SimpleLIBORMarketModel(TimeDiscretization timeDiscretizationFromArray, TimeDiscretization liborPeriodDiscretization, int numberOfPaths, double[] liborInitialValues, LIBORVolatilityModel volatilityModel, LIBORCorrelationModel correlationModel)
Creates a LIBOR Market Model for given volatility and correlation model. -
Method Summary
Modifier and TypeMethodDescriptiongetCloneWithModifiedData(Map<String,Object> dataModified)
Create a clone of this simulation modifying some of its properties (if any).getCloneWithModifiedSeed(int seed)
Return a clone of this model with a modified Brownian motion using a different seed.getDrift(int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
getDrift(int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)
Get the the drift.getFactorLoading(int timeIndex, int factor, int component, RandomVariable[] realizationAtTimeIndex)
This method should be overwritten and return the factor loading, i.e.getInitialValue(int componentIndex)
protected double[]
getLMMTerminasureDriftEuler(int timeIndex, int componentIndex, RandomVariable[] liborVectorStart)
getModel()
Returns the underlying model.Returns a map of independent model parameters of this model.getNumeraire(int timeIndex)
getRandomVariableForConstant(double value)
Returns a random variable which is initialized to a constant, but has exactly the same number of paths or discretization points as the ones used by thisMonteCarloSimulationModel
.void
setCovarianceModel(LIBORCovarianceModel covarianceModel)
void
setDriftAproximationMethod(SimpleLIBORMarketModel.Driftapproximation driftAproximationMethod)
void
setMeasure(SimpleLIBORMarketModel.Measure measure)
Methods inherited from class net.finmath.montecarlo.interestrate.simple.AbstractLIBORMarketModel
getForwardRate, getLIBOR, getLiborPeriod, getLiborPeriodDiscretization, getLiborPeriodIndex, getLIBORs, getMonteCarloWeights, getNumberOfLibors, getNumeraire, getReferenceDate
Methods inherited from class net.finmath.montecarlo.templatemethoddesign.LogNormalProcess
getBrownianMotion, getMonteCarloWeights, getNumberOfComponents, getNumberOfFactors, getNumberOfPaths, getProcessValue, getProcessValue, getScheme, getTime, getTimeDiscretization, getTimeIndex, setBrownianMotion, setScheme
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.finmath.montecarlo.MonteCarloSimulationModel
getMonteCarloWeights, getNumberOfPaths, getTime, getTimeDiscretization, getTimeIndex
Methods inherited from interface net.finmath.montecarlo.interestrate.TermStructureMonteCarloSimulationModel
getBrownianMotion, getForwardRate, getLIBOR, getLIBOR, getNumberOfFactors, getNumeraire
-
Constructor Details
-
SimpleLIBORMarketModel
public SimpleLIBORMarketModel(TimeDiscretization timeDiscretizationFromArray, TimeDiscretization liborPeriodDiscretization, int numberOfPaths, double[] liborInitialValues, LIBORCovarianceModel covarianceModel)Creates a LIBOR Market Model for given covariance.- Parameters:
timeDiscretizationFromArray
- The time discretization of the process (simulation time).liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).numberOfPaths
- The number of paths.liborInitialValues
- The initial values for the forward rates.covarianceModel
- The covariance model to use.
-
SimpleLIBORMarketModel
public SimpleLIBORMarketModel(TimeDiscretization liborPeriodDiscretization, double[] liborInitialValues, LIBORCovarianceModel covarianceModel, BrownianMotionLazyInit brownianMotion)Creates a LIBOR Market Model for given covariance.- Parameters:
liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).liborInitialValues
- The initial values for the forward rates.covarianceModel
- The covariance model to use.brownianMotion
- The brownian driver for the Monte-Carlo simulation.
-
SimpleLIBORMarketModel
public SimpleLIBORMarketModel(TimeDiscretization timeDiscretizationFromArray, TimeDiscretization liborPeriodDiscretization, int numberOfPaths, double[] liborInitialValues, LIBORVolatilityModel volatilityModel, LIBORCorrelationModel correlationModel)Creates a LIBOR Market Model for given volatility and correlation model.- Parameters:
timeDiscretizationFromArray
- The time discretization of the process (simulation time).liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).numberOfPaths
- The number of paths.liborInitialValues
- The initial values for the forward rates.volatilityModel
- The volatility model to use.correlationModel
- The correlation model to use.
-
SimpleLIBORMarketModel
public SimpleLIBORMarketModel(TimeDiscretization timeDiscretizationFromArray, TimeDiscretization liborPeriodDiscretization, int numberOfPaths, double[] liborInitialValues, LIBORVolatilityModel volatilityModel)Creates a one factor LIBOR Market Model (correlation = 1).- Parameters:
timeDiscretizationFromArray
- The time discretization of the process (simulation time).liborPeriodDiscretization
- The discretization of the interest rate curve into forward rates (tenor structure).numberOfPaths
- The number of paths.liborInitialValues
- The initial values for the forward rates.volatilityModel
- The volatility model to use.
-
-
Method Details
-
getInitialValue
- Specified by:
getInitialValue
in classLogNormalProcess
-
getInitialValue
-
getFactorLoading
public RandomVariable getFactorLoading(int timeIndex, int factor, int component, RandomVariable[] realizationAtTimeIndex)Description copied from class:LogNormalProcess
This method should be overwritten and return the factor loading, i.e. the coeffient λ(i,j) such that
dS(j) = (...) dt + S(j) * (λ(1,j) dW(1) + ... + λ(m,j) dW(m))
in an m-factor model. Here j denotes index of the component of the resulting log-normal process and i denotes the index of the factor.Overwrite this method if you would like to implement a multi factor model.
- Specified by:
getFactorLoading
in classLogNormalProcess
- Parameters:
timeIndex
- The time index of the simulation time discretization.factor
- The factor index.component
- The component index.realizationAtTimeIndex
- The realization at the current time index.- Returns:
- factor loading for given factor and component
-
getDrift
public RandomVariable[] getDrift(int timeIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)Description copied from class:LogNormalProcess
Get the the drift.- Overrides:
getDrift
in classLogNormalProcess
- Parameters:
timeIndex
- The time index (related to the model times discretization).realizationAtTimeIndex
- The given realization at timeIndexrealizationPredictor
- The given realization attimeIndex+1
or null of no predictor is available.- Returns:
- The (average) drift from timeIndex to timeIndex+1
-
getDrift
public RandomVariable getDrift(int timeIndex, int componentIndex, RandomVariable[] realizationAtTimeIndex, RandomVariable[] realizationPredictor)- Specified by:
getDrift
in classLogNormalProcess
-
getDriftAproximationMethod
- Returns:
- Returns the driftAproximationMethod.
-
getLMMTerminasureDriftEuler
protected double[] getLMMTerminasureDriftEuler(int timeIndex, int componentIndex, RandomVariable[] liborVectorStart) -
getMeasure
- Returns:
- Returns the measure.
-
getNumeraire
- Specified by:
getNumeraire
in classAbstractLIBORMarketModel
- Parameters:
timeIndex
- The time indes at which the numeriare is requrested.- Returns:
- The numeraire at the specified time as
RandomVariable
- To dos:
- This method does not interpolate the Numeraire if it is requested outside the liborPeriodDiscretization
-
setDriftAproximationMethod
public void setDriftAproximationMethod(SimpleLIBORMarketModel.Driftapproximation driftAproximationMethod)- Parameters:
driftAproximationMethod
- The driftAproximationMethod to set.
-
setMeasure
- Parameters:
measure
- The measure to set.
-
getCovarianceModel
- Returns:
- the covarianceModel
-
setCovarianceModel
- Parameters:
covarianceModel
- the covarianceModel to set
-
getCloneWithModifiedData
Description copied from interface:MonteCarloSimulationModel
Create a clone of this simulation modifying some of its properties (if any). The properties that should be modified correspond to arguments of constructors. A constructor is then called with where all arguments that are not found in the key value map are being set to this objects values.- Parameters:
dataModified
- The data which should be changed in the new model. This is a key value may, where the key corresponds to the name of a property in one of the objects constructors.- Returns:
- Returns a clone of this object, with some data modified (then it is no longer a clone :-)
-
getCloneWithModifiedSeed
Description copied from interface:TermStructureMonteCarloSimulationModel
Return a clone of this model with a modified Brownian motion using a different seed.- Specified by:
getCloneWithModifiedSeed
in interfaceTermStructureMonteCarloSimulationModel
- Specified by:
getCloneWithModifiedSeed
in classAbstractLIBORMarketModel
- Parameters:
seed
- The seed- Returns:
- Clone of this object, but having a different seed.
-
getModel
Description copied from interface:TermStructureMonteCarloSimulationModel
Returns the underlying model. The model specifies the measure, the initial value, the drift, the factor loadings (covariance model), etc.- Returns:
- The underlying model
-
getProcess
- Returns:
- The implementation of the process
-
getRandomVariableForConstant
Description copied from interface:MonteCarloSimulationModel
Returns a random variable which is initialized to a constant, but has exactly the same number of paths or discretization points as the ones used by thisMonteCarloSimulationModel
.- Parameters:
value
- The constant value to be used for initialized the random variable.- Returns:
- A new random variable.
-
getModelParameters
Description copied from interface:IndependentModelParameterProvider
Returns a map of independent model parameters of this model.- Returns:
- Map of independent model parameters of this model.
-