SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps Class Reference

Same as BrownianMotionPCA, but uses a trick to speed up the calculation when the time steps are equidistant. More...

Inheritance diagram for umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps:
umontreal.ssj.stochprocess.BrownianMotion umontreal.ssj.stochprocess.StochasticProcess

Public Member Functions

 BrownianMotionPCAEqualSteps (double x0, double mu, double sigma, RandomStream stream)
 Constructs a new BrownianMotionPCAEqualSteps.
 BrownianMotionPCAEqualSteps (double x0, double mu, double sigma, NormalGen gen)
 Constructs a new BrownianMotionPCAEqualSteps.
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 (double[] QMCpointsBM)
 Same as generatePath(), but a vector of uniform random numbers must be provided to the method.
void setObservationTimes (double[] t, int d)
 Sets the observation times of the process to a copy of T, with.
void setObservationTimes (double dt, int d)
 Sets equidistant observation times at \(t_j = j\delta\), for.
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 nextTime)
 Generates and returns the next observation at time \(t_{j+1} =\) nextTime.
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
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.

Detailed Description

Same as BrownianMotionPCA, but uses a trick to speed up the calculation when the time steps are equidistant.

Definition at line 37 of file BrownianMotionPCAEqualSteps.java.

Constructor & Destructor Documentation

◆ BrownianMotionPCAEqualSteps() [1/2]

umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.BrownianMotionPCAEqualSteps ( double x0,
double mu,
double sigma,
RandomStream stream )

Constructs a new BrownianMotionPCAEqualSteps.

Definition at line 48 of file BrownianMotionPCAEqualSteps.java.

◆ BrownianMotionPCAEqualSteps() [2/2]

umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.BrownianMotionPCAEqualSteps ( double x0,
double mu,
double sigma,
NormalGen gen )

Constructs a new BrownianMotionPCAEqualSteps.

Definition at line 56 of file BrownianMotionPCAEqualSteps.java.

Member Function Documentation

◆ generatePath() [1/2]

double[] umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.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 65 of file BrownianMotionPCAEqualSteps.java.

◆ generatePath() [2/2]

double[] umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.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 82 of file BrownianMotionPCAEqualSteps.java.

◆ nextObservation()

double umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.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 61 of file BrownianMotionPCAEqualSteps.java.

◆ setObservationTimes() [1/2]

void umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.setObservationTimes ( double delta,
int d )

Sets equidistant observation times at \(t_j = j\delta\), for.

\(j=0,\dots,d\), and delta = \(\delta\).

Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.

Definition at line 107 of file BrownianMotionPCAEqualSteps.java.

◆ setObservationTimes() [2/2]

void umontreal.ssj.stochprocess.BrownianMotionPCAEqualSteps.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 99 of file BrownianMotionPCAEqualSteps.java.


The documentation for this class was generated from the following file: