This class represents an Ornstein-Uhlenbeck process as in. More...
Public Member Functions | |
| OrnsteinUhlenbeckProcessEuler (double x0, double alpha, double b, double sigma, RandomStream stream) | |
| Constructor with parameters \(\alpha=\) alpha, \(b\),. | |
| 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 \(X(t_j)\) of the stochastic process. | |
| double | nextObservation (double nextTime) |
| Generates and returns the next observation at time \(t_{j+1} =\) nextTime. | |
| double | nextObservation (double x, double dt) |
| Generates and returns an observation of the process in dt time units, assuming that the process has value \(x\) at the current time. | |
| double[] | generatePath () |
| Generates a sample path of the process at all observation times, which are provided in array t. | |
| Public Member Functions inherited from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess | |
| OrnsteinUhlenbeckProcess (double x0, double alpha, double b, double sigma, RandomStream stream) | |
| Constructs a new OrnsteinUhlenbeckProcess with parameters. | |
| OrnsteinUhlenbeckProcess (double x0, double alpha, double b, double sigma, NormalGen gen) | |
| Here, the normal variate generator is specified directly instead of specifying the stream. | |
| double[] | generatePath (RandomStream stream) |
| Generates a sample path of the process at all observation times, which are provided in array t. | |
| void | setParams (double x0, double alpha, double b, double sigma) |
| Resets the parameters \(X(t_0) =\) x0, \(\alpha=\) alpha,. | |
| void | setStream (RandomStream stream) |
| Resets the random stream of the normal generator to stream. | |
| RandomStream | getStream () |
| Returns the random stream of the normal generator. | |
| double | getAlpha () |
| Returns the value of \(\alpha\). | |
| double | getB () |
| Returns the value of \(b\). | |
| double | getSigma () |
| Returns the value of \(\sigma\). | |
| NormalGen | getGen () |
| Returns the normal random variate generator used. | |
| Public Member Functions inherited from umontreal.ssj.stochprocess.StochasticProcess | |
| void | setObservationTimes (double[] T, int d) |
| Sets the observation times of the process to a copy of T, with. | |
| void | setObservationTimes (double delta, int d) |
| Sets equidistant observation times at \(t_j = j\delta\), for. | |
| double[] | getObservationTimes () |
| Returns a reference to the array that contains the observation times. | |
| int | getNumObservationTimes () |
| Returns the number \(d\) of observation times, excluding the time \(t_0\). | |
| double[] | getPath () |
| Returns a reference to the last generated sample path \(\{X(t_0), ... ,
X(t_d)\}\). | |
| void | getSubpath (double[] subpath, int[] pathIndices) |
| Returns in subpath the values of the process at a subset of the observation times, specified as the times \(t_j\) whose indices. | |
| double | getObservation (int j) |
| Returns \(X(t_j)\) from the current sample path. | |
| void | resetStartProcess () |
| Resets the observation counter to its initial value \(j=0\), so that the current observation \(X(t_j)\) becomes \(X(t_0)\). | |
| boolean | hasNextObservation () |
| Returns true if \(j<d\), where \(j\) is the number of observations of the current sample path generated since the last call to resetStartProcess. | |
| int | getCurrentObservationIndex () |
| Returns the value of the index \(j\) corresponding to the time. | |
| double | getCurrentObservation () |
| Returns the value of the last generated observation \(X(t_j)\). | |
| double | getX0 () |
| Returns the initial value \(X(t_0)\) for this process. | |
| void | setX0 (double s0) |
| Sets the initial value \(X(t_0)\) for this process to s0, and reinitializes. | |
| int[] | getArrayMappingCounterToIndex () |
| Returns a reference to an array that maps an integer \(k\) to \(i_k\), the index of the observation \(S(t_{i_k})\) corresponding to the. | |
This class represents an Ornstein-Uhlenbeck process as in.
OrnsteinUhlenbeckProcess, but the process is generated using the simple Euler scheme
\[ X(t_j) - X(t_{j-1}) = \alpha(b - X(t_{j-1}))(t_j - t_{j-1}) + \sigma\sqrt{t_j - t_{j-1}} Z_j \tag{ornstein-seqEuler} \]
where \(Z_j \sim N(0,1)\). This is a good approximation only for small time intervals \(t_j - t_{j-1}\).
Definition at line 44 of file OrnsteinUhlenbeckProcessEuler.java.
| umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler.OrnsteinUhlenbeckProcessEuler | ( | double | x0, |
| double | alpha, | ||
| double | b, | ||
| double | sigma, | ||
| RandomStream | stream ) |
Constructor with parameters \(\alpha=\) alpha, \(b\),.
\(\sigma=\) sigma and initial value \(X(t_0) =\) x0. The normal variates \(Z_j\) will be generated by inversion using the stream stream.
Definition at line 53 of file OrnsteinUhlenbeckProcessEuler.java.
| umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler.OrnsteinUhlenbeckProcessEuler | ( | double | x0, |
| double | alpha, | ||
| double | b, | ||
| double | sigma, | ||
| NormalGen | gen ) |
Here, the normal variate generator is specified directly instead of specifying the stream.
The normal generator gen can use another method than inversion.
Definition at line 62 of file OrnsteinUhlenbeckProcessEuler.java.
| double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler.generatePath | ( | ) |
Generates a sample path of the process at all observation times, which are provided in array t.
Note that t[0] should be the observation time of x0, the initial value of the process, and t[] should have at least \(d+1\) elements (see the setObservationTimes method).
Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.
Definition at line 111 of file OrnsteinUhlenbeckProcessEuler.java.
| double umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler.nextObservation | ( | ) |
Generates and returns the next observation \(X(t_j)\) of the stochastic process.
The processes are usually sampled sequentially, i.e. if the last observation generated was for time
\(t_{j-1}\), the next observation returned will be for time \(t_j\). In some cases, subclasses extending this abstract class may use non-sequential sampling algorithms (such as bridge sampling). The order of generation of the \(t_j\)’s is then specified by the subclass. All the processes generated using principal components analysis (PCA) do not have this method.
Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.
Definition at line 66 of file OrnsteinUhlenbeckProcessEuler.java.
| double umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler.nextObservation | ( | double | nextTime | ) |
Generates and returns the next observation at time \(t_{j+1} =\) nextTime.
Assumes the previous observation time is \(t_j\) defined earlier (either by this method or by setObservationTimes), as well as the value of the previous observation \(X(t_j)\). Warning: This method will reset the observations time \(t_{j+1}\) for this process to nextTime. The user must make sure that the \(t_{j+1}\) supplied is \(\geq t_j\).
Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.
Definition at line 83 of file OrnsteinUhlenbeckProcessEuler.java.
| double umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler.nextObservation | ( | double | x, |
| double | dt ) |
Generates and returns an observation of the process in dt time units, assuming that the process has value \(x\) at the current time.
Uses the process parameters specified in the constructor. Note that this method does not affect the sample path of the process stored internally (if any).
Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.
Definition at line 100 of file OrnsteinUhlenbeckProcessEuler.java.