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

This class represents a normal inverse gaussian process (NIG). More...

Inheritance diagram for umontreal.ssj.stochprocess.NormalInverseGaussianProcess:
umontreal.ssj.stochprocess.StochasticProcess

Public Member Functions

 NormalInverseGaussianProcess (double x0, double alpha, double beta, double mu, double delta, RandomStream streamBrownian, InverseGaussianProcess igP)
 Given an InverseGaussianProcess igP, constructs a new NormalInverseGaussianProcess.
 NormalInverseGaussianProcess (double x0, double alpha, double beta, double mu, double delta, RandomStream streamBrownian, RandomStream streamIG1, RandomStream streamIG2, String igType)
 Constructs a new NormalInverseGaussianProcess.
 NormalInverseGaussianProcess (double x0, double alpha, double beta, double mu, double delta, RandomStream streamAll, String igType)
 Same as above, but all umontreal.ssj.rng.RandomStream ’s are set to the same stream, streamAll.
double[] generatePath ()
 Generates the path.
double nextObservation ()
 Returns the value of the process for the next time step.
void setObservationTimes (double t[], int d)
 Sets the observation times on the NIG process as usual, but also sets the observation times of the underlying InverseGaussianProcess.
void setParams (double x0, double alpha, double beta, double mu, double delta)
 Sets the parameters.
double getAlpha ()
 Returns alpha.
double getBeta ()
 Returns beta.
double getMu ()
 Returns mu.
double getDelta ()
 Returns delta.
double getGamma ()
 Returns gamma.
double getAnalyticAverage (double time)
 Returns the analytic average, which is \(\mu t + \delta t \beta/ \gamma\).
double getAnalyticVariance (double time)
 Returns the analytic variance, which is \(\delta t \alpha^2 / \gamma^3\).
RandomStream getStream ()
 Only returns the stream if all streams are equal, including the stream(s) in the underlying InverseGaussianProcess.
void setStream (RandomStream stream)
 Sets all internal streams to stream, including the stream(s) of the underlying InverseGaussianProcess.
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)\}\).
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

This class represents a normal inverse gaussian process (NIG).

It obeys the stochastic differential equation [14]

\[ dX(t) = \mu dt + dB(h(t)), \tag{nig} \]

where \(\{B(t),  t\ge0\}\) is a BrownianMotion with drift \(\beta\) and variance 1, and \(h(t)\) is an InverseGaussianProcess \(IG(\nu/\gamma,\nu^2)\), with \(\nu= \delta dt\) and \(\gamma= \sqrt{\alpha^2 - \beta^2}\).

In this class, the process is generated using the sequential technique: \(X(0)=x_0\) and

\[ X(t_j) - X(t_{j-1}) =\mu dt + \beta Y_j + \sqrt{Y_j} Z_j, \]

where \(Z_j \sim N(0,1)\), and \(Y_j \sim IG(\nu/\gamma,\nu^2)\) with \(\nu= \delta(t_j - t_{j-1})\).

There is one umontreal.ssj.rng.RandomStream used to generate the \(Z_j\)’s and there are one or two streams used to generate the underlying InverseGaussianProcess, depending on which IG subclass is used.

In finance, a NIG process usually means that the log-return is given by a NIG process; GeometricNormalInverseGaussianProcess should be used in that case.

Definition at line 61 of file NormalInverseGaussianProcess.java.

Constructor & Destructor Documentation

◆ NormalInverseGaussianProcess() [1/3]

umontreal.ssj.stochprocess.NormalInverseGaussianProcess.NormalInverseGaussianProcess ( double x0,
double alpha,
double beta,
double mu,
double delta,
RandomStream streamBrownian,
InverseGaussianProcess igP )

Given an InverseGaussianProcess igP, constructs a new NormalInverseGaussianProcess.

The parameters and observation times of the IG process will be overriden by the parameters of the NIG process. If there are two umontreal.ssj.rng.RandomStream ’s in the InverseGaussianProcess, this constructor assumes that both streams have been set to the same stream.

Definition at line 88 of file NormalInverseGaussianProcess.java.

◆ NormalInverseGaussianProcess() [2/3]

