25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.randvar.*;
52 protected double mup, mun, nup, nun;
70 this(s0, theta, sigma, nu,
new GammaProcess(0.0, 1.0, 1.0, stream),
new GammaProcess(0.0, 1.0, 1.0, stream));
90 gneg.setStream(gpos.getStream());
96 double s = x0 + gpos.nextObservation() - gneg.nextObservation();
97 observationIndex = gpos.getCurrentObservationIndex();
98 path[observationIndex] = s;
133 double[] pathUP = gpos.generatePath();
134 double[] pathDOWN = gneg.generatePath();
136 for (
int i = 0; i < d; i++) {
137 path[i + 1] = x0 + pathUP[i + 1] - pathDOWN[i + 1];
139 observationIndex = d;
140 observationCounter = d;
157 int dd = uniform01.length;
161 throw new IllegalArgumentException(
"The Array uniform01 must have a even length");
164 double[] QMCpointsUP =
new double[d];
165 double[] QMCpointsDW =
new double[d];
167 for (
int i = 0; i < d; i++) {
168 QMCpointsUP[i] = uniform01[2 * i];
169 QMCpointsDW[i] = uniform01[2 * i + 1];
171 gpos.resetStartProcess();
172 gneg.resetStartProcess();
174 double[] pathUP = gpos.generatePath(QMCpointsUP);
175 double[] pathDOWN = gneg.generatePath(QMCpointsDW);
177 for (
int i = 0; i < d; i++) {
178 path[i + 1] = x0 + pathUP[i + 1] - pathDOWN[i + 1];
180 observationIndex = d;
181 observationCounter = d;
192 observationIndex = 0;
193 observationCounter = 0;
194 gpos.resetStartProcess();
195 gneg.resetStartProcess();
214 protected void init() {
217 mup = 0.5 * (Math.sqrt(theta * theta + 2 * sigma * sigma / nu) + theta);
218 mun = 0.5 * (Math.sqrt(theta * theta + 2 * sigma * sigma / nu) - theta);
219 nup = mup * mup * nu;
220 nun = mun * mun * nu;
221 if (observationTimesSet) {
233 gpos.setObservationTimes(t, d);
234 gneg.setObservationTimes(t, d);
235 super.setObservationTimes(t, d);
244 return gpos.getStream();
253 gpos.setStream(stream);
254 gneg.setStream(stream);
This class represents a gamma process fmad98a (page 82) with mean parameter.
void setParams(double s0, double mu, double nu)
Sets the parameters , and of the process.
void setStream(RandomStream stream)
Sets the umontreal.ssj.rng.RandomStream of the two.
VarianceGammaProcessDiff(double s0, double theta, double sigma, double nu, GammaProcess gpos, GammaProcess gneg)
The parameters of the GammaProcess objects for and are set to those of ( dblGammaParams ) and their...
double[] generatePath(double[] uniform01)
Similar to the usual generatePath(), but here the uniform random numbers used for the simulation must...
double[] generatePath()
Generates, returns and saves the path.
GammaProcess getGpos()
Returns a reference to the GammaProcess object gpos used to generate the component of the process.
void resetStartProcess()
Sets the observation times on the VarianceGammaProcessDiff as usual, but also applies the resetStartP...
VarianceGammaProcessDiff(double s0, double theta, double sigma, double nu, RandomStream stream)
Constructs a new VarianceGammaProcessDiff with parameters.
double nextObservation()
Generates the observation for the next time.
GammaProcess getGneg()
Returns a reference to the GammaProcess object gneg used to generate the component of the process.
void setObservationTimes(double t[], int d)
Sets the observation times on the VarianceGammaProcesDiff as usual, but also sets the observation tim...
RandomStream getStream()
Returns the RandomStream of the process.
void setParams(double s0, double theta, double sigma, double nu)
Sets the parameters s0, theta,.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...