Class GARCHModel
- java.lang.Object
-
- dev.nm.stat.timeseries.linear.univariate.stationaryprocess.garch.GARCHModel
-
- Direct Known Subclasses:
GARCH11Model
public class GARCHModel extends Object
The GARCH(p, q) model takes 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.- See Also:
- Wikipedia: GARCH
-
-
Constructor Summary
Constructors Constructor Description GARCHModel(double a0, double[] a, double[] b)
Construct a GARCH model.GARCHModel(GARCHModel that)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
a0()
Get the constant term.double[]
alpha()
Get the ARCH coefficients.double[]
beta()
Get the GARCH coefficients.int
maxPQ()
Get the maximum of the ARCH length or GARCH length.int
p()
Get the number of GARCH terms.int
q()
Get the number of ARCH terms.double
sigma2(double[] e2, double[] sigma2_lag)
Compute the conditional variance based on the past information.String
toString()
double
var()
Compute the unconditional variance of the GARCH model.
-
-
-
Constructor Detail
-
GARCHModel
public GARCHModel(double a0, double[] a, double[] b)
Construct a GARCH model.- Parameters:
a0
- the constant terma
- the ARCH coefficientsb
- the GARCH coefficients
-
GARCHModel
public GARCHModel(GARCHModel that)
Copy constructor.- Parameters:
that
- a GARCH model
-
-
Method Detail
-
a0
public double a0()
Get the constant term.- Returns:
- the constant term
-
alpha
public double[] alpha()
Get the ARCH coefficients.- Returns:
- the ARCH coefficients; could be
null
-
beta
public double[] beta()
Get the GARCH coefficients.- Returns:
- the GARCH coefficients; could be
null
-
p
public int p()
Get the number of GARCH terms.- Returns:
- the number of GARCH terms
-
q
public int q()
Get the number of ARCH terms.- Returns:
- the number of ARCH terms
-
maxPQ
public int maxPQ()
Get the maximum of the ARCH length or GARCH length.- Returns:
- max(# ARCH terms, # GARCH terms)
-
var
public double var()
Compute the unconditional variance of the GARCH model.- Returns:
- the unconditional variance
-
sigma2
public double sigma2(double[] e2, double[] sigma2_lag)
Compute the conditional variance based on the past information.- Parameters:
e2
- the last q squared observationssigma2_lag
- the last p conditional variances- Returns:
- the conditional variance, h(t | Ft)
-
-