Represents a geometric Brownian motion (GBM) process \(\{S(t), t\ge0\}\), which evolves according to the stochastic differential equation. More...
Public Member Functions | |
| GeometricBrownianMotion (double s0, double mu, double sigma, RandomStream stream) | |
| Same as GeometricBrownianMotion (s0, mu, sigma, new BrownianMotion (0.0,
0.0, 1.0, stream)). | |
| GeometricBrownianMotion (double s0, double mu, double sigma, BrownianMotion bm) | |
| Constructs a new GeometricBrownianMotion with parameters \(\mu=
\mathtt{mu}\), \(\sigma= \mathtt{sigma}\), and \(S(t_0) = \mathtt{s0}\), using bm as the underlying BrownianMotion. | |
| void | setObservationTimes (double[] t, int d) |
| Sets the observation times of the process to a copy of T, with. | |
| double | nextObservation () |
| Generates and returns the next observation \(X(t_j)\) of the stochastic process. | |
| 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. | |
| void | resetStartProcess () |
| Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion object. | |
| void | setParams (double s0, double mu, double sigma) |
| Sets the parameters \(S(t_0) = \mathtt{s0}\), \(\mu= \mathtt{mu}\) and \(\sigma= \mathtt{sigma}\) of the process. | |
| void | setStream (RandomStream stream) |
| Resets the umontreal.ssj.rng.RandomStream for the underlying Brownian motion to stream. | |
| RandomStream | getStream () |
| Returns the umontreal.ssj.rng.RandomStream for the underlying Brownian motion. | |
| double | getMu () |
| Returns the value of \(\mu\). | |
| double | getSigma () |
| Returns the value of \(\sigma\). | |
| NormalGen | getGen () |
| Returns the umontreal.ssj.randvar.NormalGen used. | |
| BrownianMotion | getBrownianMotion () |
| Returns a reference to the BrownianMotion object used to generate the process. | |
| 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[] | 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 geometric Brownian motion (GBM) process \(\{S(t), t\ge0\}\), which evolves according to the stochastic differential equation.
\[ dS(t) = \mu S(t) dt + \sigma S(t) dB(t), \tag{GBM} \]
where \(\mu\) and \(\sigma\) are the drift and volatility parameters, and \(\{B(t), t\ge0\}\) is a standard Brownian motion (for which \(B(t)\sim N(0,t)\)). This process can also be written as the exponential of a Brownian motion:
\[ S(t) = S(0) \exp\left[ (\mu- \sigma^2/2) t + \sigma B(t) \right] = S(0) \exp\left[ X(t) \right], \tag{GBM2} \]
where \(X(t) = (\mu- \sigma^2/2) t + \sigma B(t)\). The GBM process is simulated by simulating the BM process \(X\) and taking the exponential. This BM process is stored internally.
Definition at line 50 of file GeometricBrownianMotion.java.
| umontreal.ssj.stochprocess.GeometricBrownianMotion.GeometricBrownianMotion | ( | double | s0, |
| double | mu, | ||
| double | sigma, | ||
| RandomStream | stream ) |
Same as GeometricBrownianMotion (s0, mu, sigma, new BrownianMotion (0.0, 0.0, 1.0, stream)).
Definition at line 61 of file GeometricBrownianMotion.java.
| umontreal.ssj.stochprocess.GeometricBrownianMotion.GeometricBrownianMotion | ( | double | s0, |
| double | mu, | ||
| double | sigma, | ||
| BrownianMotion | bm ) |
Constructs a new GeometricBrownianMotion with parameters \(\mu= \mathtt{mu}\), \(\sigma= \mathtt{sigma}\), and \(S(t_0) = \mathtt{s0}\), using bm as the underlying BrownianMotion.
The parameters of bm are automatically reset to
\(\mu-\sigma^2/2\) and \(\sigma\), regardless of the original parameters of bm. The observation times are the same as those of bm. The generation method depends on that of bm (sequential, bridge sampling, PCA, etc.).
Definition at line 76 of file GeometricBrownianMotion.java.
| double[] umontreal.ssj.stochprocess.GeometricBrownianMotion.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.StochasticProcess.
Definition at line 100 of file GeometricBrownianMotion.java.
| double[] umontreal.ssj.stochprocess.GeometricBrownianMotion.generatePath | ( | RandomStream | stream | ) |
Same as generatePath(), but first resets the stream to stream.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 109 of file GeometricBrownianMotion.java.
| BrownianMotion umontreal.ssj.stochprocess.GeometricBrownianMotion.getBrownianMotion | ( | ) |
Returns a reference to the BrownianMotion object used to generate the process.
Definition at line 179 of file GeometricBrownianMotion.java.
| NormalGen umontreal.ssj.stochprocess.GeometricBrownianMotion.getGen | ( | ) |
Returns the umontreal.ssj.randvar.NormalGen used.
Definition at line 171 of file GeometricBrownianMotion.java.
| double umontreal.ssj.stochprocess.GeometricBrownianMotion.getMu | ( | ) |
Returns the value of \(\mu\).
Definition at line 157 of file GeometricBrownianMotion.java.
| double umontreal.ssj.stochprocess.GeometricBrownianMotion.getSigma | ( | ) |
Returns the value of \(\sigma\).
Definition at line 164 of file GeometricBrownianMotion.java.
| RandomStream umontreal.ssj.stochprocess.GeometricBrownianMotion.getStream | ( | ) |
Returns the umontreal.ssj.rng.RandomStream for the underlying Brownian motion.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 150 of file GeometricBrownianMotion.java.
| double umontreal.ssj.stochprocess.GeometricBrownianMotion.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.StochasticProcess.
Definition at line 87 of file GeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.GeometricBrownianMotion.resetStartProcess | ( | ) |
Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion object.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 118 of file GeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.GeometricBrownianMotion.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 from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 81 of file GeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.GeometricBrownianMotion.setParams | ( | double | s0, |
| double | mu, | ||
| double | sigma ) |
Sets the parameters \(S(t_0) = \mathtt{s0}\), \(\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 129 of file GeometricBrownianMotion.java.
| void umontreal.ssj.stochprocess.GeometricBrownianMotion.setStream | ( | RandomStream | stream | ) |
Resets the umontreal.ssj.rng.RandomStream for the underlying Brownian motion to stream.
Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.
Definition at line 142 of file GeometricBrownianMotion.java.