Represents a Brownian motion process \(\{X(t) : t \geq0 \}\) sampled using the bridge sampling technique (see for example. More...
Public Member Functions | |
| BrownianMotionBridge (double x0, double mu, double sigma, RandomStream stream) | |
| Constructs a new BrownianMotionBridge with parameters \(\mu=
\mathtt{mu}\), \(\sigma= \mathtt{sigma}\) and initial value \(X(t_0) =
\mathtt{x0}\). | |
| BrownianMotionBridge (double x0, double mu, double sigma, NormalGen gen) | |
| Constructs a new BrownianMotionBridge with parameters \(\mu=
\mathtt{mu}\), \(\sigma= \mathtt{sigma}\) and initial value \(X(t_0) =
\mathtt{x0}\). | |
| 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[] | generatePath () |
| Generates, returns, and saves the sample path \(\{X(t_0), X(t_1), \dots,
X(t_d)\}\). | |
| double[] | generatePath (double[] uniform01) |
| Same as generatePath(), but a vector of uniform random numbers must be provided to the method. | |
| void | resetStartProcess () |
| Resets the observation counter to its initial value \(j=0\), so that the current observation \(X(t_j)\) becomes \(X(t_0)\). | |
| Public Member Functions inherited from umontreal.ssj.stochprocess.BrownianMotion | |
| BrownianMotion (double x0, double mu, double sigma, RandomStream stream) | |
| Constructs a new BrownianMotion with parameters \(\mu=\) mu,. | |
| BrownianMotion (double x0, double mu, double sigma, NormalGen gen) | |
| Constructs a new BrownianMotion with parameters \(\mu=\) mu,. | |
| double | nextObservation (double x, double dt) |
| Generates an observation of the process in dt time units, assuming that the process has value \(x\) at the current time. | |
| double[] | generatePath (RandomStream stream) |
| Same as generatePath(), but first resets the stream to stream. | |
| void | setParams (double x0, double mu, double sigma) |
| Resets the parameters \(X(t_0) = \mathtt{x0}\), \(\mu= \mathtt{mu}\) and \(\sigma= \mathtt{sigma}\) of the process. | |
| 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 | getMu () |
| Returns the value of \(\mu\). | |
| 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. | |
| 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. | |
Represents a Brownian motion process \(\{X(t) : t \geq0 \}\) sampled using the bridge sampling technique (see for example.
[67] ). This technique generates first the value \(X(t_d)\) at the last observation time, then the value at time \(t_{d/2}\) (or the nearest integer), then the values at time \(t_{d/4}\) and at time \(t_{3d/4}\) (or the nearest integers), and so on. If the process has already been sampled at times \(t_i < t_k\) but not in between, the next sampling point in that interval will be \(t_j\) where \(j = \lfloor(i + k)/2 \rfloor\). For example, if the sampling times used are \(\{t_0, t_1, t_2, t_3, t_4, t_5\}\), then the observations are generated in the following order: \(X(t_5)\), \(X(t_2)\), \(X(t_1)\), \(X(t_3)\), \(X(t_4)\).
*Warning*: Both the `generatePath` and the `nextObservation`
methods from
umontreal.ssj.stochprocess.BrownianMotion are modified to use the bridge method.
In the case of nextObservation, the user should understand that the observations returned are not ordered chronologically. However they will be once an entire path is generated and the observations are read from the internal array (referenced by the getPath method) that contains them.
The method nextObservation(double nextTime) differs from that of the class umontreal.ssj.stochprocess.BrownianMotion in that nextTime represents the next observation time of the Brownian bridge. However, the \(t_i\) supplied must still be non-decreasing with \(i\).
Note also that, if the path is not entirely generated before being read from this array, there will be "pollution" from the previous path generated, and the observations will not represent a sample path of this process.
Definition at line 74 of file BrownianMotionBridge.java.
| umontreal.ssj.stochprocess.BrownianMotionBridge.BrownianMotionBridge | ( | double | x0, |
| double | mu, | ||
| double | sigma, | ||
| RandomStream | stream ) |
Constructs a new BrownianMotionBridge with parameters \(\mu= \mathtt{mu}\), \(\sigma= \mathtt{sigma}\) and initial value \(X(t_0) = \mathtt{x0}\).
The normal variates will be generated by inversion using the umontreal.ssj.rng.RandomStream stream.
Definition at line 87 of file BrownianMotionBridge.java.
| umontreal.ssj.stochprocess.BrownianMotionBridge.BrownianMotionBridge | ( | double | x0, |
| double | mu, | ||
| double | sigma, | ||
| NormalGen | gen ) |
Constructs a new BrownianMotionBridge with parameters \(\mu= \mathtt{mu}\), \(\sigma= \mathtt{sigma}\) and initial value \(X(t_0) = \mathtt{x0}\).
The normal variates will be generated by the umontreal.ssj.randvar.NormalGen gen.
Definition at line 97 of file BrownianMotionBridge.java.
| double[] umontreal.ssj.stochprocess.BrownianMotionBridge.generatePath | ( | ) |
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 from umontreal.ssj.stochprocess.BrownianMotion.
Definition at line 165 of file BrownianMotionBridge.java.
| double[] umontreal.ssj.stochprocess.BrownianMotionBridge.generatePath | ( | double[] | uniform01 | ) |
Same as generatePath(), but a vector of uniform random numbers must be provided to the method.
These uniform random numbers are used to generate the path.
Reimplemented from umontreal.ssj.stochprocess.BrownianMotion.
Definition at line 185 of file BrownianMotionBridge.java.
| double umontreal.ssj.stochprocess.BrownianMotionBridge.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.BrownianMotion.
Definition at line 101 of file BrownianMotionBridge.java.
| double umontreal.ssj.stochprocess.BrownianMotionBridge.nextObservation | ( | double | nextTime | ) |
Generates and returns the next observation at time \(t_{j+1} =\) nextTime.
It uses the previous observation time \(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.BrownianMotion.
Definition at line 124 of file BrownianMotionBridge.java.
| void umontreal.ssj.stochprocess.BrownianMotionBridge.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 from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 204 of file BrownianMotionBridge.java.