25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.randvar.*;
54 protected double mu, sigma;
55 protected double[] mudt;
83 super.setObservationTimes(t, d);
84 bm.setObservationTimes(t, d);
91 double s = x0 * Math.exp(bm.nextObservation());
92 observationIndex = bm.getCurrentObservationIndex();
93 path[observationIndex] = s;
103 for (
int i = 1; i <= d; ++i)
104 path[i] = x0 * Math.exp(bm.getObservation(i));
105 observationCounter = d;
119 observationCounter = 0;
120 bm.resetStartProcess();
129 public void setParams(
double s0,
double mu,
double sigma) {
133 bm.setParams(0.0, mu - 0.5 * sigma * sigma, sigma);
134 if (observationTimesSet)
151 return (bm.gen).getStream();
183 protected void init() {
This class implements methods for generating random variates from the normal distribution .
This class represents a Brownian motion process , sampled at times .
void setStream(RandomStream stream)
Resets the umontreal.ssj.rng.RandomStream for the underlying Brownian motion to stream.
NormalGen getGen()
Returns the umontreal.ssj.randvar.NormalGen used.
GeometricBrownianMotion(double s0, double mu, double sigma, BrownianMotion bm)
Constructs a new GeometricBrownianMotion with parameters , , and , using bm as the underlying Browni...
RandomStream getStream()
Returns the umontreal.ssj.rng.RandomStream for the underlying Brownian motion.
BrownianMotion getBrownianMotion()
Returns a reference to the BrownianMotion object used to generate the process.
double getMu()
Returns the value of .
double[] generatePath()
Generates, returns, and saves the sample path .
double[] generatePath(RandomStream stream)
Same as generatePath(), but first resets the stream to stream.
void setParams(double s0, double mu, double sigma)
Sets the parameters , and of the process.
void setObservationTimes(double[] t, int d)
Sets the observation times of the process to a copy of T, with.
GeometricBrownianMotion(double s0, double mu, double sigma, RandomStream stream)
Same as GeometricBrownianMotion (s0, mu, sigma, new BrownianMotion (0.0, 0.0, 1.0,...
double getSigma()
Returns the value of .
void resetStartProcess()
Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion ob...
double nextObservation()
Generates and returns the next observation of the stochastic process.
Abstract base class for a stochastic process sampled (or observed) at a finite number of time points...
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...