This class is a multivariate version of GeometricBrownianMotion. More...
Public Member Functions | |
| MultivariateGeometricBrownianMotion (int c, double[] x0, double[] mu, double[] sigma, MultivariateBrownianMotion mbm) | |
| Constructs a new MultivariateGeometricBrownianMotion with parameters \(\mu= \mathtt{mu}\), \(\sigma= \mathtt{sigma}\), and \(S(t_0) = \mathtt{x0}\), using mbm as the underlying. | |
| void | setObservationTimes (double[] t, int d) |
| Sets the observation times of the MultivariateGeometricBrownianMotion, but also those of the inner. | |
| void | nextObservationVector (double[] obs) |
| Generates and returns the vector of next observations. | |
| double[] | generatePath () |
| Generates, returns, and saves the sample path. | |
| void | resetStartProcess () |
| Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion object. | |
| void | setParams (int c, double[] x0, double[] mu, double[] sigma) |
| Sets the parameters \(S(t_0) = \mathtt{x0}\), \(\mu= \mathtt{mu}\) and \(\sigma= \mathtt{sigma}\) of the process. | |
| void | setStream (RandomStream stream) |
| Resets the random stream for the underlying Brownian motion to stream. | |
| RandomStream | getStream () |
| Returns the random stream for the underlying Brownian motion. | |
| NormalGen | getGen () |
| Returns the normal random variate generator used. | |
| MultivariateBrownianMotion | getBrownianMotion () |
| Returns a reference to the MultivariateBrownianMotion object used to generate the process. | |
| Public Member Functions inherited from umontreal.ssj.stochprocess.MultivariateStochasticProcess | |
| 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. | |
| void | getObservation (int j, double[] obs) |
| Returns \(\mathbf{X}(t_j)\) in the \(c\)-dimensional vector obs. | |
| double | getObservation (int j, int i) |
| Returns \(X_i(t_j)\) from the current sample path. | |
| void | getCurrentObservation (double[] obs) |
| Returns the value of the last generated observation. | |
| double[] | getX0 (double[] x0) |
| Returns in x0 the initial value \(\mathbf{X}(t_0)\) for this process. | |
| int | getDimension () |
| Returns the dimension of \(\mathbf{X}\). | |
| Public Member Functions inherited from umontreal.ssj.stochprocess.StochasticProcess | |
| 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[] | 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)\}\). | |
| 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. | |
| 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. | |
| 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 is a multivariate version of GeometricBrownianMotion.
It represents a multivariate GBM process \(\{\mathbf{S}(t) = (S_1(t),…,S_c(t)), t\ge0\}\), which can be written as
\[ S_i(t) = S_i(0) \exp\left[ X_i(t) \right], \tag{GBM2} \]
where \(\mathbf{X}(t) = (X_1(t),…,X_c(t))\) is a multivariate Brownian motion. The GBM process is simulated by simulating the BM process \(\mathbf{X}\) (which is stored internally) and taking the exponential.
<div class="SSJ-bigskip"></div><div class=
"SSJ-bigskip"></div>
Definition at line 45 of file MultivariateGeometricBrownianMotion.java.
| umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.MultivariateGeometricBrownianMotion | ( | int | c, |
| double[] | x0, | ||
| double[] | mu, | ||
| double[] | sigma, | ||
| MultivariateBrownianMotion | mbm ) |
Constructs a new MultivariateGeometricBrownianMotion with parameters \(\mu= \mathtt{mu}\), \(\sigma= \mathtt{sigma}\), and \(S(t_0) = \mathtt{x0}\), using mbm as the underlying.
MultivariateBrownianMotion. The parameters of mbm are automatically reset to \(\mu-\sigma^2/2\) and \(\sigma\), regardless of the original parameters of mbm. The correlation structure is determined by the underlying MultivariateBrownianMotion. The observation times are the same as those of mbm. The generation method depends on that of mbm (sequential, bridge sampling, PCA, etc.).
Definition at line 65 of file MultivariateGeometricBrownianMotion.java.
| double[] umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.generatePath | ( | ) |
Generates, returns, and saves the sample path.
\(\{\mathbf{X}(t_0), \mathbf{X}(t_1), …, \mathbf{X}(t_d)\}\), which can then be accessed via getPath, getSubpath, or getObservation. The generation method depends on the process type. If path[] denotes the returned array, then path[cj + i-1] contains \(X_i(t_j)\) for \(j=0,…,d\) and \(i=1,…,c\).
Reimplemented from umontreal.ssj.stochprocess.MultivariateStochasticProcess.
Definition at line 107 of file MultivariateGeometricBrownianMotion.java.
| MultivariateBrownianMotion umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.getBrownianMotion | ( | ) |
Returns a reference to the MultivariateBrownianMotion object used to generate the process.
Definition at line 182 of file MultivariateGeometricBrownianMotion.java.
| NormalGen umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.getGen | ( | ) |
Returns the normal random variate generator used.
Definition at line 174 of file MultivariateGeometricBrownianMotion.java.
| RandomStream umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.getStream | ( | ) |
Returns the random stream for the underlying Brownian motion.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 167 of file MultivariateGeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.nextObservationVector | ( | double[] | obs | ) |
Generates and returns the vector of next observations.
Reimplemented from umontreal.ssj.stochprocess.MultivariateStochasticProcess.
Definition at line 103 of file MultivariateGeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.resetStartProcess | ( | ) |
Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion object.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 122 of file MultivariateGeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.setObservationTimes | ( | double[] | t, |
| int | d ) |
Sets the observation times of the MultivariateGeometricBrownianMotion, but also those of the inner.
Reimplemented from umontreal.ssj.stochprocess.MultivariateStochasticProcess.
Definition at line 77 of file MultivariateGeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.setParams | ( | int | c, |
| double[] | x0, | ||
| double[] | mu, | ||
| double[] | sigma ) |
Sets the parameters \(S(t_0) = \mathtt{x0}\), \(\mu= \mathtt{mu}\) and \(\sigma= \mathtt{sigma}\) of the process.
Warning: This method will recompute some quantities stored internally, which may be slow if called repeatedly.
Definition at line 133 of file MultivariateGeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.MultivariateGeometricBrownianMotion.setStream | ( | RandomStream | stream | ) |
Resets the random stream for the underlying Brownian motion to stream.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 160 of file MultivariateGeometricBrownianMotion.java.