25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.randvar.*;
29import umontreal.ssj.probdist.GammaDist;
30import umontreal.ssj.util.Num;
51 protected static final double EPS = 1.0e-15;
52 protected boolean usesAnti =
false;
56 protected double mu, nu;
57 protected double muOverNu, mu2OverNu;
60 protected double[] mu2dtOverNu;
62 protected void setLarger(
double[] path,
int left,
int mid,
int right) {
72 path[mid] = path[left] * (1.0 + myEps);
73 if (path[mid] >= path[right])
74 path[right] = path[mid] * (1.0 + myEps);
77 protected double setLarger(
double[] path,
int left,
int right) {
87 double s = path[left] * (1.0 + myEps);
89 path[right] = s * (1.0 + myEps);
93 protected double setLarger(
double v) {
98 return v * (1.0 - EPS);
109 this(s0, mu, nu,
new GammaGen(stream, 1.0));
131 stream = Ggen.getStream();
135 double s = path[observationIndex];
137 s += Ggen.nextDouble(stream, mu2dtOverNu[observationIndex], muOverNu);
141 observationCounter = observationIndex;
142 path[observationIndex] = s;
156 double s = path[observationIndex];
158 double previousT = t[observationIndex];
160 observationCounter = observationIndex;
161 t[observationIndex] = nextT;
162 double dt = nextT - previousT;
163 s += Ggen.nextDouble(stream, mu2OverNu * dt, muOverNu);
166 path[observationIndex] = s;
182 for (
int i = 0; i < d; i++) {
184 s += Ggen.nextDouble(stream, mu2dtOverNu[i], muOverNu);
189 observationIndex = d;
190 observationCounter = d;
206 for (
int i = 0; i < d; i++) {
213 observationIndex = d;
214 observationCounter = d;
224 public void setParams(
double s0,
double mu,
double nu) {
228 if (observationTimesSet)
252 this.stream = stream;
253 Ggen.setStream(stream);
263 protected void init() {
268 mu2OverNu = mu * mu / nu;
269 mu2dtOverNu =
new double[d];
270 if (observationTimesSet) {
271 for (
int i = 0; i < d; i++)
272 mu2dtOverNu[i] = mu2OverNu * (t[i + 1] - t[i]);
Extends the class ContinuousDistribution for the gamma distribution tjoh95a (page 337) with shape pa...
double inverseF(double u)
Returns the inverse distribution function .
This class implements random variate generators for the gamma distribution.
double nextObservation()
Generates and returns the next observation of the stochastic process.
GammaProcess(double s0, double mu, double nu, GammaGen Ggen)
Constructs a new GammaProcess with parameters , and initial value .
double[] generatePath(double[] uniform01)
Generates, returns and saves the path .
RandomStream getStream()
Returns the umontreal.ssj.rng.RandomStream stream.
double getMu()
Returns the value of the parameter .
void setParams(double s0, double mu, double nu)
Sets the parameters , and of the process.
double nextObservation(double nextT)
Generates and returns the next observation at time , using the previous observation time defined ea...
GammaProcess(double s0, double mu, double nu, RandomStream stream)
Constructs a new GammaProcess with parameters , and initial value .
void setStream(RandomStream stream)
Resets the umontreal.ssj.rng.RandomStream of the.
double[] generatePath()
Generates, returns and saves the path .
double getNu()
Returns the value of the parameter .
Abstract base class for a stochastic process sampled (or observed) at a finite number of time points...
This class provides various constants and methods to compute numerical quantities such as factorials,...
static final double DBL_EPSILON
Difference between 1.0 and the smallest double greater than 1.0.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...