umontreal.iro.lecuyer.stochprocess
Class InverseGaussianProcessMSH
- java.lang.Object
-
- umontreal.iro.lecuyer.stochprocess.StochasticProcess
-
- umontreal.iro.lecuyer.stochprocess.InverseGaussianProcess
-
- 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 byInverseGaussianProcess. It is about 60 times faster. However it requires twoRandomStream's instead of only one forInverseGaussianProcess. The second stream is called otherStream below and it is used to randomly choose between two roots at each time step.
-
-
Constructor Summary
Constructors Constructor and Description InverseGaussianProcessMSH(double s0, double delta, double gamma, RandomStream stream, RandomStream otherStream)Constructs a new InverseGaussianProcessMSH.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]generatePath()Generates the path.double[]generatePath(double[] uniforms01)Not implemented, requires twoRandomStream'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).NormalGengetNormalGen()Returns the normal generator.RandomStreamgetOtherStream()Returns the otherStream, which is the stream used to choose between the two quadratic roots from the MSH method.RandomStreamgetStream()Only returns a stream if both innerRandomStream's are the same.doublenextObservation()Generates and returns the next observation X(tj) of the stochastic process.voidsetNormalGen(NormalGen normalGen)Sets the normal generator.voidsetOtherStream(RandomStream otherStream)Sets the otherStream, which is the stream used to choose between the two roots in the MSH method.voidsetStream(RandomStream stream)Sets both inner streams to stream.voidsetStream(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
-
-
-
-
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 twoRandomStreams are sampled alternatively.- Overrides:
generatePathin classInverseGaussianProcess
-
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 forNormalInverseGaussianProcess.- Overrides:
generatePathin classInverseGaussianProcess
-
generatePath
public double[] generatePath(double[] uniforms01)
Not implemented, requires twoRandomStream's.- Overrides:
generatePathin classInverseGaussianProcess
-
nextObservation
public double nextObservation()
Description copied from class:StochasticProcessGenerates 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:
nextObservationin classInverseGaussianProcess
-
getStream
public RandomStream getStream()
Only returns a stream if both innerRandomStream's are the same.- Overrides:
getStreamin classInverseGaussianProcess
-
setStream
public void setStream(RandomStream stream, RandomStream otherStream)
Sets the streams.
-
setStream
public void setStream(RandomStream stream)
Sets both inner streams to stream.- Overrides:
setStreamin classInverseGaussianProcess
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG