Class GARCHSim
- java.lang.Object
-
- dev.nm.stat.timeseries.linear.univariate.stationaryprocess.garch.GARCHSim
-
- All Implemented Interfaces:
RandomNumberGenerator
,Seedable
public class GARCHSim extends Object implements RandomNumberGenerator
This class simulates the GARCH models of this form. \[ h_t = \alpha_0 + \sum_{i=1}^{q} (\alpha_i e_{t-i}^2) + \sum_{i=1}^{p} (\beta_i h_{t-i}) \] p is the order of the GARCH terms ht-i; q is the order of the ARCH terms et-i2.
-
-
Constructor Summary
Constructors Constructor Description GARCHSim(GARCHModel model)
Simulate an GARCH model.GARCHSim(GARCHModel model, double[] z, RandomNumberGenerator rng)
Simulate an GARCH model.GARCHSim(GARCHModel model, RandomNumberGenerator rng)
Simulate an GARCH model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
nextDouble()
Get the next randomdouble
.Pair
nextPair()
Get the next random (e2_t, h_t).void
seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
GARCHSim
public GARCHSim(GARCHModel model, double[] z, RandomNumberGenerator rng)
Simulate an GARCH model.- Parameters:
model
- a GARCH modelz
- the innovations; size = qrng
- a random number generator
-
GARCHSim
public GARCHSim(GARCHModel model, RandomNumberGenerator rng)
Simulate an GARCH model. The innovations are initialized to 0.- Parameters:
model
- a GARCH modelrng
- a random number generator
-
GARCHSim
public GARCHSim(GARCHModel model)
Simulate an GARCH model. The innovations are initialized to 0.- Parameters:
model
- a GARCH model
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-
nextPair
public Pair nextPair()
Get the next random (e2_t, h_t).- Returns:
- the next random (e2_t, h_t)
-
-