25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.randvar.*;
46 protected double theta, nu, mu, sigma, omega, muPlusOmega;
47 protected double[] mudt;
73 this.vargamma = vargamma;
74 setParams(s0, vargamma.getTheta(), vargamma.getSigma(), vargamma.getNu(), mu);
78 double nextX = vargamma.nextObservation();
79 observationIndex = vargamma.getCurrentObservationIndex();
84 double s = x0 * Math.exp(muPlusOmega * (t[observationIndex] - t[0]) + nextX);
85 path[observationIndex] = s;
92 double[] vgpath = vargamma.generatePath();
93 for (
int i = 0; i < d; i++) {
94 s *= Math.exp(mudt[i] + vgpath[i + 1] - vgpath[i]);
109 for (
int i = 0; i < d; i++) {
110 s *= Math.exp(mudt[i] + vgpath[i + 1] - vgpath[i]);
113 observationIndex = d;
114 observationCounter++;
119 public double getCurrentUpperBound() {
122 int i = observationCounter - 1;
123 double tForIthObserv;
125 tForIthObserv = t[observationIndexFromCounter[i]];
126 if (tForIthObserv <= t[observationCounter] && tForIthObserv > t[j])
133 GammaProcess gpos = ((VarianceGammaProcessDiff) vargamma).getGpos();
134 double[] gposPath = gpos.getPath();
135 double deltaGpos = gposPath[observationIndex] - gposPath[j];
136 double s = path[observationIndex];
138 u = s * Math.exp(deltaGpos);
140 u = s * Math.exp(muPlusOmega * (t[observationIndex] - t[j]) + deltaGpos);
150 observationIndex = 0;
151 observationCounter = 0;
152 vargamma.resetStartProcess();
162 public void setParams(
double s0,
double theta,
double sigma,
double nu,
double mu) {
168 if (observationTimesSet)
216 protected void init() {
218 if (1 <= theta * nu + sigma * sigma * nu / 2.0)
219 throw new IllegalArgumentException(
"theta*nu + sigma*sigma*nu / 2 >= 1");
220 omega = Math.log(1 - theta * nu - sigma * sigma * nu / 2.0) / nu;
221 muPlusOmega = mu + omega;
223 if (observationTimesSet) {
230 mudt =
new double[d];
231 for (
int i = 0; i < d; i++)
232 mudt[i] = muPlusOmega * (t[i + 1] - t[i]);
237 vargamma.setStream(stream);
241 return vargamma.getStream();
GeometricVarianceGammaProcess(double s0, double theta, double sigma, double nu, double mu, RandomStream stream)
Constructs a new GeometricVarianceGammaProcess with parameters.
double[] generatePath()
Generates, returns, and saves the sample path .
GeometricVarianceGammaProcess(double s0, double mu, VarianceGammaProcess vargamma)
Constructs a new GeometricVarianceGammaProcess.
VarianceGammaProcess getVarianceGammaProcess()
Returns a reference to the variance gamma process defined in the constructor.
RandomStream getStream()
Returns the random stream of the underlying generator.
double nextObservation()
Generates and returns the next observation of the stochastic process.
double getSigma()
Returns the value of the parameter .
double getOmega()
Returns the value of the quantity defined in ( omegaEqn ).
double getNu()
Returns the value of the parameter .
double getMu()
Returns the value of the parameter .
void resetStartProcess()
Resets the GeometricaVarianceGammaProcess, but also applies the resetStartProcess method to the Varia...
void setStream(RandomStream stream)
Resets the random stream of the underlying generator to stream.
void setParams(double s0, double theta, double sigma, double nu, double mu)
Sets the parameters , , , and of the process.
double getTheta()
Returns the value of the parameter .
Abstract base class for a stochastic process sampled (or observed) at a finite number of time points...
int[] getArrayMappingCounterToIndex()
Returns a reference to an array that maps an integer to , the index of the observation correspondin...
This class represents a variance gamma (VG) process .
double[] generatePath()
Generates and returns the path.
void setObservationTimes(double t[], int d)
Sets the observation times on the VarianceGammaProcess as usual, but also sets the observation times ...
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...