net.finmath.montecarlo.templatemethoddesign
Class LogNormalProcess
- java.lang.Object
-
- net.finmath.montecarlo.templatemethoddesign.LogNormalProcess
-
- Direct Known Subclasses:
- MonteCarloBlackScholesModel2
public abstract class LogNormalProcess extends java.lang.ObjectThis class is an abstract base class to implement an Euler scheme of a multi-dimensional multi-factor log-normal Ito process. The dimension is callednumberOfComponentshere. The default fornumberOfFactorsis 1.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classLogNormalProcess.Scheme
-
Constructor Summary
Constructors Constructor and Description LogNormalProcess(int numberOfComponents, BrownianMotionInterface brownianMotion)Create a log normal process.LogNormalProcess(TimeDiscretizationInterface timeDiscretization, int numberOfComponents, int numberOfPaths)Create a simulation of log normal process.LogNormalProcess(TimeDiscretizationInterface timeDiscretization, int numberOfComponents, int numberOfFactors, int numberOfPaths, int seed)Create a simulation of log normal process.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description BrownianMotionInterfacegetBrownianMotion()abstract RandomVariableInterfacegetDrift(int timeIndex, int componentIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)RandomVariableInterface[]getDrift(int timeIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)Get the the drift.abstract RandomVariableInterfacegetFactorLoading(int timeIndex, int factor, int component, RandomVariableInterface[] realizationAtTimeIndex)This method should be overwritten and return the factor loading, i.e.abstract RandomVariableInterface[]getInitialValue()RandomVariableInterfacegetMonteCarloWeights(int timeIndex)This method returns the weights of a weighted Monte Carlo method (the probability density).intgetNumberOfComponents()intgetNumberOfFactors()intgetNumberOfPaths()RandomVariableInterface[]getProcessValue(int timeIndex)This method returns the realization of the process at a certain time index.RandomVariableInterfacegetProcessValue(int timeIndex, int componentIndex)This method returns the realization of the process at a certain time index.LogNormalProcess.SchemegetScheme()doublegetTime(int timeIndex)Returns the time for a given simulation time index.TimeDiscretizationInterfacegetTimeDiscretization()intgetTimeIndex(double time)Returns the time index for a given simulation time.voidsetScheme(LogNormalProcess.Scheme scheme)
-
-
-
Constructor Detail
-
LogNormalProcess
public LogNormalProcess(int numberOfComponents, BrownianMotionInterface brownianMotion)Create a log normal process.- Parameters:
numberOfComponents- The number of components (scalar processes).brownianMotion- A Brownian motion
-
LogNormalProcess
public LogNormalProcess(TimeDiscretizationInterface timeDiscretization, int numberOfComponents, int numberOfPaths)
Create a simulation of log normal process.- Parameters:
timeDiscretization- The time discretization of the process.numberOfComponents- The number of components (the dimension of the process).numberOfPaths- The number of path of the simulation.
-
LogNormalProcess
public LogNormalProcess(TimeDiscretizationInterface timeDiscretization, int numberOfComponents, int numberOfFactors, int numberOfPaths, int seed)
Create a simulation of log normal process.- Parameters:
timeDiscretization- The time discretization of the process.numberOfComponents- The number of components (the dimension of the process).numberOfFactors- The number of factors of the process.numberOfPaths- The number of path of the simulation.seed- The seed of the underlying random number generator.
-
-
Method Detail
-
getInitialValue
public abstract RandomVariableInterface[] getInitialValue()
-
getDrift
public abstract RandomVariableInterface getDrift(int timeIndex, int componentIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)
-
getDrift
public RandomVariableInterface[] getDrift(int timeIndex, RandomVariableInterface[] realizationAtTimeIndex, RandomVariableInterface[] realizationPredictor)
Get the the drift.- Parameters:
timeIndex- The time index (related to the model times discretization).realizationAtTimeIndex- The given realization at timeIndexrealizationPredictor- The given realization attimeIndex+1or null of no predictor is available.- Returns:
- The (average) drift from timeIndex to timeIndex+1
-
getFactorLoading
public abstract RandomVariableInterface getFactorLoading(int timeIndex, int factor, int component, RandomVariableInterface[] realizationAtTimeIndex)
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.
- 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
-
getProcessValue
public RandomVariableInterface[] getProcessValue(int timeIndex)
This method returns the realization of the process at a certain time index.- Parameters:
timeIndex- Time index at which the process should be observed- Returns:
- A vector of process realizations (on path)
-
getProcessValue
public RandomVariableInterface getProcessValue(int timeIndex, int componentIndex)
This method returns the realization of the process at a certain time index.- Parameters:
timeIndex- Time index at which the process should be observedcomponentIndex- Component of the process vector- Returns:
- A vector of process realizations (on path)
-
getMonteCarloWeights
public RandomVariableInterface getMonteCarloWeights(int timeIndex)
This method returns the weights of a weighted Monte Carlo method (the probability density).- Parameters:
timeIndex- Time index at which the process should be observed- Returns:
- A vector of positive weights which sums up to one
-
getNumberOfComponents
public int getNumberOfComponents()
- Returns:
- Returns the numberOfComponents.
-
getNumberOfPaths
public int getNumberOfPaths()
- Returns:
- Returns the numberOfPaths.
-
getNumberOfFactors
public int getNumberOfFactors()
- Returns:
- Returns the numberOfFactors.
-
getTimeDiscretization
public TimeDiscretizationInterface getTimeDiscretization()
- Returns:
- Returns the timeDiscretization.
-
getTime
public double getTime(int timeIndex)
Returns the time for a given simulation time index.- Parameters:
timeIndex- Time index- Returns:
- Returns the time for a given time index.
-
getTimeIndex
public int getTimeIndex(double time)
Returns the time index for a given simulation time.- Parameters:
time- A simulation time- Returns:
- Returns the time index for a given time.
-
getBrownianMotion
public BrownianMotionInterface getBrownianMotion()
- Returns:
- Returns the Brownian motion used in the generation of the process
-
getScheme
public LogNormalProcess.Scheme getScheme()
- Returns:
- Returns the scheme.
-
setScheme
public void setScheme(LogNormalProcess.Scheme scheme)
- Parameters:
scheme- The scheme to set.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG