25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.RandomStream;
54 protected boolean observationTimesSet =
false;
57 protected double x0 = 0.0;
59 protected int observationIndex = 0;
60 protected int observationCounter = 0;
64 protected double[] path;
66 protected int[] observationIndexFromCounter;
75 throw new IllegalArgumentException(
"Number of observation times d <= 0");
77 observationTimesSet =
true;
80 this.t =
new double[d + 1];
81 System.arraycopy(T, 0, this.t, 0, d + 1);
84 for (
int i = 0; i < d; i++) {
86 throw new IllegalArgumentException(
"Observation times T[] are not time-ordered");
92 path =
new double[d + 1];
105 t =
new double[d + 1];
106 for (
int i = 0; i <= d; i++)
164 public void getSubpath(
double[] subpath,
int[] pathIndices) {
165 for (
int j = 0; j < subpath.length; j++) {
166 subpath[j] = path[pathIndices[j]];
186 observationIndex = 0;
187 observationCounter = 0;
196 if (observationCounter < d)
215 throw new UnsupportedOperationException(
"Method not defined in this class");
224 return observationIndex;
231 return path[observationIndex];
264 protected void init() {
265 if (observationTimesSet)
284 return observationIndexFromCounter;
Abstract base class for a stochastic process sampled (or observed) at a finite number of time points...
double getCurrentObservation()
Returns the value of the last generated observation .
double getObservation(int j)
Returns from the current sample path.
void setObservationTimes(double delta, int d)
Sets equidistant observation times at , for.
void setObservationTimes(double[] T, int d)
Sets the observation times of the process to a copy of T, with.
abstract RandomStream getStream()
Returns the random stream of the underlying generator.
int[] getArrayMappingCounterToIndex()
Returns a reference to an array that maps an integer to , the index of the observation correspondin...
double getX0()
Returns the initial value for this process.
double[] getObservationTimes()
Returns a reference to the array that contains the observation times.
void setX0(double s0)
Sets the initial value for this process to s0, and reinitializes.
int getNumObservationTimes()
Returns the number of observation times, excluding the time .
double[] generatePath(RandomStream stream)
Same as generatePath(), but first resets the stream to stream.
abstract void setStream(RandomStream stream)
Resets the random stream of the underlying generator to stream.
double[] getPath()
Returns a reference to the last generated sample path .
void getSubpath(double[] subpath, int[] pathIndices)
Returns in subpath the values of the process at a subset of the observation times,...
void resetStartProcess()
Resets the observation counter to its initial value , so that the current observation becomes .
abstract double[] generatePath()
Generates, returns, and saves the sample path .
int getCurrentObservationIndex()
Returns the value of the index corresponding to the time.
boolean hasNextObservation()
Returns true if , where is the number of observations of the current sample path generated since the...
double nextObservation()
Generates and returns the next observation of the stochastic process.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...