SSJ
V. 2.6.

umontreal.iro.lecuyer.stochprocess
Class GeometricBrownianMotion

java.lang.Object
  extended by umontreal.iro.lecuyer.stochprocess.StochasticProcess
      extended by umontreal.iro.lecuyer.stochprocess.GeometricBrownianMotion

public class GeometricBrownianMotion
extends StochasticProcess

. Represents a geometric Brownian motion (GBM) process {S(t), t >= 0}, which evolves according to the stochastic differential equation

dS(t) = μS(t)dt + σS(t)dB(t),

where μ and σ are the drift and volatility parameters, and {B(t), t >= 0} is a standard Brownian motion (for which B(t)∼N(0, t)). This process can also be written as the exponential of a Brownian motion:

S(t) = S(0)exp[(μ - σ2/2)t + σtB(t)] = S(0)exp[X(t)],

where X(t) = (μ - σ2/2)t + σtB(t). The GBM process is simulated by simulating the BM process X and taking the exponential. This BM process is stored internally.


Constructor Summary
GeometricBrownianMotion(double s0, double mu, double sigma, BrownianMotion bm)
          Constructs a new GeometricBrownianMotion with parameters μ = mu, σ = sigma, and S(t0) = s0, using bm as the underlying BrownianMotion.
GeometricBrownianMotion(double s0, double mu, double sigma, RandomStream stream)
          Same as GeometricBrownianMotion (s0, mu, sigma, new BrownianMotion (0.0, 0.0, 1.0, stream)).
 
Method Summary
 double[] generatePath()
          Generates, returns, and saves the sample path {X(t0), X(t1),…, X(td)}.
 double[] generatePath(RandomStream stream)
          Same as generatePath(), but first resets the stream to stream.
 BrownianMotion getBrownianMotion()
          Returns a reference to the BrownianMotion object used to generate the process.
 NormalGen getGen()
          Returns the NormalGen used.
 double getMu()
          Returns the value of μ.
 double getSigma()
          Returns the value of σ.
 RandomStream getStream()
          Returns the RandomStream for the underlying Brownian motion.
 double nextObservation()
          Generates and returns the next observation X(tj) of the stochastic process.
 void resetStartProcess()
          Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion object.
 void setObservationTimes(double[] t, int d)
          Sets the observation times of the process to a copy of T, with t0 = T[0] and td = T[d].
 void setParams(double s0, double mu, double sigma)
          Sets the parameters S(t0) = s0, μ = mu and σ = sigma of the process.
 void setStream(RandomStream stream)
          Resets the RandomStream for the underlying Brownian motion to stream.
 
Methods inherited from class umontreal.iro.lecuyer.stochprocess.StochasticProcess
getArrayMappingCounterToIndex, getCurrentObservation, getCurrentObservationIndex, getNbObservationTimes, getObservation, getObservationTimes, getPath, getSubpath, getX0, hasNextObservation, setObservationTimes, setX0
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometricBrownianMotion

public GeometricBrownianMotion(double s0,
                               double mu,
                               double sigma,
                               RandomStream stream)
Same as GeometricBrownianMotion (s0, mu, sigma, new BrownianMotion (0.0, 0.0, 1.0, stream)).


GeometricBrownianMotion

public GeometricBrownianMotion(double s0,
                               double mu,
                               double sigma,
                               BrownianMotion bm)
Constructs a new GeometricBrownianMotion with parameters μ = mu, σ = sigma, and S(t0) = s0, using bm as the underlying BrownianMotion. The parameters of bm are automatically reset to μ - σ2/2 and σ, regardless of the original parameters of bm. The observation times are the same as those of bm. The generation method depends on that of bm (sequential, bridge sampling, PCA, etc.).

Method Detail

setObservationTimes

public void setObservationTimes(double[] t,
                                int d)
Description copied from class: StochasticProcess
Sets the observation times of the process to a copy of T, with t0 = T[0] and td = T[d]. The size of T must be d + 1.

Overrides:
setObservationTimes in class StochasticProcess

nextObservation

public double nextObservation()
Description copied from class: StochasticProcess
Generates and returns the next observation X(tj) of the stochastic process. The processes are usually sampled sequentially, i.e. if the last observation generated was for time tj-1, the next observation returned will be for time tj. In some cases, subclasses extending this abstract class may use non-sequential sampling algorithms (such as bridge sampling). The order of generation of the tj's is then specified by the subclass. All the processes generated using principal components analysis (PCA) do not have this method.

Overrides:
nextObservation in class StochasticProcess

generatePath

public double[] generatePath()
Description copied from class: StochasticProcess
Generates, returns, and saves the sample path {X(t0), X(t1),…, X(td)}. It can then be accessed via getPath, getSubpath, or getObservation. The generation method depends on the process type.

Specified by:
generatePath in class StochasticProcess

generatePath

public double[] generatePath(RandomStream stream)
Description copied from class: StochasticProcess
Same as generatePath(), but first resets the stream to stream.

Overrides:
generatePath in class StochasticProcess

resetStartProcess

public void resetStartProcess()
Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion object.

Overrides:
resetStartProcess in class StochasticProcess

setParams

public void setParams(double s0,
                      double mu,
                      double sigma)
Sets the parameters S(t0) = s0, μ = mu and σ = sigma of the process. Warning: This method will recompute some quantities stored internally, which may be slow if called repeatedly.


setStream

public void setStream(RandomStream stream)
Resets the RandomStream for the underlying Brownian motion to stream.

Specified by:
setStream in class StochasticProcess

getStream

public RandomStream getStream()
Returns the RandomStream for the underlying Brownian motion.

Specified by:
getStream in class StochasticProcess

getMu

public double getMu()
Returns the value of μ.


getSigma

public double getSigma()
Returns the value of σ.


getGen

public NormalGen getGen()
Returns the NormalGen used.


getBrownianMotion

public BrownianMotion getBrownianMotion()
Returns a reference to the BrownianMotion object used to generate the process.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.