Class GARCH
- All Implemented Interfaces:
Serializable,Cloneable
The Generalized Autoregressive Conditional Heteroskedastic (GARCH) model is defined as
$$ y_t = z_t \sigma _t$$
$$\sigma _t^2 = \sigma ^2 + \sum\limits_{i = 1}^p {\beta _i \sigma _{t - i}^2 + } \sum\limits_{i = 1}^q {\alpha _i y_{t - i}^2 }$$
where \(z_t\)'s are independent and identically distributed standard normal random variables,
$$\sigma > 0,\beta _i \ge 0,\alpha _i \ge 0{\rm{ }}$$
and
$$\sum\limits_{i = 1}^p {\beta _i } + \sum\limits_{i = 1}^q {\alpha _i} \lt 1$$
The above model is denoted as GARCH(p, q). The \( \alpha_i, i=1,\ldots,q \) and the \( \beta_j, j=1,\ldots,p \) parameters will be called the ARCH and GARCH coefficients, respectively. When \(\beta_i = 0, i = 1,2,\ldots, p\), the above model reduces to ARCH(q) which was proposed by Engle (1982). That is, a GARCH(0,q) is equivalent to the ARCH(q) model. The non-negativity conditions on the parameters imply a nonnegative variance and the condition on the sum of the \(\beta_i\)'s and \(\alpha_i\)'s is required for wide sense stationarity.
In the empirical analysis of observed data, GARCH(1,1) or GARCH(1,2) models have often found to appropriately account for conditional heteroskedasticity (Palm 1996). This finding is similar to linear time series analysis based on ARMA models.
It is important to notice that for the above models positive and negative past values have a symmetric impact on the conditional variance. In practice, many series may have strong asymmetric influence on the conditional variance. To take into account this phenomena, Nelson (1991) put forward Exponential GARCH (EGARCH). Lai (1998) proposed and studied some properties of a general class of models that extended linear relationship of the conditional variance in ARCH and GARCH into nonlinear fashion.
The maximal likelihood method is used in estimating the parameters in GARCH(p,q). The log-likelihood of the model for the observed series \(\left\{ {Y_t} \right\}\) with length m is
$$\log (L) = \frac{m}{2}\log (2\pi ) - \frac{1}{2}\sum\limits_{t = 1}^m {y_t^2 /\sigma _t^2 - \frac{1}{2}\sum\limits_{t = 1}^m {\log \sigma _t^2 } } ,$$
$${\rm{where}} \,\,\, \sigma _t^2 = \sigma ^2 + \sum\limits_{i = 1}^p {\beta _i \sigma _{t - i}^2 } + \sum\limits_{i = 1}^q {\alpha _i y_{t - i}^2 } .$$
In the model, if q = 0, the model GARCH is singular such that the estimated Hessian matrix H is singular.
The initial values of the parameter array \(x[\,\,]\)
entered in array xguess[ ] must satisfy certain constraints.
The first element of xguess refers to sigma and must be greater
than zero and less than maxSigma. The remaining
p+q initial values must each be greater than or equal
to zero but less than one.
To guarantee stationarity in model fitting,
$$\sum\limits_{i = 1}^{p + q} {x(i)} \lt 1,$$
is checked internally. The initial values should be selected from the values between zero and one. The value of Akaike Information Criterion is computed by
$${\rm{ 2 \times log (L) + 2 \times (p + q + 1),}}$$
where log(L) is the value of the log-likelihood function at the estimated parameters.
In fitting the optimal model, the class
MinConGenLin,
is modified to find the maximal likelihood estimates
of the parameters in the model. Statistical inferences can be performed
outside of the class GARCH based on the output of the
log-likelihood function (getlogLikelihood method), the Akaike
Information Criterion (getAkaike method), and the variance-covariance
matrix (getVarCovarMatrix method).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe equality constraints are inconsistent.static classThe equality constraints and the bounds on the variables are found to be inconsistent.static classNo vector X satisfies all of the constraints.static classNumber of function evaluations exceeded 1000.static classThe variables are determined by the equality constraints. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcompute()Computes estimates of the parameters of a GARCH(p,q) model.doubleReturns the value of Akaike Information Criterion evaluated at the estimated parameter array.double[]getAR()Deprecated.double[]getARCH()Returns the estimated values of the ARCH coefficients.double[]getGARCH()Returns the estimated values of the GARCH coefficients.doubleReturns the value of Log-likelihood function evaluated at the estimated parameter array.double[]getMA()Deprecated.UsegetARCH()instead.doublegetSigma()Returns the estimated value of sigma squared.double[][]Returns the variance-covariance matrix.double[]getX()Returns the estimated parameter array,x.voidsetMaxSigma(double maxSigma) Sets the value of the upperbound on the first element (sigma) of the array of returned estimated coefficients.
-
Constructor Details
-
GARCH
public GARCH(int p, int q, double[] y, double[] xguess) Constructor forGARCH.- Parameters:
p- Anintscalar containing the number of GARCH parameters.q- Anintscalar containing the number of ARCH parameters.y- Adoublearray containing the observed time series data.xguess- Adoublearray of lengthp+q+ 1 containing the initial values for the parameter array.- Throws:
IllegalArgumentException- is thrown if the dimensions ofy, andxguessare not consistent.
-
-
Method Details
-
compute
public final void compute() throws GARCH.ConstrInconsistentException, GARCH.EqConstrInconsistentException, GARCH.NoVectorXException, GARCH.TooManyIterationsException, GARCH.VarsDeterminedExceptionComputes estimates of the parameters of a GARCH(p,q) model.- Throws:
GARCH.ConstrInconsistentException- is thrown if the equality constraints are inconsistent.GARCH.EqConstrInconsistentException- is thrown if the equality constraints and the bounds on the variables are found to be inconsistent.GARCH.NoVectorXException- is thrown if no vector X satisfies all of the constraints.GARCH.TooManyIterationsException- is thrown if the number of function evaluations exceeded 1000.GARCH.VarsDeterminedException- is thrown if the variables are determined by the equality constraints.
-
setMaxSigma
public void setMaxSigma(double maxSigma) Sets the value of the upperbound on the first element (sigma) of the array of returned estimated coefficients.- Parameters:
maxSigma- Adoublescalar containing the value of the upperbound on the first element (sigma) of the array of returned estimated coefficients. Default = 10.
-
getSigma
public double getSigma()Returns the estimated value of sigma squared. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the return value isNaN.- Returns:
- a
doublescalar containing the estimated value of sigma squared.
-
getAR
Deprecated.UsegetGARCH()instead.Returns the estimated values of autoregressive (AR) parameters. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the method throws aNullPointerExceptionexception.- Returns:
- a
doublearray of sizepcontaining the estimated values of autoregressive (AR) parameters.
-
getGARCH
public double[] getGARCH()Returns the estimated values of the GARCH coefficients. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the method throws aNullPointerExceptionexception.- Returns:
- a
doublearray of sizepcontaining the estimated values of autoregressive (GARCH) parameters.
-
getMA
Deprecated.UsegetARCH()instead.Returns the estimated values of the ARCH coefficients. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the method throws aNullPointerExceptionexception.- Returns:
- a
doublearray of sizeqcontaining the estimated values of the ARCH coefficients.
-
getARCH
public double[] getARCH()Returns the estimated values of the ARCH coefficients. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the method throws aNullPointerExceptionexception.- Returns:
- a
doublearray of sizeqcontaining the estimated values of the moving average (ARCH) coefficients.
-
getVarCovarMatrix
public double[][] getVarCovarMatrix()Returns the variance-covariance matrix. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the method throws aNullPointerExceptionexception.- Returns:
- a
doublematrix of sizep + q + 1byp + q + 1containing the variance-covariance matrix.
-
getAkaike
public double getAkaike()Returns the value of Akaike Information Criterion evaluated at the estimated parameter array. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the return value is0.- Returns:
- a
doublescalar containing the value of Akaike Information Criterion evaluated at the estimated parameter array.
-
getLogLikelihood
public double getLogLikelihood()Returns the value of Log-likelihood function evaluated at the estimated parameter array. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the return value is0.- Returns:
- a
doublescalar containing the value of Log-likelihood function evaluated at the estimated parameter array.
-
getX
public double[] getX()Returns the estimated parameter array,x. Note that thecomputemethod must be invoked first before invoking this method. Otherwise, the method throws aNullPointerExceptionexception.- Returns:
- a
doublearray of size1 + q + pcontaining the estimated values of sigma squared, the ARCH parameters, and the GARCH parameters.
-
getGARCH()instead.