net.finmath.montecarlo
Class GammaProcess
- java.lang.Object
-
- net.finmath.montecarlo.GammaProcess
-
- All Implemented Interfaces:
- java.io.Serializable, IndependentIncrementsInterface
public class GammaProcess extends java.lang.Object implements IndependentIncrementsInterface, java.io.Serializable
Implementation of a time-discrete n-dimensional Gamma process \( \Gamma = (\Gamma_{1},\ldots,\Gamma_{n}) \), where \( \Gamma_{i} \) is a Gamma process and \( \Gamma_{i} \), \( \Gamma_{j} \) are independent for i not equal j. The increments \( \Delta \Gamma \) are Gamma distributed with shape parametershape * (t-s)for \( t-s = \Delta t \) and scale parameter 1. Here the dimension n is called factors since this Gamma process is used to generate multi-dimensional multi-factor Levy processes and there one might use a different number of factors to generate Levy processes of different dimension. The quintruppel (time discretization, number of factors, number of paths, seed, shape) defines the state of an object of this class, i.e., GammaProcess for which there parameters agree, generate the same random numbers. The class is immutable and thread safe. It uses lazy initialization.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GammaProcess(TimeDiscretizationInterface timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, double shape)Construct a Gamma process with a given shape parameter.GammaProcess(TimeDiscretizationInterface timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, double shape, double scale)Construct a Gamma process with a given shape parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)IndependentIncrementsInterfacegetCloneWithModifiedSeed(int seed)Return a new object implementing BrownianMotionInterface having the same specifications as this object but a different seed for the random number generator.IndependentIncrementsInterfacegetCloneWithModifiedTimeDiscretization(TimeDiscretizationInterface newTimeDiscretization)Return a new object implementing BrownianMotionInterface having the same specifications as this object but a different time discretization.RandomVariableInterfacegetIncrement(int timeIndex, int factor)Return the increment for a given timeIndex.intgetNumberOfFactors()Returns the number of factors.intgetNumberOfPaths()Returns the number of paths.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 this BrownianMotionInterface.intgetSeed()TimeDiscretizationInterfacegetTimeDiscretization()Returns the time discretization used for this set of time-discrete Brownian increments.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
GammaProcess
public GammaProcess(TimeDiscretizationInterface timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, double shape, double scale)
Construct a Gamma process with a given shape parameter.- Parameters:
timeDiscretization- The time discretization used for the Gamma increments.numberOfFactors- Number of factors.numberOfPaths- Number of paths to simulate.seed- The seed of the random number generator.shape- The shape parameter of the Gamma distribution.scale- The scale parameter of the Gamma distribution.
-
GammaProcess
public GammaProcess(TimeDiscretizationInterface timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, double shape)
Construct a Gamma process with a given shape parameter.- Parameters:
timeDiscretization- The time discretization used for the Gamma increments.numberOfFactors- Number of factors.numberOfPaths- Number of paths to simulate.seed- The seed of the random number generator.shape- The shape parameter of the Gamma distribution.
-
-
Method Detail
-
getCloneWithModifiedSeed
public IndependentIncrementsInterface getCloneWithModifiedSeed(int seed)
Description copied from interface:IndependentIncrementsInterfaceReturn a new object implementing BrownianMotionInterface having the same specifications as this object but a different seed for the random number generator. This method is useful if you like to make Monte-Carlo samplings by changing the seed.- Specified by:
getCloneWithModifiedSeedin interfaceIndependentIncrementsInterface- Parameters:
seed- New value for the seed.- Returns:
- New object implementing BrownianMotionInterface.
-
getCloneWithModifiedTimeDiscretization
public IndependentIncrementsInterface getCloneWithModifiedTimeDiscretization(TimeDiscretizationInterface newTimeDiscretization)
Description copied from interface:IndependentIncrementsInterfaceReturn a new object implementing BrownianMotionInterface having the same specifications as this object but a different time discretization.- Specified by:
getCloneWithModifiedTimeDiscretizationin interfaceIndependentIncrementsInterface- Parameters:
newTimeDiscretization- New time discretization- Returns:
- New object implementing BrownianMotionInterface.
-
getIncrement
public RandomVariableInterface getIncrement(int timeIndex, int factor)
Description copied from interface:IndependentIncrementsInterfaceReturn the increment for a given timeIndex. The method returns the random variable Δ Xj(ti) := Xj(ti+1)-X(ti) for the given time index i and a given factor (index) j- Specified by:
getIncrementin interfaceIndependentIncrementsInterface- Parameters:
timeIndex- The time index (corresponding to the this class's time discretization)factor- The index of the factor (independent scalar increment)- Returns:
- The factor (component) of the increments (a random variable)
-
getTimeDiscretization
public TimeDiscretizationInterface getTimeDiscretization()
Description copied from interface:IndependentIncrementsInterfaceReturns the time discretization used for this set of time-discrete Brownian increments.- Specified by:
getTimeDiscretizationin interfaceIndependentIncrementsInterface- Returns:
- The time discretization used for this set of time-discrete Brownian increments.
-
getNumberOfFactors
public int getNumberOfFactors()
Description copied from interface:IndependentIncrementsInterfaceReturns the number of factors.- Specified by:
getNumberOfFactorsin interfaceIndependentIncrementsInterface- Returns:
- The number of factors.
-
getNumberOfPaths
public int getNumberOfPaths()
Description copied from interface:IndependentIncrementsInterfaceReturns the number of paths.- Specified by:
getNumberOfPathsin interfaceIndependentIncrementsInterface- Returns:
- The number of paths.
-
getRandomVariableForConstant
public RandomVariableInterface getRandomVariableForConstant(double value)
Description copied from interface:IndependentIncrementsInterfaceReturns 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 this BrownianMotionInterface.- Specified by:
getRandomVariableForConstantin interfaceIndependentIncrementsInterface- Parameters:
value- The constant value to be used for initialized the random variable.- Returns:
- A new random variable.
-
getSeed
public int getSeed()
- Returns:
- Returns the seed.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG