umontreal.iro.lecuyer.stochprocess
Class NormalInverseGaussianProcess
- java.lang.Object
-
- umontreal.iro.lecuyer.stochprocess.StochasticProcess
-
- umontreal.iro.lecuyer.stochprocess.NormalInverseGaussianProcess
-
public class NormalInverseGaussianProcess extends StochasticProcess
This class represents a normal inverse gaussian process (NIG). It obeys the stochastic differential equation where {B(t), t >= 0} is aBrownianMotionwith drift β and variance 1, and h(t) is anInverseGaussianProcessIG(ν/γ, ν2), with ν = δdt and γ = (α^2 - β^2)1/2.In this class, the process is generated using the sequential technique: X(0) = x0 and
X(tj) - X(tj-1) = μdt + βYj + (Y_j)1/2Zj,where Zj∼N(0, 1), and Yj∼IG(ν/γ, ν2) with ν = δ(tj - tj-1).There is one
RandomStreamused to generate the Zj's and there are one or two streams used to generate the underlyingInverseGaussianProcess, depending on which IG subclass is used.In finance, a NIG process usually means that the log-return is given by a NIG process;
GeometricNormalInverseGaussianProcessshould be used in that case.
-
-
Constructor Summary
Constructors Constructor and Description NormalInverseGaussianProcess(double x0, double alpha, double beta, double mu, double delta, RandomStream streamBrownian, InverseGaussianProcess igP)Given anInverseGaussianProcessigP, constructs a new NormalInverseGaussianProcess.NormalInverseGaussianProcess(double x0, double alpha, double beta, double mu, double delta, RandomStream streamBrownian, RandomStream streamIG1, RandomStream streamIG2, java.lang.String igType)Constructs a new NormalInverseGaussianProcess.NormalInverseGaussianProcess(double x0, double alpha, double beta, double mu, double delta, RandomStream streamAll, java.lang.String igType)Same as above, but allRandomStream's are set to the same stream, streamAll.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]generatePath()Generates the path.doublegetAlpha()Returns alpha.doublegetAnalyticAverage(double time)Returns the analytic average, which is μt + δtβ/γ.doublegetAnalyticVariance(double time)Returns the analytic variance, which is δtα2/γ3.doublegetBeta()Returns beta.doublegetDelta()Returns delta.doublegetGamma()Returns gamma.doublegetMu()Returns mu.RandomStreamgetStream()Only returns the stream if all streams are equal, including the stream(s) in the underlyingInverseGaussianProcess.doublenextObservation()Returns the value of the process for the next time step.voidsetObservationTimes(double[] t, int d)Sets the observation times on the NIG process as usual, but also sets the observation times of the underlyingInverseGaussianProcess.voidsetParams(double x0, double alpha, double beta, double mu, double delta)Sets the parameters.voidsetStream(RandomStream stream)Sets all internal streams to stream, including the stream(s) of the underlyingInverseGaussianProcess.-
Methods inherited from class umontreal.iro.lecuyer.stochprocess.StochasticProcess
generatePath, getArrayMappingCounterToIndex, getCurrentObservation, getCurrentObservationIndex, getNbObservationTimes, getObservation, getObservationTimes, getPath, getSubpath, getX0, hasNextObservation, resetStartProcess, setObservationTimes, setX0
-
-
-
-
Constructor Detail
-
NormalInverseGaussianProcess
public NormalInverseGaussianProcess(double x0, double alpha, double beta, double mu, double delta, RandomStream streamBrownian, InverseGaussianProcess igP)Given anInverseGaussianProcessigP, 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 twoRandomStream's in theInverseGaussianProcess, this constructor assumes that both streams have been set to the same stream.
-
NormalInverseGaussianProcess
public NormalInverseGaussianProcess(double x0, double alpha, double beta, double mu, double delta, RandomStream streamBrownian, RandomStream streamIG1, RandomStream streamIG2, java.lang.String igType)Constructs a new NormalInverseGaussianProcess. The string argument corresponds to the type of underlyingInverseGaussianProcess. The choices are SEQUENTIAL_SLOW, SEQUENTIAL_MSH, BRIDGE and PCA, which correspond respectively toInverseGaussianProcess,InverseGaussianProcessMSH,InverseGaussianProcessBridgeandInverseGaussianProcessPCA. The thirdRandomStream, streamIG2, will not be used at all if the SEQUENTIAL_SLOW or PCA methods are chosen.
-
NormalInverseGaussianProcess
public NormalInverseGaussianProcess(double x0, double alpha, double beta, double mu, double delta, RandomStream streamAll, java.lang.String igType)Same as above, but allRandomStream's are set to the same stream, streamAll.
-
-
Method Detail
-
generatePath
public double[] 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 aPointSet.- Specified by:
generatePathin classStochasticProcess
-
nextObservation
public double nextObservation()
Returns the value of the process for the next time step. If the underlyingInverseGaussianProcessis of typeInverseGaussianProcessPCA, this method cannot be used. It will work withInverseGaussianProcessBridge, but the return order of the observations is the bridge order.- Overrides:
nextObservationin classStochasticProcess
-
setObservationTimes
public void setObservationTimes(double[] t, int d)Sets the observation times on the NIG process as usual, but also sets the observation times of the underlyingInverseGaussianProcess. It furthermore sets the starting value of theInverseGaussianProcessto t[0].- Overrides:
setObservationTimesin classStochasticProcess
-
setParams
public void setParams(double x0, double alpha, double beta, double mu, double delta)Sets the parameters. Also, computes γ = (α^2-β^2)1/2.
-
getAlpha
public double getAlpha()
Returns alpha.
-
getBeta
public double getBeta()
Returns beta.
-
getMu
public double getMu()
Returns mu.
-
getDelta
public double getDelta()
Returns delta.
-
getGamma
public double getGamma()
Returns gamma.
-
getAnalyticAverage
public double getAnalyticAverage(double time)
Returns the analytic average, which is μt + δtβ/γ.
-
getAnalyticVariance
public double getAnalyticVariance(double time)
Returns the analytic variance, which is δtα2/γ3.
-
getStream
public RandomStream getStream()
Only returns the stream if all streams are equal, including the stream(s) in the underlyingInverseGaussianProcess.- Specified by:
getStreamin classStochasticProcess
-
setStream
public void setStream(RandomStream stream)
Sets all internal streams to stream, including the stream(s) of the underlyingInverseGaussianProcess.- Specified by:
setStreamin classStochasticProcess
-
-
DMelt 3.0 © DataMelt by jWork.ORG