25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
48 protected double omegaRiskNeutralCorrection;
49 protected double muGeom;
50 protected double[] muGeomRNdt;
51 protected double[] muGeomRNdT;
53 protected void init() {
55 if (observationTimesSet) {
57 levyProcess.setObservationTimes(t, d);
60 this.observationIndexFromCounter = levyProcess.getArrayMappingCounterToIndex();
62 muGeomRNdt =
new double[d];
63 for (
int i = 0; i < d; i++) {
64 muGeomRNdt[i] = (muGeom - omegaRiskNeutralCorrection) * (t[i + 1] - t[i]);
66 muGeomRNdT =
new double[d + 1];
67 for (
int i = 0; i <= d; i++) {
68 muGeomRNdT[i] = (muGeom - omegaRiskNeutralCorrection) * (t[i] - t[0]);
79 double[] arithmPath = levyProcess.generatePath();
80 for (
int i = 0; i < d; i++) {
81 s *= Math.exp(muGeomRNdt[i] + arithmPath[i + 1] - arithmPath[i]);
95 double levy = levyProcess.nextObservation();
96 observationIndex = levyProcess.getCurrentObservationIndex();
97 path[observationIndex] = x0 * Math.exp(muGeomRNdT[observationIndex] + levy);
98 return path[observationIndex];
107 levyProcess.resetStartProcess();
115 super.setObservationTimes(time, d);
116 levyProcess.setObservationTimes(time, d);
123 return omegaRiskNeutralCorrection;
138 this.muGeom = muGeom;
156 omegaRiskNeutralCorrection = omegaRN;
166 return levyProcess.getStream();
175 levyProcess.setStream(stream);
Abstract class used as a parent class for the exponentiation of a Lévy process :
void resetRiskNeutralCorrection(double omegaRN)
Changes the value of .
double nextObservation()
Returns the next observation.
double getMuGeom()
Returns the geometric drift parameter, which is usually the interest rate, .
void setMuGeom(double muGeom)
Sets the drift parameter (interest rate) of the geometric term.
double[] generatePath()
Generates a path.
void resetStartProcess()
Resets the step counter of the geometric process and the underlying Lévy process to the start value.
RandomStream getStream()
Returns the stream from the underlying Lévy process.
void setStream(RandomStream stream)
Resets the stream in the underlying Lévy process.
double getOmega()
Returns the risk neutral correction.
StochasticProcess getLevyProcess()
Returns the Lévy process.
void setObservationTimes(double[] time, int d)
Sets the observation times on the geometric process and the underlying Lévy process.
Abstract base class for a stochastic process sampled (or observed) at a finite number of time points...
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...