SSJ
V. 2.6.

umontreal.iro.lecuyer.stochprocess
Class CIRProcess

java.lang.Object
  extended by umontreal.iro.lecuyer.stochprocess.StochasticProcess
      extended by umontreal.iro.lecuyer.stochprocess.CIRProcess

public class CIRProcess
extends StochasticProcess

This class represents a CIR (Cox, Ingersoll, Ross) process {X(t) : t >= 0}, sampled at times 0 = t0 < t1 < ... < td. This process obeys the stochastic differential equation

dX(t) = α(b - X(t))dt + σ(X(t))1/2 dB(t)

with initial condition X(0) = x0, where α, b and σ are positive constants, and {B(t), t >= 0} is a standard Brownian motion (with drift 0 and volatility 1). This process is mean-reverting in the sense that it always tends to drift toward its general mean b. The process is generated using the sequential technique

X(tj) = {σ2(1-e-α(tj-tj-1))/4α}χ′2ν({4αe-α(tj-tj-1)X(tj-1)}/{σ2(1-e-α(tj-tj-1))}),

where ν = 4/σ2, and χ′ 2ν(λ) is a noncentral chi-square random variable with ν degrees of freedom and noncentrality parameter λ.


Constructor Summary
CIRProcess(double x0, double alpha, double b, double sigma, ChiSquareNoncentralGen gen)
          The noncentral chi-square variate generator gen is specified directly instead of specifying the stream.
CIRProcess(double x0, double alpha, double b, double sigma, RandomStream stream)
          Constructs a new CIRProcess with parameters α = alpha, b, σ = sigma and initial value X(t0) = x0.
 
Method Summary
 double[] generatePath()
          Generates, returns, and saves the sample path {X(t0), X(t1),…, X(td)}.
 double[] generatePath(RandomStream stream)
          Same as generatePath(), but first resets the stream to stream.
 double getAlpha()
          Returns the value of α.
 double getB()
          Returns the value of b.
 ChiSquareNoncentralGen getGen()
          Returns the noncentral chi-square random variate generator used.
 double getSigma()
          Returns the value of σ.
 RandomStream getStream()
          Returns the random stream of the noncentral chi-square generator.
 double nextObservation()
          Generates and returns the next observation X(tj) of the stochastic process.
 double nextObservation(double nextTime)
          Generates and returns the next observation at time tj+1 = nextTime, using the previous observation time tj defined earlier (either by this method or by setObservationTimes), as well as the value of the previous observation X(tj).
 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.
 void setParams(double x0, double alpha, double b, double sigma)
          Resets the parameters X(t0) = x0, α = alpha, b = b and σ = sigma of the process.
 void setStream(RandomStream stream)
          Resets the random stream of the noncentral chi-square generator to stream.
 
Methods inherited from class umontreal.iro.lecuyer.stochprocess.StochasticProcess
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

CIRProcess

public CIRProcess(double x0,
                  double alpha,
                  double b,
                  double sigma,
                  RandomStream stream)
Constructs a new CIRProcess with parameters α = alpha, b, σ = sigma and initial value X(t0) = x0. The noncentral chi-square variates χ′2ν(λ) will be generated by inversion using the stream stream.


CIRProcess

public CIRProcess(double x0,
                  double alpha,
                  double b,
                  double sigma,
                  ChiSquareNoncentralGen gen)
The noncentral chi-square variate generator gen is specified directly instead of specifying the stream. gen can use a method other than inversion.

Method Detail

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 StochasticProcess

nextObservation

public double nextObservation(double nextTime)
Generates and returns the next observation at time tj+1 = nextTime, using the previous observation time tj defined earlier (either by this method or by setObservationTimes), as well as the value of the previous observation X(tj). Warning: This method will reset the observations time tj+1 for this process to nextTime. The user must make sure that the tj+1 supplied is  >= tj.


nextObservation

public 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. Uses the process parameters specified in the constructor. Note that this method does not affect the sample path of the process stored internally (if any).


generatePath

public double[] generatePath()
Description copied from class: StochasticProcess
Generates, returns, and saves the sample path {X(t0), X(t1),…, X(td)}. It can then be accessed via getPath, getSubpath, or getObservation. The generation method depends on the process type.

Specified by:
generatePath in class StochasticProcess

generatePath

public double[] generatePath(RandomStream stream)
Description copied from class: StochasticProcess
Same as generatePath(), but first resets the stream to stream.

Overrides:
generatePath in class StochasticProcess

setParams

public void setParams(double x0,
                      double alpha,
                      double b,
                      double sigma)
Resets the parameters X(t0) = x0, α = alpha, b = b and σ = sigma of the process. Warning: This method will recompute some quantities stored internally, which may be slow if called too frequently.


setStream

public void setStream(RandomStream stream)
Resets the random stream of the noncentral chi-square generator to stream.

Specified by:
setStream in class StochasticProcess

getStream

public RandomStream getStream()
Returns the random stream of the noncentral chi-square generator.

Specified by:
getStream in class StochasticProcess

getAlpha

public double getAlpha()
Returns the value of α.


getB

public double getB()
Returns the value of b.


getSigma

public double getSigma()
Returns the value of σ.


getGen

public ChiSquareNoncentralGen getGen()
Returns the noncentral chi-square random variate generator used. The RandomStream used for that generator can be changed via getGen().setStream(stream), for example.


SSJ
V. 2.6.

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