umontreal.ssj.stochprocess.NormalInverseGaussianProcess.NormalInverseGaussianProcess ( double x0,
double alpha,
double beta,
double mu,
double delta,
RandomStream streamBrownian,
RandomStream streamIG1,
RandomStream streamIG2,
String igType )

Constructs a new NormalInverseGaussianProcess.

The string argument corresponds to the type of underlying

InverseGaussianProcess. The choices are SEQUENTIAL_SLOW, SEQUENTIAL_MSH, BRIDGE and PCA, which correspond respectively to InverseGaussianProcess, InverseGaussianProcessMSH, InverseGaussianProcessBridge and InverseGaussianProcessPCA. The third umontreal.ssj.rng.RandomStream, streamIG2, will not be used at all if the SEQUENTIAL_SLOW or PCA methods are chosen.

Definition at line 110 of file NormalInverseGaussianProcess.java.

◆ NormalInverseGaussianProcess() [3/3]

umontreal.ssj.stochprocess.NormalInverseGaussianProcess.NormalInverseGaussianProcess ( double x0,
double alpha,
double beta,
double mu,
double delta,
RandomStream streamAll,
String igType )

Same as above, but all umontreal.ssj.rng.RandomStream ’s are set to the same stream, streamAll.

Definition at line 138 of file NormalInverseGaussianProcess.java.

Member Function Documentation

◆ generatePath()

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

Generates the path.

This method samples each stream alternatively, which is useful for quasi-Monte Carlo, where all streams are in fact the same iterator on a umontreal.ssj.hups.PointSet.

Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.

Definition at line 148 of file NormalInverseGaussianProcess.java.

◆ getAlpha()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getAlpha ( )

Returns alpha.

Definition at line 263 of file NormalInverseGaussianProcess.java.

◆ getAnalyticAverage()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getAnalyticAverage ( double time)

Returns the analytic average, which is \(\mu t + \delta t \beta/ \gamma\).

Definition at line 298 of file NormalInverseGaussianProcess.java.

◆ getAnalyticVariance()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getAnalyticVariance ( double time)

Returns the analytic variance, which is \(\delta t \alpha^2 / \gamma^3\).

Definition at line 305 of file NormalInverseGaussianProcess.java.

◆ getBeta()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getBeta ( )

Returns beta.

Definition at line 270 of file NormalInverseGaussianProcess.java.

◆ getDelta()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getDelta ( )

Returns delta.

Definition at line 284 of file NormalInverseGaussianProcess.java.

◆ getGamma()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getGamma ( )

Returns gamma.

Definition at line 291 of file NormalInverseGaussianProcess.java.

◆ getMu()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.getMu ( )

Returns mu.

Definition at line 277 of file NormalInverseGaussianProcess.java.

◆ getStream()

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

Only returns the stream if all streams are equal, including the stream(s) in the underlying InverseGaussianProcess.

Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.

Definition at line 313 of file NormalInverseGaussianProcess.java.

◆ nextObservation()

double umontreal.ssj.stochprocess.NormalInverseGaussianProcess.nextObservation ( )

Returns the value of the process for the next time step.

If the underlying

InverseGaussianProcess is of type InverseGaussianProcessPCA, this method cannot be used. It will work with InverseGaussianProcessBridge, but the return order of the observations is the bridge order.

Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.

Definition at line 200 of file NormalInverseGaussianProcess.java.

◆ setObservationTimes()

void umontreal.ssj.stochprocess.NormalInverseGaussianProcess.setObservationTimes ( double t[],
int d )

Sets the observation times on the NIG process as usual, but also sets the observation times of the underlying InverseGaussianProcess.

It furthermore sets the starting value of the InverseGaussianProcess to t[0].

Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.

Definition at line 231 of file NormalInverseGaussianProcess.java.

◆ setParams()

void umontreal.ssj.stochprocess.NormalInverseGaussianProcess.setParams ( double x0,
double alpha,
double beta,
double mu,
double delta )

Sets the parameters.

Also, computes \(\gamma= \sqrt{\alpha^2-\beta^2}\).

Definition at line 240 of file NormalInverseGaussianProcess.java.

◆ setStream()

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

Sets all internal streams to stream, including the stream(s) of the underlying InverseGaussianProcess.

Reimplemented from umontreal.ssj.stochprocess.StochasticProcess.

Definition at line 324 of file NormalInverseGaussianProcess.java.


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