public class BrownianMotion extends Object implements BrownianMotionInterface, Serializable
CorrelatedBrownianMotion.
Here the dimension n is called factors since this Brownian motion is used to
generate multi-dimensional multi-factor Ito processes and there one might
use a different number of factors to generate Ito processes of different
dimension.
The quadruppel (time discretization, number of factors, number of paths, seed)
defines the state of an object of this class, i.e., BrownianMotion for which
there parameters agree, generate the same random numbers.
The class is immutable and thread safe. It uses lazy initialization.| Constructor and Description |
|---|
BrownianMotion(TimeDiscretizationInterface timeDiscretization,
int numberOfFactors,
int numberOfPaths,
int seed)
Construct a Brownian motion.
|
BrownianMotion(TimeDiscretizationInterface timeDiscretization,
int numberOfFactors,
int numberOfPaths,
int seed,
AbstractRandomVariableFactory randomVariableFactory)
Construct a Brownian motion.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
RandomVariableInterface |
getBrownianIncrement(int timeIndex,
int factor)
Return the Brownian increment for a given timeIndex.
|
BrownianMotionInterface |
getCloneWithModifiedSeed(int seed)
Return a new object implementing BrownianMotionInterface
having the same specifications as this object but a different seed
for the random number generator.
|
BrownianMotionInterface |
getCloneWithModifiedTimeDiscretization(TimeDiscretizationInterface newTimeDiscretization)
Return a new object implementing BrownianMotionInterface
having the same specifications as this object but a different
time discretization.
|
RandomVariableInterface |
getIncrement(int timeIndex,
int factor)
Return the increment for a given timeIndex and given factor.
|
int |
getNumberOfFactors()
Returns the number of factors.
|
int |
getNumberOfPaths()
Returns the number of paths.
|
RandomVariableInterface |
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 this BrownianMotionInterface.
|
int |
getSeed() |
TimeDiscretizationInterface |
getTimeDiscretization()
Returns the time discretization used for this set of time-discrete Brownian increments.
|
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetIncrementpublic BrownianMotion(TimeDiscretizationInterface timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, AbstractRandomVariableFactory randomVariableFactory)
timeDiscretization - The time discretization used for the Brownian increments.numberOfFactors - Number of factors.numberOfPaths - Number of paths to simulate.seed - The seed of the random number generator.randomVariableFactory - Factory to be used to create random variable.public BrownianMotion(TimeDiscretizationInterface timeDiscretization, int numberOfFactors, int numberOfPaths, int seed)
timeDiscretization - The time discretization used for the Brownian increments.numberOfFactors - Number of factors.numberOfPaths - Number of paths to simulate.seed - The seed of the random number generator.public BrownianMotionInterface getCloneWithModifiedSeed(int seed)
BrownianMotionInterfacegetCloneWithModifiedSeed in interface BrownianMotionInterfacegetCloneWithModifiedSeed in interface IndependentIncrementsInterfaceseed - New value for the seed.public BrownianMotionInterface getCloneWithModifiedTimeDiscretization(TimeDiscretizationInterface newTimeDiscretization)
BrownianMotionInterfacegetCloneWithModifiedTimeDiscretization in interface BrownianMotionInterfacegetCloneWithModifiedTimeDiscretization in interface IndependentIncrementsInterfacenewTimeDiscretization - New time discretizationpublic RandomVariableInterface getBrownianIncrement(int timeIndex, int factor)
BrownianMotionInterfacegetBrownianIncrement in interface BrownianMotionInterfacetimeIndex - The time index (corresponding to the this class's time discretization).factor - The index of the factor (independent scalar Brownian increment).public TimeDiscretizationInterface getTimeDiscretization()
BrownianMotionInterfacegetTimeDiscretization in interface BrownianMotionInterfacegetTimeDiscretization in interface IndependentIncrementsInterfacepublic int getNumberOfFactors()
BrownianMotionInterfacegetNumberOfFactors in interface BrownianMotionInterfacegetNumberOfFactors in interface IndependentIncrementsInterfacepublic int getNumberOfPaths()
BrownianMotionInterfacegetNumberOfPaths in interface BrownianMotionInterfacegetNumberOfPaths in interface IndependentIncrementsInterfacepublic RandomVariableInterface getRandomVariableForConstant(double value)
BrownianMotionInterfacegetRandomVariableForConstant in interface BrownianMotionInterfacegetRandomVariableForConstant in interface IndependentIncrementsInterfacevalue - The constant value to be used for initialized the random variable.public int getSeed()
public RandomVariableInterface getIncrement(int timeIndex, int factor)
IndependentIncrementsInterfacegetIncrement in interface IndependentIncrementsInterfacetimeIndex - The time index (corresponding to the this class's time discretization)factor - The index of the factor (independent scalar increment)Copyright © 2017. All rights reserved.