25package umontreal.ssj.stochprocess;
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.randvar.*;
54 this(x0, alpha, b, sigma,
new NormalGen(stream));
63 super(x0, alpha, b, sigma, gen);
67 double xOld = path[observationIndex];
68 double x = xOld + (beta - xOld) * alphadt[observationIndex] + sigmasqrdt[observationIndex] * gen.nextDouble();
70 path[observationIndex] = x;
84 double previousTime = t[observationIndex];
85 double xOld = path[observationIndex];
87 t[observationIndex] = nextTime;
88 double dt = nextTime - previousTime;
89 double x = xOld + alpha * (beta - xOld) * dt + sigma * Math.sqrt(dt) * gen.nextDouble();
90 path[observationIndex] = x;
101 x = x + alpha * (beta - x) * dt + sigma * Math.sqrt(dt) * gen.nextDouble();
114 for (
int j = 0; j < d; j++) {
115 x = xOld + (beta - xOld) * alphadt[j] + sigmasqrdt[j] * gen.nextDouble();
119 observationIndex = d;
123 protected void initArrays(
int d) {
125 for (
int j = 0; j < d; j++) {
126 dt = t[j + 1] - t[j];
127 alphadt[j] = alpha * (dt);
128 sigmasqrdt[j] = sigma * Math.sqrt(dt);
This class implements methods for generating random variates from the normal distribution .
OrnsteinUhlenbeckProcessEuler(double x0, double alpha, double b, double sigma, RandomStream stream)
Constructor with parameters alpha, ,.
double[] generatePath()
Generates a sample path of the process at all observation times, which are provided in array t.
OrnsteinUhlenbeckProcessEuler(double x0, double alpha, double b, double sigma, NormalGen gen)
Here, the normal variate generator is specified directly instead of specifying the stream.
double nextObservation()
Generates and returns the next observation of the stochastic process.
double nextObservation(double x, double dt)
Generates and returns an observation of the process in dt time units, assuming that the process has v...
double nextObservation(double nextTime)
Generates and returns the next observation at time nextTime.
OrnsteinUhlenbeckProcess(double x0, double alpha, double b, double sigma, RandomStream stream)
Constructs a new OrnsteinUhlenbeckProcess with parameters.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...