Package org.ojalgo.random.process
Class GeometricBrownianMotion
java.lang.Object
org.ojalgo.random.process.AbstractProcess<LogNormal>
org.ojalgo.random.process.SingleValueBasedProcess<LogNormal>
org.ojalgo.random.process.GeometricBrownianMotion
- All Implemented Interfaces:
Process1D.ComponentProcess<LogNormal>
,RandomProcess<LogNormal>
public final class GeometricBrownianMotion
extends SingleValueBasedProcess<LogNormal>
implements Process1D.ComponentProcess<LogNormal>
Diffusion process defined by a stochastic differential equation:
dX = r X dt + s X dWA stochastic process is said to follow a geometric Brownian motion if it satisfies this stochastic differential equation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ojalgo.random.process.RandomProcess
RandomProcess.SimulationResults
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final WienerProcess
private final double
private final double
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
GeometricBrownianMotion
(double localDrift, double diffusionFunction) -
Method Summary
Modifier and TypeMethodDescriptionconvert
(double convertionFactor) (package private) double
doStep
(double stepSize, double normalisedRandomIncrement) static GeometricBrownianMotion
getDistribution
(double evaluationPoint) private double
getDistributionLocation
(double stepSize, double variance) private double
getDistributionVariance
(double stepSize) (package private) double
getExpected
(double stepSize) Expected future value(package private) double
getLowerConfidenceQuantile
(double stepSize, double confidence) (package private) double
(package private) double
getStandardDeviation
(double stepSize) (package private) double
getUpperConfidenceQuantile
(double stepSize, double confidence) double
getValue()
(package private) double
getVariance
(double stepSize) static GeometricBrownianMotion
make
(double expected, double variance) Assuming initial value = 1.0 and horizon = 1.0.static GeometricBrownianMotion
make
(double expected, double variance, double horizon) Assuming initial value = 1.0.static GeometricBrownianMotion
make
(double initialValue, double expectedFutureValue, double aVariance, double aHorizon) void
setValue
(double newValue) double
step
(double stepSize, double standardGaussianInnovation) Methods inherited from class org.ojalgo.random.process.SingleValueBasedProcess
getCurrentValue, setCurrentValue, simulate
Methods inherited from class org.ojalgo.random.process.AbstractProcess
getExpected, getLowerConfidenceQuantile, getStandardDeviation, getUpperConfidenceQuantile, getVariance, step
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.random.process.RandomProcess
simulate
-
Field Details
-
GENERATOR
-
myDiffusionFunction
private final double myDiffusionFunction -
myLocalDrift
private final double myLocalDrift
-
-
Constructor Details
-
GeometricBrownianMotion
public GeometricBrownianMotion(double localDrift, double diffusionFunction) -
GeometricBrownianMotion
private GeometricBrownianMotion()
-
-
Method Details
-
estimate
- Parameters:
seriesOfSamples
- A series of samples, evenly spaced in time.samplePeriod
- The amount of time (in which ever unit you prefer) between each sample in the series.
-
make
Assuming initial value = 1.0 and horizon = 1.0. -
make
Assuming initial value = 1.0. -
make
public static GeometricBrownianMotion make(double initialValue, double expectedFutureValue, double aVariance, double aHorizon) - Parameters:
initialValue
- The process initial value.expectedFutureValue
- An expected value (sometime in the future).aVariance
- The variance of that future value.aHorizon
- When do you expect that value?
-
convert
- Parameters:
convertionFactor
- A step size change factor.
-
getDistribution
- Specified by:
getDistribution
in interfaceRandomProcess<LogNormal>
- Parameters:
evaluationPoint
- How far into the future?- Returns:
- The distribution for the process value at that future time.
-
getValue
public double getValue()- Specified by:
getValue
in interfaceProcess1D.ComponentProcess<LogNormal>
-
setValue
public void setValue(double newValue) - Specified by:
setValue
in interfaceProcess1D.ComponentProcess<LogNormal>
-
step
public double step(double stepSize, double standardGaussianInnovation) - Specified by:
step
in interfaceProcess1D.ComponentProcess<LogNormal>
-
getDistributionLocation
private double getDistributionLocation(double stepSize, double variance) -
getDistributionVariance
private double getDistributionVariance(double stepSize) -
doStep
double doStep(double stepSize, double normalisedRandomIncrement) - Specified by:
doStep
in classAbstractProcess<LogNormal>
-
getExpected
double getExpected(double stepSize) Expected future value- Specified by:
getExpected
in classAbstractProcess<LogNormal>
-
getLowerConfidenceQuantile
double getLowerConfidenceQuantile(double stepSize, double confidence) - Specified by:
getLowerConfidenceQuantile
in classAbstractProcess<LogNormal>
-
getNormalisedRandomIncrement
double getNormalisedRandomIncrement()- Specified by:
getNormalisedRandomIncrement
in classAbstractProcess<LogNormal>
-
getStandardDeviation
double getStandardDeviation(double stepSize) - Specified by:
getStandardDeviation
in classAbstractProcess<LogNormal>
-
getUpperConfidenceQuantile
double getUpperConfidenceQuantile(double stepSize, double confidence) - Specified by:
getUpperConfidenceQuantile
in classAbstractProcess<LogNormal>
-
getVariance
double getVariance(double stepSize) - Specified by:
getVariance
in classAbstractProcess<LogNormal>
-