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

Uses a faster generating method (MSH) [175]  than the simple inversion of the distribution function used by. More...

Inheritance diagram for umontreal.ssj.stochprocess.InverseGaussianProcessMSH:
umontreal.ssj.stochprocess.InverseGaussianProcess umontreal.ssj.stochprocess.StochasticProcess umontreal.ssj.stochprocess.InverseGaussianProcessBridge

Classes

class  NonRandomStream
 NonRandomStream: Given a double array, this class will return those values as if it where a random stream. More...

Public Member Functions

 InverseGaussianProcessMSH (double s0, double delta, double gamma, RandomStream stream, RandomStream otherStream)
 Constructs a new InverseGaussianProcessMSH.
double[] generatePath ()
 Generates the path.
double[] generatePath (double[] unifNorm, double[] unifOther)
 Instead of using the internal streams to generate the path, uses two arrays of uniforms \(U[0,1)\).
double[] generatePath (double[] uniforms01)
 Not implemented, requires two umontreal.ssj.rng.RandomStream ’s.
double nextObservation ()
 Generates and returns the next observation \(X(t_j)\) of the stochastic process.
RandomStream getStream ()
 Only returns a stream if both inner umontreal.ssj.rng.RandomStream ’s are the same.
void setStream (RandomStream stream, RandomStream otherStream)
 Sets the streams.
void setStream (RandomStream stream)
 Sets both inner streams to stream.
void setOtherStream (RandomStream otherStream)
 Sets the otherStream, which is the stream used to choose between the two roots in the MSH method.
RandomStream getOtherStream ()
 Returns the otherStream, which is the stream used to choose between the two quadratic roots from the MSH method.
void setNormalGen (NormalGen normalGen)
 Sets the normal generator.
NormalGen getNormalGen ()
 Returns the normal generator.
Public Member Functions inherited from umontreal.ssj.stochprocess.InverseGaussianProcess
 InverseGaussianProcess (double s0, double delta, double gamma, RandomStream stream)
 Constructs a new InverseGaussianProcess.
void setParams (double delta, double gamma)
 Sets the parameters.
double getDelta ()
 Returns \(\delta\).
double getGamma ()
 Returns \(\gamma\).
double getAnalyticAverage (double time)
 Returns the analytic average which is \(\delta t/ \gamma\), with.
double getAnalyticVariance (double time)
 Returns the analytic variance which is \((\delta t)^2\), with.
int getNumberOfRandomStreams ()
 Returns the number of random streams of this process.
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[] 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.
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

Uses a faster generating method (MSH) [175]  than the simple inversion of the distribution function used by.

InverseGaussianProcess. It is about 60 times faster. However it requires two umontreal.ssj.rng.RandomStream ’s instead of only one for InverseGaussianProcess. The second stream is called otherStream below and it is used to randomly choose between two roots at each time step.

Definition at line 43 of file InverseGaussianProcessMSH.java.

Constructor & Destructor Documentation

◆ InverseGaussianProcessMSH()

umontreal.ssj.stochprocess.InverseGaussianProcessMSH.InverseGaussianProcessMSH ( double s0,
double delta,
double gamma,
RandomStream stream,
RandomStream otherStream )

Constructs a new InverseGaussianProcessMSH.

The initial value s0 will be overridden by \(t[0]\) when the observation times are set.

Definition at line 54 of file InverseGaussianProcessMSH.java.

Member Function Documentation

◆ generatePath() [1/3]

double[] umontreal.ssj.stochprocess.InverseGaussianProcessMSH.generatePath ( )

Generates the path.

It is done by successively calling nextObservation(), therefore the two

umontreal.ssj.rng.RandomStream s are sampled alternatively.

Reimplemented from umontreal.ssj.stochprocess.InverseGaussianProcess.

Reimplemented in umontreal.ssj.stochprocess.InverseGaussianProcessBridge.

Definition at line 71 of file InverseGaussianProcessMSH.java.

◆ generatePath() [2/3]

double[] umontreal.ssj.stochprocess.InverseGaussianProcessMSH.generatePath ( double[] unifNorm,
double[] unifOther )

Instead of using the internal streams to generate the path, uses two arrays of uniforms \(U[0,1)\).

The length of the arrays should be equal to the number of periods in the observation times. This method is useful for NormalInverseGaussianProcess.

Reimplemented from umontreal.ssj.stochprocess.InverseGaussianProcess.

Reimplemented in umontreal.ssj.stochprocess.InverseGaussianProcessBridge.

Definition at line 88 of file InverseGaussianProcessMSH.java.

◆ generatePath() [3/3]

double[] umontreal.ssj.stochprocess.InverseGaussianProcessMSH.generatePath ( double[] uniforms01)

Not implemented, requires two umontreal.ssj.rng.RandomStream ’s.

Reimplemented from umontreal.ssj.stochprocess.InverseGaussianProcess.

Definition at line 107 of file InverseGaussianProcessMSH.java.

◆ getNormalGen()

NormalGen umontreal.ssj.stochprocess.InverseGaussianProcessMSH.getNormalGen ( )

Returns the normal generator.

Definition at line 176 of file InverseGaussianProcessMSH.java.

◆ getOtherStream()

RandomStream umontreal.ssj.stochprocess.InverseGaussianProcessMSH.getOtherStream ( )

Returns the otherStream, which is the stream used to choose between the two quadratic roots from the MSH method.

Definition at line 160 of file InverseGaussianProcessMSH.java.

◆ getStream()

RandomStream umontreal.ssj.stochprocess.InverseGaussianProcessMSH.getStream ( )

Only returns a stream if both inner umontreal.ssj.rng.RandomStream ’s are the same.

Reimplemented from umontreal.ssj.stochprocess.InverseGaussianProcess.

Reimplemented in umontreal.ssj.stochprocess.InverseGaussianProcessBridge.

Definition at line 124 of file InverseGaussianProcessMSH.java.

◆ nextObservation()

double umontreal.ssj.stochprocess.InverseGaussianProcessMSH.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.InverseGaussianProcess.

Reimplemented in umontreal.ssj.stochprocess.InverseGaussianProcessBridge.

Definition at line 111 of file InverseGaussianProcessMSH.java.

◆ setNormalGen()

void umontreal.ssj.stochprocess.InverseGaussianProcessMSH.setNormalGen ( NormalGen normalGen)

Sets the normal generator.

It also sets one of the two inner streams to the stream of the normal generator.

Definition at line 168 of file InverseGaussianProcessMSH.java.

◆ setOtherStream()

void umontreal.ssj.stochprocess.InverseGaussianProcessMSH.setOtherStream ( RandomStream otherStream)

Sets the otherStream, which is the stream used to choose between the two roots in the MSH method.

Definition at line 152 of file InverseGaussianProcessMSH.java.

◆ setStream() [1/2]

void umontreal.ssj.stochprocess.InverseGaussianProcessMSH.setStream ( RandomStream stream)

Sets both inner streams to stream.

Reimplemented from umontreal.ssj.stochprocess.InverseGaussianProcess.

Reimplemented in umontreal.ssj.stochprocess.InverseGaussianProcessBridge.

Definition at line 142 of file InverseGaussianProcessMSH.java.

◆ setStream() [2/2]

void umontreal.ssj.stochprocess.InverseGaussianProcessMSH.setStream ( RandomStream stream,
RandomStream otherStream )

Sets the streams.

Reimplemented in umontreal.ssj.stochprocess.InverseGaussianProcessBridge.

Definition at line 133 of file InverseGaussianProcessMSH.java.


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