SSJ
V. 2.6.

umontreal.iro.lecuyer.stochprocess
Class InverseGaussianProcessMSH

java.lang.Object
  extended by umontreal.iro.lecuyer.stochprocess.StochasticProcess
      extended by umontreal.iro.lecuyer.stochprocess.InverseGaussianProcess
          extended by umontreal.iro.lecuyer.stochprocess.InverseGaussianProcessMSH
Direct Known Subclasses:
InverseGaussianProcessBridge

public class InverseGaussianProcessMSH
extends InverseGaussianProcess

Uses a faster generating method (MSH) than the simple inversion of the distribution function used by InverseGaussianProcess. It is about 60 times faster. However it requires two 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.


Constructor Summary
InverseGaussianProcessMSH(double s0, double delta, double gamma, RandomStream stream, RandomStream otherStream)
          Constructs a new InverseGaussianProcessMSH.
 
Method Summary
 double[] generatePath()
          Generates the path.
 double[] generatePath(double[] uniforms01)
          Not implemented, requires two RandomStream's.
 double[] generatePath(double[] unifNorm, double[] unifOther)
          Instead of using the internal streams to generate the path, uses two arrays of uniforms U[0, 1).
 NormalGen getNormalGen()
          Returns the normal generator.
 RandomStream getOtherStream()
          Returns the otherStream, which is the stream used to choose between the two quadratic roots from the MSH method.
 RandomStream getStream()
          Only returns a stream if both inner RandomStream's are the same.
 double nextObservation()
          Generates and returns the next observation X(tj) of the stochastic process.
 void setNormalGen(NormalGen normalGen)
          Sets the normal generator.
 void setOtherStream(RandomStream otherStream)
          Sets the otherStream, which is the stream used to choose between the two roots in the MSH method.
 void setStream(RandomStream stream)
          Sets both inner streams to stream.
 void setStream(RandomStream stream, RandomStream otherStream)
          Sets the streams.
 
Methods inherited from class umontreal.iro.lecuyer.stochprocess.InverseGaussianProcess
getAnalyticAverage, getAnalyticVariance, getDelta, getGamma, getNumberOfRandomStreams, setParams
 
Methods inherited from class umontreal.iro.lecuyer.stochprocess.StochasticProcess
generatePath, getArrayMappingCounterToIndex, getCurrentObservation, getCurrentObservationIndex, getNbObservationTimes, getObservation, getObservationTimes, getPath, getSubpath, getX0, hasNextObservation, resetStartProcess, setObservationTimes, setObservationTimes, setX0
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InverseGaussianProcessMSH

public 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.

Method Detail

generatePath

public double[] generatePath()
Generates the path. It is done by successively calling nextObservation(), therefore the two RandomStreams are sampled alternatively.

Overrides:
generatePath in class InverseGaussianProcess

generatePath

public double[] 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.

Overrides:
generatePath in class InverseGaussianProcess

generatePath

public double[] generatePath(double[] uniforms01)
Not implemented, requires two RandomStream's.

Overrides:
generatePath in class InverseGaussianProcess

nextObservation

public double nextObservation()
Description copied from class: StochasticProcess
Generates and returns the next observation X(tj) of the stochastic process. The processes are usually sampled sequentially, i.e. if the last observation generated was for time tj-1, the next observation returned will be for time tj. In some cases, subclasses extending this abstract class may use non-sequential sampling algorithms (such as bridge sampling). The order of generation of the tj's is then specified by the subclass. All the processes generated using principal components analysis (PCA) do not have this method.

Overrides:
nextObservation in class InverseGaussianProcess

getStream

public RandomStream getStream()
Only returns a stream if both inner RandomStream's are the same.

Overrides:
getStream in class InverseGaussianProcess

setStream

public void setStream(RandomStream stream,
                      RandomStream otherStream)
Sets the streams.


setStream

public void setStream(RandomStream stream)
Sets both inner streams to stream.

Overrides:
setStream in class InverseGaussianProcess

setOtherStream

public void setOtherStream(RandomStream otherStream)
Sets the otherStream, which is the stream used to choose between the two roots in the MSH method.


getOtherStream

public RandomStream getOtherStream()
Returns the otherStream, which is the stream used to choose between the two quadratic roots from the MSH method.


setNormalGen

public void setNormalGen(NormalGen normalGen)
Sets the normal generator. It also sets one of the two inner streams to the stream of the normal generator.


getNormalGen

public NormalGen getNormalGen()
Returns the normal generator.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.