25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.randvar.*;
78 super(s0, theta, sigma, nu, gpos, gneg);
88 throw new UnsupportedOperationException(
"Impossible with PCA, use generatePath() instead.");
92 double[] u =
new double[2 * d];
93 for (
int i = 0; i < 2 * d; i++)
99 int dd = uniform01.length;
103 throw new IllegalArgumentException(
"The Array uniform01 must have a even length");
106 double[] QMCpointsUP =
new double[d];
107 double[] QMCpointsDW =
new double[d];
109 for (
int i = 0; i < d; i++) {
110 QMCpointsUP[i] = uniform01[indexEigenUp[i]];
111 QMCpointsDW[i] = uniform01[indexEigenDw[i]];
113 gpos.resetStartProcess();
114 gneg.resetStartProcess();
116 double[] pathUP = gpos.generatePath(QMCpointsUP);
117 double[] pathDOWN = gneg.generatePath(QMCpointsDW);
119 for (
int i = 0; i < d; i++) {
120 path[i + 1] = x0 + pathUP[i + 1] - pathDOWN[i + 1];
122 observationIndex = d;
123 observationCounter = d;
127 protected void init() {
129 if (observationTimesSet) {
132 double[] eigenValUp = ((
GammaProcessPCA) gpos).getBMPCA().getSortedEigenvalues();
133 double[] eigenValDw = ((
GammaProcessPCA) gneg).getBMPCA().getSortedEigenvalues();
134 indexEigenUp =
new int[d];
135 indexEigenDw =
new int[d];
139 for (
int iQMC = 0; iQMC < 2 * d; iQMC++) {
141 indexEigenDw[iDw] = iQMC;
146 indexEigenUp[iUp] = iQMC;
150 if (eigenValUp[iUp] >= eigenValDw[iDw]) {
151 indexEigenUp[iUp] = iQMC;
154 indexEigenDw[iDw] = iQMC;
Represents a gamma process sampled using the principal component analysis (PCA).
double[] generatePath()
Generates, returns and saves the path.
double nextObservation()
This method is not implemented is this class since the path cannot be generated sequentially.
double[] generatePath(double[] uniform01)
Similar to the usual generatePath(), but here the uniform random numbers used for the simulation must...
VarianceGammaProcessDiffPCA(double s0, double theta, double sigma, double nu, RandomStream stream)
Constructs a new VarianceGammaProcessDiffPCA with parameters.
VarianceGammaProcessDiffPCA(double s0, double theta, double sigma, double nu, GammaProcessPCA gpos, GammaProcessPCA gneg)
Constructs a new VarianceGammaProcessDiffPCA with parameters.
VarianceGammaProcessDiff(double s0, double theta, double sigma, double nu, RandomStream stream)
Constructs a new VarianceGammaProcessDiff with parameters.
RandomStream getStream()
Returns the RandomStream of the process.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...
double nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval , using this stream,...