25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.randvar.*;
30import umontreal.ssj.util.*;
74 super(s0, mu, nu, Ggen, BSgen);
76 BSgen.setStream(Ggen.getStream());
81 if (bridgeCounter == -1) {
82 s = x0 + Ggen.nextDouble(stream, mu2dTOverNu, muOverNu);
88 int j = bridgeCounter * 3;
89 int oldIndexL = wIndexList[j];
90 int newIndex = wIndexList[j + 1];
91 int oldIndexR = wIndexList[j + 2];
93 double y = BSgen.nextDouble(stream, bMu2dtOverNuL[newIndex]);
95 s = path[oldIndexL] + (path[oldIndexR] - path[oldIndexL]) * y;
96 if (s <= path[oldIndexL])
97 s = setLarger(path, oldIndexL, oldIndexR);
99 observationIndex = newIndex;
101 observationCounter = bridgeCounter + 1;
102 path[observationIndex] = s;
108 if (bridgeCounter == -1) {
110 mu2dTOverNu = mu2OverNu * (t[d] - t[0]);
111 s = x0 + Ggen.nextDouble(stream, mu2dTOverNu, muOverNu);
115 observationIndex = d;
117 int j = bridgeCounter * 3;
118 int oldIndexL = wIndexList[j];
119 int newIndex = wIndexList[j + 1];
120 int oldIndexR = wIndexList[j + 2];
123 bMu2dtOverNuL[newIndex] = mu2OverNu * (t[newIndex] - t[oldIndexL]);
125 double y = BSgen.nextDouble(stream, bMu2dtOverNuL[newIndex]);
127 s = path[oldIndexL] + (path[oldIndexR] - path[oldIndexL]) * y;
128 if (s <= path[oldIndexL])
129 s = setLarger(path, oldIndexL, oldIndexR);
131 observationIndex = newIndex;
133 observationCounter = bridgeCounter + 1;
134 path[observationIndex] = s;
139 int oldIndexL, oldIndexR, newIndex;
141 path[d] = x0 + Ggen.nextDouble(stream, mu2dTOverNu, muOverNu);
142 for (
int j = 0; j < 3 * (d - 1); j += 3) {
143 oldIndexL = wIndexList[j];
144 newIndex = wIndexList[j + 1];
145 oldIndexR = wIndexList[j + 2];
147 double y = BSgen.nextDouble(stream, bMu2dtOverNuL[newIndex]);
149 path[newIndex] = path[oldIndexL] + (path[oldIndexR] - path[oldIndexL]) * y;
150 if (path[newIndex] <= path[oldIndexL])
151 setLarger(path, oldIndexL, newIndex, oldIndexR);
153 observationIndex = d;
154 observationCounter = d;
159 int oldIndexL, oldIndexR, newIndex;
162 for (
int j = 0; j < 3 * (d - 1); j += 3) {
163 oldIndexL = wIndexList[j];
164 newIndex = wIndexList[j + 1];
165 oldIndexR = wIndexList[j + 2];
169 path[newIndex] = path[oldIndexL] + (path[oldIndexR] - path[oldIndexL]) * y;
170 if (path[newIndex] <= path[oldIndexL])
171 setLarger(path, oldIndexL, newIndex, oldIndexR);
173 observationIndex = d;
174 observationCounter = d;
178 protected void init() {
180 if (observationTimesSet) {
192 throw new IllegalArgumentException(
193 "GammaProcessSymmetricalBridge:" +
"Number 'n' of observation times is not a power of 2");
196 boolean equidistant =
true;
197 double macheps = 1.0e-13;
198 double dt = t[1] - t[0];
199 for (
int i = 1; i < d; i++) {
200 if ((t[i + 1] - t[i]) != dt) {
207 if (Math.abs((t[i + 1] - t[i]) - dt) / dt <= macheps)
212 throw new IllegalArgumentException(
213 "GammaProcessSymmetricalBridge:" +
"Observation times of sample paths are not equidistant");
Specializes the class BetaDist to the case of a symmetrical beta distribution over the interval ,...
double inverseF(double u)
Returns the inverse distribution function .
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 with the symmetrical beta distribution with shape par...
This class implements random variate generators for the gamma distribution.
GammaProcessBridge(double s0, double mu, double nu, RandomStream stream)
Constructs a new GammaProcessBridge with parameters , and initial value .
GammaProcessSymmetricalBridge(double s0, double mu, double nu, RandomStream stream)
Constructs a new GammaProcessSymmetricalBridge with parameters.
double[] generatePath(double[] uniform01)
Generates, returns and saves the path .
double[] generatePath()
Generates, returns and saves the path .
double nextObservation()
Generates and returns the next observation of the stochastic process.
double nextObservation(double nextT)
Generates and returns the next observation at time , using the previous observation time defined ea...
GammaProcessSymmetricalBridge(double s0, double mu, double nu, GammaGen Ggen, BetaSymmetricalGen BSgen)
Constructs a new GammaProcessSymmetricalBridge with parameters.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...