Abstract base class for a stochastic process \(\{X(t) : t \geq 0 \}\) sampled (or observed) at a finite number of time points, \(0 = t_0 < t_1 < \cdots< t_d\). More...
Public Member Functions | |
| 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\). | |
| abstract double[] | generatePath () |
| Generates, returns, and saves the sample path \(\{X(t_0), X(t_1), \dots,
X(t_d)\}\). | |
| double[] | generatePath (RandomStream stream) |
| Same as generatePath(), but first resets the stream to stream. | |
| 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. | |
| double | nextObservation () |
| Generates and returns the next observation \(X(t_j)\) of the stochastic process. | |
| 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. | |
| abstract void | setStream (RandomStream stream) |
| Resets the random stream of the underlying generator to stream. | |
| abstract RandomStream | getStream () |
| Returns the random stream of the underlying generator. | |
| 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. | |
Abstract base class for a stochastic process \(\{X(t) : t \geq 0 \}\) sampled (or observed) at a finite number of time points, \(0 = t_0 < t_1 < \cdots< t_d\).
The observation times are usually all specified before generating a sample path. This can be done via setObservationTimes. The method generatePath generates \(X(t_1),\dots,X(t_d)\) and memorizes them in a vector, which can be recovered by getPath.
Alternatively, for some types of processes, the observations \(X(t_j)\) can be generated sequentially, one at a time, by invoking resetStartProcess first, and then nextObservation repeatedly. For some types of processes, the observation times can be specified one by one as well, when generating the path. This may be convenient or even necessary if the observation times are random, for example.
WARNING: After having called the constructor for one of the subclass, it is important to set the observation times of the process, usually by calling setObservationTimes.
Definition at line 52 of file StochasticProcess.java.
|
abstract |
Generates, returns, and saves the sample path \(\{X(t_0), X(t_1), \dots, X(t_d)\}\).
It can then be accessed via getPath, getSubpath, or getObservation. The generation method depends on the process type.
Reimplemented in umontreal.ssj.stochprocess.BrownianMotion, umontreal.ssj.stochprocess.BrownianMotionBridge, umontreal.ssj.stochprocess.BrownianMotionPCA, umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps, umontreal.ssj.stochprocess.CIRProcess, umontreal.ssj.stochprocess.CIRProcessEuler, umontreal.ssj.stochprocess.GammaProcess, umontreal.ssj.stochprocess.GammaProcessBridge, umontreal.ssj.stochprocess.GammaProcessPCA, umontreal.ssj.stochprocess.GammaProcessPCABridge, umontreal.ssj.stochprocess.GammaProcessPCASymmetricalBridge, umontreal.ssj.stochprocess.GammaProcessSymmetricalBridge, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.GeometricLevyProcess, umontreal.ssj.stochprocess.GeometricVarianceGammaProcess, umontreal.ssj.stochprocess.InverseGaussianProcess, umontreal.ssj.stochprocess.InverseGaussianProcessBridge, umontreal.ssj.stochprocess.InverseGaussianProcessMSH, umontreal.ssj.stochprocess.InverseGaussianProcessPCA, umontreal.ssj.stochprocess.MultivariateBrownianMotion, umontreal.ssj.stochprocess.MultivariateBrownianMotionBridge, umontreal.ssj.stochprocess.MultivariateBrownianMotionPCA, umontreal.ssj.stochprocess.MultivariateBrownianMotionPCABigSigma, umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion, umontreal.ssj.stochprocess.MultivariateStochasticProcess, umontreal.ssj.stochprocess.NormalInverseGaussianProcess, umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess, umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler, umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess, umontreal.ssj.stochprocess.VarianceGammaProcess, umontreal.ssj.stochprocess.VarianceGammaProcessAlternate, umontreal.ssj.stochprocess.VarianceGammaProcessDiff, and umontreal.ssj.stochprocess.VarianceGammaProcessDiffPCA.
| double[] umontreal.ssj.stochprocess.StochasticProcess.generatePath | ( | RandomStream | stream | ) |
Same as generatePath(), but first resets the stream to stream.
Reimplemented in umontreal.ssj.stochprocess.BrownianMotion, umontreal.ssj.stochprocess.CIRProcess, umontreal.ssj.stochprocess.CIRProcessEuler, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.MultivariateBrownianMotion, and umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.
Definition at line 142 of file StochasticProcess.java.
| int[] umontreal.ssj.stochprocess.StochasticProcess.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.
\(k\)-th observation to be generated for a sample path of this process. If this process is sampled sequentially, then this map is trivial (i.e. \(i_k = k\)). But it can be useful in a more general setting where the process is not sampled sequentially (for example, by a Brownian or gamma bridge) and one wants to know which observations of the current sample path were previously generated or will be generated next.
Definition at line 283 of file StochasticProcess.java.
| double umontreal.ssj.stochprocess.StochasticProcess.getCurrentObservation | ( | ) |
Returns the value of the last generated observation \(X(t_j)\).
Definition at line 230 of file StochasticProcess.java.
| int umontreal.ssj.stochprocess.StochasticProcess.getCurrentObservationIndex | ( | ) |
Returns the value of the index \(j\) corresponding to the time.
\(t_j\) of the last generated observation.
Definition at line 223 of file StochasticProcess.java.
| int umontreal.ssj.stochprocess.StochasticProcess.getNumObservationTimes | ( | ) |
Returns the number \(d\) of observation times, excluding the time \(t_0\).
Definition at line 128 of file StochasticProcess.java.
| double umontreal.ssj.stochprocess.StochasticProcess.getObservation | ( | int | j | ) |
Returns \(X(t_j)\) from the current sample path.
Warning: If the observation \(X(t_j)\) for the current path has not yet been generated, then the value returned is unpredictable.
Definition at line 175 of file StochasticProcess.java.
| double[] umontreal.ssj.stochprocess.StochasticProcess.getObservationTimes | ( | ) |
Returns a reference to the array that contains the observation times.
\((t_0,…,t_d)\). Warning: This method should only be used to read the observation times. Changing the values in the array directly may have unexpected consequences. The method setObservationTimes should be used to modify the observation times.
Definition at line 120 of file StochasticProcess.java.
| double[] umontreal.ssj.stochprocess.StochasticProcess.getPath | ( | ) |
Returns a reference to the last generated sample path \(\{X(t_0), ... , X(t_d)\}\).
Warning: The returned array and its size should not be modified, because this is the one that memorizes the observations (not a copy of it). To obtain a copy, use getSubpath instead.
Definition at line 153 of file StochasticProcess.java.
|
abstract |
Returns the random stream of the underlying generator.
Reimplemented in umontreal.ssj.stochprocess.BrownianMotion, umontreal.ssj.stochprocess.CIRProcess, umontreal.ssj.stochprocess.CIRProcessEuler, umontreal.ssj.stochprocess.GammaProcess, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.GeometricLevyProcess, umontreal.ssj.stochprocess.GeometricVarianceGammaProcess, umontreal.ssj.stochprocess.InverseGaussianProcess, umontreal.ssj.stochprocess.InverseGaussianProcessBridge, umontreal.ssj.stochprocess.InverseGaussianProcessMSH, umontreal.ssj.stochprocess.InverseGaussianProcessPCA, umontreal.ssj.stochprocess.MultivariateBrownianMotion, umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion, umontreal.ssj.stochprocess.NormalInverseGaussianProcess, umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess, umontreal.ssj.stochprocess.VarianceGammaProcess, and umontreal.ssj.stochprocess.VarianceGammaProcessDiff.
| void umontreal.ssj.stochprocess.StochasticProcess.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.
\(j\) are in the array pathIndices. The size of pathIndices should be at least as much as that of subpath.
Reimplemented in umontreal.ssj.stochprocess.MultivariateStochasticProcess.
Definition at line 164 of file StochasticProcess.java.
| double umontreal.ssj.stochprocess.StochasticProcess.getX0 | ( | ) |
Returns the initial value \(X(t_0)\) for this process.
Definition at line 237 of file StochasticProcess.java.
| boolean umontreal.ssj.stochprocess.StochasticProcess.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.
Otherwise returns false.
Definition at line 195 of file StochasticProcess.java.
| double umontreal.ssj.stochprocess.StochasticProcess.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 in umontreal.ssj.stochprocess.BrownianMotion, umontreal.ssj.stochprocess.BrownianMotionBridge, umontreal.ssj.stochprocess.BrownianMotionPCA, umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps, umontreal.ssj.stochprocess.CIRProcess, umontreal.ssj.stochprocess.CIRProcessEuler, umontreal.ssj.stochprocess.GammaProcess, umontreal.ssj.stochprocess.GammaProcessBridge, umontreal.ssj.stochprocess.GammaProcessPCA, umontreal.ssj.stochprocess.GammaProcessSymmetricalBridge, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.GeometricLevyProcess, umontreal.ssj.stochprocess.GeometricVarianceGammaProcess, umontreal.ssj.stochprocess.InverseGaussianProcess, umontreal.ssj.stochprocess.InverseGaussianProcessBridge, umontreal.ssj.stochprocess.InverseGaussianProcessMSH, umontreal.ssj.stochprocess.InverseGaussianProcessPCA, umontreal.ssj.stochprocess.NormalInverseGaussianProcess, umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess, umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcessEuler, umontreal.ssj.stochprocess.VarianceGammaProcess, umontreal.ssj.stochprocess.VarianceGammaProcessDiff, and umontreal.ssj.stochprocess.VarianceGammaProcessDiffPCA.
Definition at line 214 of file StochasticProcess.java.
| void umontreal.ssj.stochprocess.StochasticProcess.resetStartProcess | ( | ) |
Resets the observation counter to its initial value \(j=0\), so that the current observation \(X(t_j)\) becomes \(X(t_0)\).
This method should be invoked before generating observations sequentially one by one via nextObservation, for a new sample path.
Reimplemented in umontreal.ssj.stochprocess.BrownianMotionBridge, umontreal.ssj.stochprocess.GammaProcessBridge, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.GeometricLevyProcess, umontreal.ssj.stochprocess.GeometricVarianceGammaProcess, umontreal.ssj.stochprocess.InverseGaussianProcessBridge, umontreal.ssj.stochprocess.MultivariateBrownianMotionBridge, umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion, umontreal.ssj.stochprocess.VarianceGammaProcess, and umontreal.ssj.stochprocess.VarianceGammaProcessDiff.
Definition at line 185 of file StochasticProcess.java.
| void umontreal.ssj.stochprocess.StochasticProcess.setObservationTimes | ( | double | delta, |
| int | d ) |
Sets equidistant observation times at \(t_j = j\delta\), for.
\(j=0,\dots,d\), and delta = \(\delta\).
Reimplemented in umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.
Definition at line 104 of file StochasticProcess.java.
| void umontreal.ssj.stochprocess.StochasticProcess.setObservationTimes | ( | double[] | T, |
| int | d ) |
Sets the observation times of the process to a copy of T, with.
\(t_0 =\) T[0] and \(t_d =\) T[d]. The size of T must be \(d+1\).
Reimplemented in umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps, umontreal.ssj.stochprocess.GammaProcessPCA, umontreal.ssj.stochprocess.GammaProcessPCABridge, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.GeometricLevyProcess, umontreal.ssj.stochprocess.InverseGaussianProcessPCA, umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion, umontreal.ssj.stochprocess.MultivariateStochasticProcess, umontreal.ssj.stochprocess.NormalInverseGaussianProcess, umontreal.ssj.stochprocess.VarianceGammaProcess, and umontreal.ssj.stochprocess.VarianceGammaProcessDiff.
Definition at line 73 of file StochasticProcess.java.
|
abstract |
Resets the random stream of the underlying generator to stream.
Reimplemented in umontreal.ssj.stochprocess.BrownianMotion, umontreal.ssj.stochprocess.CIRProcess, umontreal.ssj.stochprocess.CIRProcessEuler, umontreal.ssj.stochprocess.GammaProcess, umontreal.ssj.stochprocess.GammaProcessBridge, umontreal.ssj.stochprocess.GammaProcessPCA, umontreal.ssj.stochprocess.GeometricBrownianMotion, umontreal.ssj.stochprocess.GeometricLevyProcess, umontreal.ssj.stochprocess.GeometricVarianceGammaProcess, umontreal.ssj.stochprocess.InverseGaussianProcess, umontreal.ssj.stochprocess.InverseGaussianProcessBridge, umontreal.ssj.stochprocess.InverseGaussianProcessMSH, umontreal.ssj.stochprocess.InverseGaussianProcessPCA, umontreal.ssj.stochprocess.MultivariateBrownianMotion, umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion, umontreal.ssj.stochprocess.NormalInverseGaussianProcess, umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess, umontreal.ssj.stochprocess.VarianceGammaProcess, and umontreal.ssj.stochprocess.VarianceGammaProcessDiff.
| void umontreal.ssj.stochprocess.StochasticProcess.setX0 | ( | double | s0 | ) |
Sets the initial value \(X(t_0)\) for this process to s0, and reinitializes.
Definition at line 245 of file StochasticProcess.java.