Class VarianceGammaProcess
- java.lang.Object
-
- umontreal.iro.lecuyer.stochprocess.StochasticProcess
-
- umontreal.iro.lecuyer.stochprocess.VarianceGammaProcess
-
- Direct Known Subclasses:
- VarianceGammaProcessDiff
public class VarianceGammaProcess extends StochasticProcess
This class represents a variance gamma (VG) process {S(t) = X(t;θ, σ, ν) : t >= 0}. This process is obtained as a subordinate of the Brownian motion process B(t;θ, σ) using the operational time G(t;1, ν) (see): See also for applications to modelling asset returns and option pricing.The process is sampled as follows: when generatePath() is called, the method generatePath() of the inner
GammaProcessis called; its path is then used to set the observation times of theBrownianMotion. Finally, the method generatePath() of theBrownianMotionis called. Warning: If one wants to reduced the variance as much as possible in a QMC simulation, this way of proceeding is not optimal. Use the method generatePath(uniform01) instead.If one calls the nextObservation method, the operational time is generated first, followed by the corresponding brownian motion increment, which is then returned.
Note that if one wishes to use bridge sampling with the nextObservation method, both the gamma process G and the Brownian motion process B should use bridge sampling so that their observations are synchronized.
-
-
Constructor Summary
Constructors Constructor and Description VarianceGammaProcess()VarianceGammaProcess(double s0, BrownianMotion BM, GammaProcess Gamma)Constructs a new VarianceGammaProcess.VarianceGammaProcess(double s0, double theta, double sigma, double nu, RandomStream stream)Constructs a new VarianceGammaProcess with parameters θ =theta , σ =sigma , ν =nu and initial value S(t0) =s0 .
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]generatePath()Generates and returns the path.double[]generatePath(double[] uniform01)Similar to the usual generatePath(), but here the uniform random numbers used for the simulation must be provided to the method.BrownianMotiongetBrownianMotion()Returns a reference to the innerBrownianMotion.GammaProcessgetGammaProcess()Returns a reference to the innerGammaProcess.doublegetNu()Returns the value of the parameter ν.doublegetSigma()Returns the value of the parameter σ.RandomStreamgetStream()Returns the random stream of theBrownianMotionprocess, which should be the same as for theGammaProcess.doublegetTheta()Returns the value of the parameter θ.doublenextObservation()Generates the observation for the next time.voidresetStartProcess()Resets the observation index and counter to 0 and applies the resetStartProcess method to theBrownianMotionand theGammaProcessobjects used to generate this process.voidsetObservationTimes(double[] t, int d)Sets the observation times on the VarianceGammaProcess as usual, but also sets the observation times of the underlyingGammaProcess.voidsetParams(double s0, double theta, double sigma, double nu)Sets the parameters S(t0) = s0, θ = theta, σ = sigma and ν = nu of the process.voidsetStream(RandomStream stream)Resets theRandomStream's.-
Methods inherited from class umontreal.iro.lecuyer.stochprocess.StochasticProcess
generatePath, getArrayMappingCounterToIndex, getCurrentObservation, getCurrentObservationIndex, getNbObservationTimes, getObservation, getObservationTimes, getPath, getSubpath, getX0, hasNextObservation, setObservationTimes, setX0
-
-
-
-
Constructor Detail
-
VarianceGammaProcess
public VarianceGammaProcess()
-
VarianceGammaProcess
public VarianceGammaProcess(double s0, double theta, double sigma, double nu, RandomStream stream)Constructs a new VarianceGammaProcess with parameters θ =theta , σ =sigma , ν =nu and initial value S(t0) =s0 . stream is used to generate both theBrownianMotionB and theGammaProcessG in.
-
VarianceGammaProcess
public VarianceGammaProcess(double s0, BrownianMotion BM, GammaProcess Gamma)Constructs a new VarianceGammaProcess. The parameters θ and σ are set to the parameters μ and σ, respectively, of theBrownianMotionBM and the parameter ν is set to the parameter ν of theGammaProcessGamma. The parameters μ and x0 of theGammaProcessare overwritten to equal 1 and 0 respectively. The initial value of the process is S(t0) =
.
-
-
Method Detail
-
nextObservation
public double nextObservation()
Generates the observation for the next time. It also works with bridge sampling; however bothBrownianMotionBridgeandGammaProcessBridgemust be used in the constructor in that case. Furthermore, for bridge sampling, the order of the observations is that of the bridge, not sequential order.- Overrides:
nextObservationin classStochasticProcess
-
generatePath
public double[] generatePath()
Generates and returns the path. To do so, it first generates the complete path of the innerGammaProcessand sets the observation times of the innerBrownianMotionto this path. This method is not optimal to reduce the variance in QMC simulations; use generatePath(double[] uniform01) for that.- Specified by:
generatePathin classStochasticProcess
-
generatePath
public double[] generatePath(double[] uniform01)
Similar to the usual generatePath(), but here the uniform random numbers used for the simulation must be provided to the method. This allows to properly use the uniform random variates in QMC simulations. This method divides the table of uniform random numbers uniform01 in two smaller tables, the first one, containing the odd indices of uniform01 which are used to generate the path of the innerGammaProcess, and the even indices (in the second table) are used to generate the path of the innerBrownianMotion. This way of proceeding reduces the variance as much as possible for QMC simulations.
-
resetStartProcess
public void resetStartProcess()
Resets the observation index and counter to 0 and applies the resetStartProcess method to theBrownianMotionand theGammaProcessobjects used to generate this process.- Overrides:
resetStartProcessin classStochasticProcess
-
setParams
public void setParams(double s0, double theta, double sigma, double nu)Sets the parameters S(t0) = s0, θ = theta, σ = sigma and ν = nu of the process. Warning: This method will recompute some quantities stored internally, which may be slow if called repeatedly.
-
getTheta
public double getTheta()
Returns the value of the parameter θ.
-
getSigma
public double getSigma()
Returns the value of the parameter σ.
-
getNu
public double getNu()
Returns the value of the parameter ν.
-
setObservationTimes
public void setObservationTimes(double[] t, int d)Sets the observation times on the VarianceGammaProcess as usual, but also sets the observation times of the underlyingGammaProcess. It furthermore sets the starting value of theGammaProcessto t[0].- Overrides:
setObservationTimesin classStochasticProcess
-
setStream
public void setStream(RandomStream stream)
Resets theRandomStream's. Warning: this method sets both theRandomStreamof theBrownianMotionand of theGammaProcessto the sameRandomStream.- Specified by:
setStreamin classStochasticProcess
-
getStream
public RandomStream getStream()
Returns the random stream of theBrownianMotionprocess, which should be the same as for theGammaProcess.- Specified by:
getStreamin classStochasticProcess
-
getBrownianMotion
public BrownianMotion getBrownianMotion()
Returns a reference to the innerBrownianMotion.
-
getGammaProcess
public GammaProcess getGammaProcess()
Returns a reference to the innerGammaProcess.
-
-
DMelt 3.0 © DataMelt by jWork.ORG