Package org.ojalgo.random.process
Class GeometricBrownianMotion
- java.lang.Object
-
- org.ojalgo.random.process.AbstractProcess<D>
-
- 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 dW
A 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
Fields Modifier and Type Field Description private static WienerProcess
GENERATOR
private double
myDiffusionFunction
private double
myLocalDrift
-
Constructor Summary
Constructors Modifier Constructor Description private
GeometricBrownianMotion()
GeometricBrownianMotion(double localDrift, double diffusionFunction)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometricBrownianMotion
convert(double convertionFactor)
(package private) double
doStep(double stepSize, double normalisedRandomIncrement)
static GeometricBrownianMotion
estimate(Access1D<?> seriesOfSamples, double samplePeriod)
LogNormal
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
getNormalisedRandomIncrement()
(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 Detail
-
GENERATOR
private static final WienerProcess GENERATOR
-
myDiffusionFunction
private final double myDiffusionFunction
-
myLocalDrift
private final double myLocalDrift
-
-
Method Detail
-
estimate
public static GeometricBrownianMotion estimate(Access1D<?> seriesOfSamples, double samplePeriod)
- 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
public static GeometricBrownianMotion make(double expected, double variance)
Assuming initial value = 1.0 and horizon = 1.0.
-
make
public static GeometricBrownianMotion make(double expected, double variance, double horizon)
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
public GeometricBrownianMotion convert(double convertionFactor)
- Parameters:
convertionFactor
- A step size change factor.
-
getDistribution
public LogNormal getDistribution(double evaluationPoint)
- 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>
-
-