net.finmath.montecarlo.interestrate
Class LIBORModelMonteCarloSimulation
- java.lang.Object
-
- net.finmath.montecarlo.interestrate.LIBORModelMonteCarloSimulation
-
- All Implemented Interfaces:
- LIBORModelMonteCarloSimulationInterface, MonteCarloSimulationInterface
public class LIBORModelMonteCarloSimulation extends java.lang.Object implements LIBORModelMonteCarloSimulationInterface
Implements convenient methods for a LIBOR market model, based on a givenLIBORMarketModelmodel andAbstractLogNormalProcessprocess.
-
-
Constructor Summary
Constructors Constructor and Description LIBORModelMonteCarloSimulation(LIBORMarketModelInterface model)Create a LIBOR Monte-Carlo Simulation from a given LIBORMarketModel.LIBORModelMonteCarloSimulation(LIBORMarketModelInterface model, AbstractProcess process)Create a LIBOR Monte-Carlo Simulation from a given LIBORMarketModel and an AbstractProcess.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description BrownianMotionInterfacegetBrownianMotion()Returns the Brownian motion used to simulate the curve.LIBORModelMonteCarloSimulationInterfacegetCloneWithModifiedData(java.util.Map<java.lang.String,java.lang.Object> dataModified)Create a clone of this simulation modifying some of its properties (if any).LIBORModelMonteCarloSimulationInterfacegetCloneWithModifiedData(java.lang.String entityKey, java.lang.Object dataModified)Create a clone of this simulation modifying one of its properties (if any).java.lang.ObjectgetCloneWithModifiedSeed(int seed)Return a clone of this model with a modified Brownian motion using a different seed.AbstractLIBORCovarianceModelgetCovarianceModel()RandomVariableInterfacegetLIBOR(double time, double periodStart, double periodEnd)Return the forward rate for a given simulation time and a given period start and period end.RandomVariableInterfacegetLIBOR(int timeIndex, int liborIndex)Return the forward rate for a given simulation time index and a given forward rate index.doublegetLiborPeriod(int timeIndex)Returns the period start of the specified forward rate period.TimeDiscretizationInterfacegetLiborPeriodDiscretization()Returns the libor period discretization as time discretization representing start and end dates of periods.intgetLiborPeriodIndex(double time)Same as java.util.Arrays.binarySearch(liborPeriodDiscretization,time).RandomVariableInterface[]getLIBORs(int timeIndex)Return the forward rate curve for a given simulation time index.LIBORMarketModelInterfacegetModel()Returns the underlying model.RandomVariableInterfacegetMonteCarloWeights(double time)This method returns the weights of a weighted Monte Carlo method (the probability density).RandomVariableInterfacegetMonteCarloWeights(int timeIndex)This method returns the weights of a weighted Monte Carlo method (the probability density).intgetNumberOfComponents()intgetNumberOfFactors()intgetNumberOfLibors()intgetNumberOfPaths()Returns the numberOfPaths.RandomVariableInterfacegetNumeraire(double time)Return the numeraire at a given time.AbstractProcessInterfacegetProcess()RandomVariableInterfacegetRandomVariableForConstant(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 thisMonteCarloSimulationInterface.doublegetTime(int timeIndex)Returns the time for a given time index.TimeDiscretizationInterfacegetTimeDiscretization()Returns the timeDiscretization.intgetTimeIndex(double time)Returns the time index for a given time.
-
-
-
Constructor Detail
-
LIBORModelMonteCarloSimulation
public LIBORModelMonteCarloSimulation(LIBORMarketModelInterface model, AbstractProcess process)
Create a LIBOR Monte-Carlo Simulation from a given LIBORMarketModel and an AbstractProcess.- Parameters:
model- The LIBORMarketModel.process- The process.
-
LIBORModelMonteCarloSimulation
public LIBORModelMonteCarloSimulation(LIBORMarketModelInterface model)
Create a LIBOR Monte-Carlo Simulation from a given LIBORMarketModel.- Parameters:
model- The LIBORMarketModel.
-
-
Method Detail
-
getMonteCarloWeights
public RandomVariableInterface getMonteCarloWeights(int timeIndex) throws CalculationException
Description copied from interface:MonteCarloSimulationInterfaceThis method returns the weights of a weighted Monte Carlo method (the probability density).- Specified by:
getMonteCarloWeightsin interfaceMonteCarloSimulationInterface- Parameters:
timeIndex- Time index at which the process should be observed- Returns:
- A vector of positive weights which sums up to one
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getMonteCarloWeights
public RandomVariableInterface getMonteCarloWeights(double time) throws CalculationException
Description copied from interface:MonteCarloSimulationInterfaceThis method returns the weights of a weighted Monte Carlo method (the probability density).- Specified by:
getMonteCarloWeightsin interfaceMonteCarloSimulationInterface- Parameters:
time- Time at which the process should be observed- Returns:
- A vector of positive weights which sums up to one
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getNumberOfFactors
public int getNumberOfFactors()
- Specified by:
getNumberOfFactorsin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- Returns the numberOfFactors.
-
getNumberOfPaths
public int getNumberOfPaths()
Description copied from interface:MonteCarloSimulationInterfaceReturns the numberOfPaths.- Specified by:
getNumberOfPathsin interfaceMonteCarloSimulationInterface- Returns:
- Returns the numberOfPaths.
-
getTime
public double getTime(int timeIndex)
Description copied from interface:MonteCarloSimulationInterfaceReturns the time for a given time index.- Specified by:
getTimein interfaceMonteCarloSimulationInterface- Parameters:
timeIndex- Time index- Returns:
- Returns the time for a given time index.
-
getTimeDiscretization
public TimeDiscretizationInterface getTimeDiscretization()
Description copied from interface:MonteCarloSimulationInterfaceReturns the timeDiscretization.- Specified by:
getTimeDiscretizationin interfaceMonteCarloSimulationInterface- Returns:
- Returns the timeDiscretization.
-
getTimeIndex
public int getTimeIndex(double time)
Description copied from interface:MonteCarloSimulationInterfaceReturns the time index for a given time.- Specified by:
getTimeIndexin interfaceMonteCarloSimulationInterface- Parameters:
time- The time.- Returns:
- Returns the time index for a given time.
-
getRandomVariableForConstant
public RandomVariableInterface getRandomVariableForConstant(double value)
Description copied from interface:MonteCarloSimulationInterfaceReturns 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 thisMonteCarloSimulationInterface.- Specified by:
getRandomVariableForConstantin interfaceMonteCarloSimulationInterface- Parameters:
value- The constant value to be used for initialized the random variable.- Returns:
- A new random variable.
-
getBrownianMotion
public BrownianMotionInterface getBrownianMotion()
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturns the Brownian motion used to simulate the curve.- Specified by:
getBrownianMotionin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- The Brownian motion used to simulate the curve.
-
getLIBOR
public RandomVariableInterface getLIBOR(int timeIndex, int liborIndex) throws CalculationException
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn the forward rate for a given simulation time index and a given forward rate index.- Specified by:
getLIBORin interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
timeIndex- Simulation time index.liborIndex- Tenor time index (index corresponding to the fixing of the forward rate).- Returns:
- The forward rate as a random variable.
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getLIBORs
public RandomVariableInterface[] getLIBORs(int timeIndex) throws CalculationException
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn the forward rate curve for a given simulation time index.- Specified by:
getLIBORsin interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
timeIndex- Simulation time index.- Returns:
- The forward rate curve for a given simulation time index.
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getLIBOR
public RandomVariableInterface getLIBOR(double time, double periodStart, double periodEnd) throws CalculationException
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn the forward rate for a given simulation time and a given period start and period end.- Specified by:
getLIBORin interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
time- Simulation timeperiodStart- Start time of periodperiodEnd- End time of period- Returns:
- The forward rate as a random variable as seen on simulation time for the specified period.
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getLiborPeriod
public double getLiborPeriod(int timeIndex)
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturns the period start of the specified forward rate period.- Specified by:
getLiborPeriodin interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
timeIndex- The index corresponding to a given time (interpretation is start of period)- Returns:
- The period start of the specified forward rate period.
-
getLiborPeriodDiscretization
public TimeDiscretizationInterface getLiborPeriodDiscretization()
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturns the libor period discretization as time discretization representing start and end dates of periods.- Specified by:
getLiborPeriodDiscretizationin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- Returns the libor period discretization
-
getLiborPeriodIndex
public int getLiborPeriodIndex(double time)
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceSame 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 interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
time- The tenor time (fixing of the forward rate) for which the index is requested.- Returns:
- The index corresponding to a given time (interpretation is start of period)
-
getNumberOfComponents
public int getNumberOfComponents()
-
getNumberOfLibors
public int getNumberOfLibors()
- Specified by:
getNumberOfLiborsin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- The number of LIBORs in the LIBOR discretization
-
getNumeraire
public RandomVariableInterface getNumeraire(double time) throws CalculationException
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn the numeraire at a given time.- Specified by:
getNumerairein interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
time- Time at which the process should be observed- Returns:
- The numeraire at the specified time as
RandomVariable - Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getCovarianceModel
public AbstractLIBORCovarianceModel getCovarianceModel()
- Specified by:
getCovarianceModelin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- the covarianceModel
-
getModel
public LIBORMarketModelInterface getModel()
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturns the underlying model. The model specifies the measure, the initial value, the drift, the factor loadings (covariance model), etc.- Specified by:
getModelin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- The underlying model
-
getProcess
public AbstractProcessInterface getProcess()
- Specified by:
getProcessin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- The implementation of the process
-
getCloneWithModifiedSeed
public java.lang.Object getCloneWithModifiedSeed(int seed)
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn a clone of this model with a modified Brownian motion using a different seed.- Specified by:
getCloneWithModifiedSeedin interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
seed- The seed- Returns:
- Clone of this object, but having a different seed.
-
getCloneWithModifiedData
public LIBORModelMonteCarloSimulationInterface getCloneWithModifiedData(java.util.Map<java.lang.String,java.lang.Object> dataModified) throws CalculationException
Description copied from interface:MonteCarloSimulationInterfaceCreate a clone of this simulation modifying some of its properties (if any).- Specified by:
getCloneWithModifiedDatain interfaceMonteCarloSimulationInterface- Parameters:
dataModified- The data which should be changed in the new model- Returns:
- Returns a clone of this model, with some data modified (then it is no longer a clone :-)
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getCloneWithModifiedData
public LIBORModelMonteCarloSimulationInterface getCloneWithModifiedData(java.lang.String entityKey, java.lang.Object dataModified) throws CalculationException
Create a clone of this simulation modifying one of its properties (if any).- Parameters:
entityKey- The entity to modify.dataModified- The data which should be changed in the new model- Returns:
- Returns a clone of this model, where the specified part of the data is modified data (then it is no longer a clone :-)
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG