|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.stat.GARCH
public class GARCH
Computes estimates of the parameters of a GARCH(p,q) model.
The Generalized Autoregressive Conditional Heteroskedastic (GARCH) model is defined as
where 's are independent and identically distributed standard normal random variables,
and
The above model is denoted as GARCH(p, q). The p is the autoregressive lag and the q is the moving average lag. When , the above model reduces to ARCH(q) which was proposed by Engle (1982). The nonnegativity conditions on the parameters implied a nonnegative variance and the condition on the sum of the 's and '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 with length m is
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
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,
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
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).
Nested Class Summary | |
---|---|
static class |
GARCH.ConstrInconsistentException
The equality constraints are inconsistent. |
static class |
GARCH.EqConstrInconsistentException
The equality constraints and the bounds on the variables are found to be inconsistent. |
static class |
GARCH.NoVectorXException
No vector X satisfies all of the constraints. |
static class |
GARCH.TooManyIterationsException
Number of function evaluations exceeded 1000. |
static class |
GARCH.VarsDeterminedException
The variables are determined by the equality constraints. |
Constructor Summary | |
---|---|
GARCH(int p,
int q,
double[] y,
double[] xguess)
Constructor for GARCH . |
Method Summary | |
---|---|
void |
compute()
Computes estimates of the parameters of a GARCH(p,q) model. |
double |
getAkaike()
Returns the value of Akaike Information Criterion evaluated at the estimated parameter array. |
double[] |
getAR()
Returns the estimated values of autoregressive (AR) parameters. |
double |
getLogLikelihood()
Returns the value of Log-likelihood function evaluated at the estimated parameter array. |
double[] |
getMA()
Returns the estimated values of moving average (MA) parameters. |
double |
getSigma()
Returns the estimated value of sigma squared. |
double[][] |
getVarCovarMatrix()
Returns the variance-covariance matrix. |
double[] |
getX()
Returns the estimated parameter array, x . |
void |
setMaxSigma(double maxSigma)
Sets the value of the upperbound on the first element (sigma) of the array of returned estimated coefficients. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GARCH(int p, int q, double[] y, double[] xguess)
GARCH
.
p
- An int
scalar containing the number of
autoregressive (AR) parameters.q
- An int
scalar containing the number of moving
average (MA) parameters.y
- A double
array containing the observed time
series data.xguess
- A double
array of length
p
+ q
+ 1 containing the
initial values for the parameter array.
IllegalArgumentException
- is thrown if the dimensions of
y
, and xguess
are not consistent.Method Detail |
---|
public final void compute() throws GARCH.ConstrInconsistentException, GARCH.EqConstrInconsistentException, GARCH.NoVectorXException, GARCH.TooManyIterationsException, GARCH.VarsDeterminedException
GARCH.EqConstrInconsistentException
- 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.
GARCH.ConstrInconsistentException
public double getAkaike()
compute
method
must be invoked first before invoking this method. Otherwise, the
return value is 0
.
double
scalar containing the value of
Akaike Information Criterion evaluated at the estimated
parameter array.public double[] getAR()
compute
method must be invoked first before
invoking this method. Otherwise, the method throws a
NullPointerException
exception.
double
array of size p
containing the estimated values of autoregressive (AR)
parameters.public double getLogLikelihood()
compute
method must be
invoked first before invoking this method. Otherwise, the return value
is 0
.
double
scalar containing the value of
Log-likelihood function evaluated at the estimated
parameter array.public double[] getMA()
compute
method must be invoked first before
invoking this method. Otherwise, the method throws a
NullPointerException
exception.
double
array of size q
containing the estimated values of moving average (MA)
parameters.public double getSigma()
compute
method must be invoked first before invoking this
method. Otherwise, the return value is NaN
.
double
scalar containing the estimated
value of sigma squared.public double[][] getVarCovarMatrix()
compute
method must be invoked first before invoking this method. Otherwise,
the method throws a NullPointerException
exception.
double
matrix of size p + q + 1
by p + q + 1
containing the
variance-covariance matrix.public double[] getX()
x
. Note that the
compute
method must be invoked first before invoking this
method. Otherwise, the method throws a NullPointerException
exception.
double
array of size p + q + 1
containing the estimated values of sigma squared, the AR
parameters, and the MA parameters.public void setMaxSigma(double maxSigma)
maxSigma
- A double
scalar containing the value of
the upperbound on the first element (sigma) of the
array of returned estimated coefficients. Default = 10.
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |