net.finmath.montecarlo.hybridassetinterestrate
Class HybridAssetLIBORModelMonteCarloSimulation
- java.lang.Object
-
- net.finmath.montecarlo.hybridassetinterestrate.HybridAssetLIBORModelMonteCarloSimulation
-
- All Implemented Interfaces:
- AssetModelMonteCarloSimulationInterface, HybridAssetLIBORModelMonteCarloSimulationInterface, LIBORModelMonteCarloSimulationInterface, MonteCarloSimulationInterface
public class HybridAssetLIBORModelMonteCarloSimulation extends java.lang.Object implements HybridAssetLIBORModelMonteCarloSimulationInterface
An Equity Hybrid LIBOR Market Model composed of an object implementingLIBORModelMonteCarloSimulationInterfaceproviding the interest rate simulation and the numeraire and an object implementingAssetModelMonteCarloSimulationInterfaceproviding the asset simulation. The interest rate model needs to be in spot measure.
-
-
Constructor Summary
Constructors Constructor and Description HybridAssetLIBORModelMonteCarloSimulation(LIBORModelMonteCarloSimulationInterface liborSimulation, AssetModelMonteCarloSimulationInterface assetSimulation)HybridAssetLIBORModelMonteCarloSimulation(LIBORModelMonteCarloSimulationInterface liborSimulation, AssetModelMonteCarloSimulationInterface assetSimulation, DiscountCurveInterface discountCurve)Create an Equity Hybrid LIBOR Market Model composed of an object implementingLIBORModelMonteCarloSimulationInterfaceproviding the interest rate simulation and the numeraire and an object implementingAssetModelMonteCarloSimulationInterfaceproviding the asset simulation.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description RandomVariableInterfacegetAssetValue(double time, int assetIndex)Returns the random variable representing the asset's value at a given time for a given asset.RandomVariableInterfacegetAssetValue(int timeIndex, int assetIndex)Returns the random variable representing the asset's value at a given time for a given asset.BrownianMotionInterfacegetBrownianMotion()Returns the Brownian motion used to simulate the curve.HybridAssetLIBORModelMonteCarloSimulationgetCloneWithModifiedData(java.util.Map<java.lang.String,java.lang.Object> dataModified)Create a clone of this simulation modifying some of its properties (if any).HybridAssetLIBORModelMonteCarloSimulationgetCloneWithModifiedSeed(int seed)Deprecated.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).intgetNumberOfAssets()Returns the number of asset price processes.intgetNumberOfFactors()intgetNumberOfLibors()intgetNumberOfPaths()Returns the numberOfPaths.RandomVariableInterfacegetNumeraire(double time)Return the numeraire at a given time.RandomVariableInterfacegetNumeraire(int timeIndex)Returns the numeraire associated with the valuation measure used by this model.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
-
HybridAssetLIBORModelMonteCarloSimulation
public HybridAssetLIBORModelMonteCarloSimulation(LIBORModelMonteCarloSimulationInterface liborSimulation, AssetModelMonteCarloSimulationInterface assetSimulation, DiscountCurveInterface discountCurve)
Create an Equity Hybrid LIBOR Market Model composed of an object implementingLIBORModelMonteCarloSimulationInterfaceproviding the interest rate simulation and the numeraire and an object implementingAssetModelMonteCarloSimulationInterfaceproviding the asset simulation. The interest rate model needs to be in spot measure.- Parameters:
liborSimulation- An object implementingLIBORModelMonteCarloSimulationInterfaceproviding the interest rate simulation and the numeraire.assetSimulation- An object implementingAssetModelMonteCarloSimulationInterfaceproviding the asset simulation.discountCurve- An optional object implementingDiscountCurveInterfaceto adjust the numeraire for a deterministic discounting spread.
-
HybridAssetLIBORModelMonteCarloSimulation
public HybridAssetLIBORModelMonteCarloSimulation(LIBORModelMonteCarloSimulationInterface liborSimulation, AssetModelMonteCarloSimulationInterface assetSimulation)
-
-
Method Detail
-
getNumberOfPaths
public int getNumberOfPaths()
Description copied from interface:MonteCarloSimulationInterfaceReturns the numberOfPaths.- Specified by:
getNumberOfPathsin interfaceMonteCarloSimulationInterface- Returns:
- Returns the numberOfPaths.
-
getTimeDiscretization
public TimeDiscretizationInterface getTimeDiscretization()
Description copied from interface:MonteCarloSimulationInterfaceReturns the timeDiscretization.- Specified by:
getTimeDiscretizationin interfaceMonteCarloSimulationInterface- Returns:
- Returns the timeDiscretization.
-
getNumberOfFactors
public int getNumberOfFactors()
- Specified by:
getNumberOfFactorsin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- Returns the numberOfFactors.
-
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.
-
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
-
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.
-
getNumberOfLibors
public int getNumberOfLibors()
- Specified by:
getNumberOfLiborsin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- The number of LIBORs in the LIBOR discretization
-
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.
-
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.
-
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)
-
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.
-
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.
-
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.
-
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.
-
getCloneWithModifiedData
public HybridAssetLIBORModelMonteCarloSimulation 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 interfaceAssetModelMonteCarloSimulationInterface- 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.
-
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.
-
getNumeraire
public RandomVariableInterface getNumeraire(double time) throws CalculationException
Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn the numeraire at a given time.- Specified by:
getNumerairein interfaceAssetModelMonteCarloSimulationInterface- 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 calculation of numeraire fails.
-
getNumeraire
public RandomVariableInterface getNumeraire(int timeIndex) throws CalculationException
Description copied from interface:AssetModelMonteCarloSimulationInterfaceReturns the numeraire associated with the valuation measure used by this model.- Specified by:
getNumerairein interfaceAssetModelMonteCarloSimulationInterface- Parameters:
timeIndex- The time index (associated with this models time discretization).- Returns:
- The numeraire associated with the valuation measure used by this model.
- Throws:
CalculationException- Thrown if calculation of numeraire fails.
-
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.
-
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
-
getCovarianceModel
public AbstractLIBORCovarianceModel getCovarianceModel()
- Specified by:
getCovarianceModelin interfaceLIBORModelMonteCarloSimulationInterface- Returns:
- the covarianceModel
-
getCloneWithModifiedSeed
public HybridAssetLIBORModelMonteCarloSimulation getCloneWithModifiedSeed(int seed)
Deprecated.Description copied from interface:LIBORModelMonteCarloSimulationInterfaceReturn a clone of this model with a modified Brownian motion using a different seed.- Specified by:
getCloneWithModifiedSeedin interfaceAssetModelMonteCarloSimulationInterface- Specified by:
getCloneWithModifiedSeedin interfaceLIBORModelMonteCarloSimulationInterface- Parameters:
seed- The seed- Returns:
- Clone of this object, but having a different seed.
- See Also:
LIBORModelMonteCarloSimulationInterface.getCloneWithModifiedSeed(int)
-
getNumberOfAssets
public int getNumberOfAssets()
Description copied from interface:AssetModelMonteCarloSimulationInterfaceReturns the number of asset price processes.- Specified by:
getNumberOfAssetsin interfaceAssetModelMonteCarloSimulationInterface- Returns:
- The number of asset price processes
-
getAssetValue
public RandomVariableInterface getAssetValue(int timeIndex, int assetIndex) throws CalculationException
Description copied from interface:AssetModelMonteCarloSimulationInterfaceReturns the random variable representing the asset's value at a given time for a given asset.- Specified by:
getAssetValuein interfaceAssetModelMonteCarloSimulationInterface- Parameters:
timeIndex- Index of simulation timeassetIndex- Index of the asset (0 for a single asset model)- Returns:
- The asset process as seen on simulation time
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getAssetValue
public RandomVariableInterface getAssetValue(double time, int assetIndex) throws CalculationException
Description copied from interface:AssetModelMonteCarloSimulationInterfaceReturns the random variable representing the asset's value at a given time for a given asset.- Specified by:
getAssetValuein interfaceAssetModelMonteCarloSimulationInterface- Parameters:
time- Simulation timeassetIndex- Index of the asset (0 for a single asset model)- Returns:
- The asset process as seen on simulation time
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG