GARCH Instruction |
GARCH( options ) start end list of series
# list of explanatory variables for mean equation (in Regression Format)
# extra explanatory variables for variance equation (in Regression Format)
GARCH estimates univariate and multivariate ARCH and GARCH models. You can also estimate ARCH and GARCH models using MAXIMIZE. However, for any model that GARCH supports, you will probably find it more convenient to use GARCH. Also, because the GARCH command is specifically designed for these models, it will usually run much faster than MAXIMIZE—approximately four times faster on average.
Wizard
You can use Time Series—ARCH/GARCH(Univariate) or Time Series—ARCH/GARCH Wizard(Multivariate) to estimate a variety of ARCH and GARCH models. Note that the wizards do not include all of the options available on the GARCH instruction.
Parameters
start,end |
Range to use in estimation. If you have not set a SMPL, this defaults to the largest common range for all the variables involved. |
list of series |
list of one or more dependent variables |
ARCH/GARCH Options—Apply to All Models
P=number of GARCH (lagged variance) terms [0]
Q=number of ARCH (lagged residual squared terms or analogous) [0]
These specify the order of the GARCH(p,q) or ARCH(q) model.
MEAN/NOMEAN[default is MEAN unless you use REGRESSORS]
MEAN includes a constant term in the mean equation(s). Use NOMEAN if you don’t want any mean terms at all. To supply your own mean equation(s), use REGRESSORS or EQUATION for univariate models, or MODEL for multivariate models.
XREGRESSORS/[NOXREGRESSORS]
Use this if you want some exogenous shift variables in the variance equation. If you use it, include them on a supplementary card. If you are also using the REGRESSORS option, the XREGRESSORS are on a second card. For multivariate models, the same set of regressors are included in all variance equations.
DISTRIB=[NORMAL]/T/GED
SHAPEPARM=input value for shape parameter for t or GED [estimated]
The assumed distribution of the error process, Normal, t (Student) or Generalized Error Distribution. If using T or GED, you can use SHAPEPARM to provide your own value for the shape parameter. If you don’t, it will be estimated.
ASYMMETRIC/[NOASYMMETRIC]
ASYMMETRIC includes an asymmetry term. For a standard GARCH model, this will give you the GJR (Glosten, Jagannathan, Runkle (1993)) model. This can be used with all of the supported univariate and multivariate models.
HADJUST=FRML to be evaluated after variance calculation
UADJUST=FRML to be evaluated after resdiual calculation
These options allow "on-the-fly" calculations using current variances or residuals, respectively. These simplify the coding for many types of GARCH-M and related models. If you use HADJUST, the variances at entry T are computed first, and then the HADJUST expression is computed based on those updated variances. RATS then computes the time T residuals, and if there is a UADJUST option, that expression is evaluated, using the updated variances and residuals. The options work with both univariate and multivariate models, and you can include the variances and residuals in the expression by referencing the variable names supplied on the HSERIES or HMATRICES (variances) and RESIDS or RVECTORS (residuals) options.
CONDITION/[NOCONDITION]
If CONDITION, GARCH conditions on the required lagged residuals rather than assigning them the presample values.
I=NODRIFT/DRIFT [not used]
The I option does an IGARCH model, where the "GARCH" coefficients (all a's and b's) sum to one (for multivariate, each component is constrained separately). With I=NODRIFT, the constant term in the variance is constrained to zero. With I=DRIFT, those constant terms are estimated. This cannot be used with MV=BEKK or MV=VECH.
PRESAMPLE=SYMMETRIC matrix of pre-sample values
Use this to supply pre-sample values for the lagged variances and lagged squared residuals. For a univariate model, you can do PRESAMPLE=value.
LIKELIHOOD=(output)SERIES of log likelihood elements
Use this to save the entry by entry log likelihood values.
ARCH/GARCH Options—Univariate Models Only
REGRESSORS/[NOREGRESSORS]
EQUATION=equation form to use for the mean
By default, the mean equation for the dependent variable is just a single parameter for a time-invariant mean. If you want any other mean equation, use the REGRESSORS option, and include all the regressors (including the CONSTANT if needed) on a supplementary card. As an alternative to REGRESSORS, you can use the EQUATION option to provide an equation that you’ve already defined.
EXPONENTIAL/[NOEXPONENTIAL]
Use EXPONENTIAL if you want to do the E-GARCH model of Nelson (1991) or a generalization of it.
HSERIES=SERIES of estimated variances (univariate)
RESIDS=SERIES of (non-standardized) residuals (univariate)
If estimating a univariate model, you can use the HSERIES and RESIDS options to save the estimated variances and residuals, respectively, into SERIES.
ARCH/GARCH Options—Multivariate Models Only
MV=[STANDARD]/BEKK/DIAG/CC/DCC/VECH/ADCC/EWMA/TBEKK/DBEKK/CHOLESKY
Chooses the form for a multivariate model. The default is the standard multivariate GARCH model (sometimes known as the DVECH).
BEKK gives the BEKK formulation (also sometimes called BEK or EK), which imposes positive-definiteness on the covariance matrix. DBEKK (diagonal BEKK) restricts the lagged variance and residual terms to have diagonal multiplying matrices. TBEKK (triangular BEKK) restricts the lagged variances and residuals so the front multiplier matrix is lower triangular (the results will depend on variable order).
VECH estimates the VECH model. EWMA implements an exponentially weighted moving average model—an IGARCH model with a single parameter applying to all components.
The other choices are restricted covariance models. DIAGONAL estimates separate univariate GARCH models for each dependent variable, so the covariances are restricted to zero. CC gives the Constant Correlation model, DCC implements the Dynamic Conditional Correlations model, while ADCC does an asymmetric Dynamic Conditional Correlations model. CHOLESKY is an alternative to CC/DCC that does univariate GARCH models and then combines them into full covariance matrix by \({\bf{H}} = {\bf{LDL'}}\) where \({\bf{L}}\) is lower triangular with 1s on the diagonal and \({\bf{D}}\) is the diagonal matrix of the variances of the univariate models. Results depend upon ordering.
VARIANCES=SIMPLE/VARMA/EXPONENTIAL/SPILLOVER/KOUTMOS
VARIANCES allows you to select the form of the variance terms (for diagonal, CC, DCC and Cholesky models).
MODEL=MODEL (of linear equations) for the mean equations
Use MODEL to supply your own mean model. You can create the model using SYSTEM, or use LINREG or EQUATION commands to define the mean equations, then use GROUP to group them into a model. Otherwise, the MEAN/NOMEAN option determines the form of the mean equation.
HMATRICES=(output) SERIES[SYMM] estimated covariance matrices
MVHSERIES=(output) SYMM[SERIES] estimated covariance series (multivariate)
RVECTORS=(output) SERIES[VECT] of non-standardized residuals (multivariate)
HMATRICES saves the estimated covariance arrays as a SERIES of SYMMETRIC arrays while MVHSERIES saves the variances and covariances as a SYMM[SERIES]. RVECTORS saves the (non-standardized) residuals to a SERIES of VECTORS. Note that HMATRICES and MVHSERIES save the same information, just in different variable types.
STDRESIDS=(output) VECT[SERIES] of (jointly) standardized residuals
FACTORBY=[CHOLESKY]/EIGENDECOMP
If the model is correct, then the jointly standardized residuals should be serially uncorrelated with mean zero and covariance matrix equal to the identity matrix with no residual GARCH effects. Given the model residuals and the series of estimated covariances, there are many (that is, an infinite number) of ways to transform them into jointly standardized residuals. You have the option of a Cholesky factorization or an eigen-based one. Note that different ways of doing the standardization will result in different standardized residuals and thus different diagnostics.
VECHMAT=(output) HASH[RECT] of matrices for a VECH representation
STANDARD, BEKK, VECH, TBEKK and DBEKK models are all restricted forms of a full VECH representation. For those models, you can use the VECHMAT option to create a HASH[RECT] with the matrices for a VECH representation of the model. That can be used for forecasting and variance impulse responses. Note that only these restricted VECH models allow a relatively simple forecasting formula. The elements of the HASH are "C" for the variance constant, "A" for the coefficients on the (vech'ed) outer product of the lagged residuals, "B" for the coefficients on the (vech'ed) lagged covariance matrix and "D" (if needed) for the coefficients on the (vech'ed) outer product of the sign-restricted residuals if you used asymmetry.
SIGNS=VECTOR of triggers for asymmetric behavior [-1 for all]
Use the SIGNS option to provide +1 or -1 values for the signs that trigger asymmetric behavior in each component.
Determines how "X" regressors for a BEKK model are handled. Both of these add a lower triangular matrix to the parameter set for each X regressor. The default (COMBINED) does a linear combination of the constant variance matrix plus the X effects and squares the combined matrix:
\(\left( {{\bf{C}} + {{\bf{E}}_1}{x_{1t}} + \ldots + {{\bf{E}}_k}{x_{kt}}} \right){\left( {{\bf{C}} + {{\bf{E}}_1}{x_{1t}} + \ldots + {{\bf{E}}_k}{x_{kt}}} \right)^\prime }\)
The SEPARATE choice takes the outer product of each term separately:
\({\bf{CC'}} + x_{1t}^2{{\bf{E}}_1}{{\bf{E'}}_1} + \ldots + x_{kt}^2{{\bf{E}}_k}{{\bf{E'}}_k}\)
Both preserve the positive-definiteness of any covariance matrix generated. The latter, however, means that each of the X terms must increase the variance, which may be too strong an assumption in many cases. (This option was added with version 9.2).
DCC=[COVARIANCE]/CORRELATION/CDCC
QBAR=initial \({\bf{\bar Q}}\) matrix for DCC [empirical]
DCC chooses the form of the recursion for the model for the "GARCH" submodel that determines the dynamic correlations. The default is DCC=COVARIANCE, which means
\({{\bf{Q}}_t} = (1 - a - b){\bf{\bar Q}} + a{{\bf{u}}_{t - 1}}{\bf{u}'_{t - 1}} + b{{\bf{Q}}_{t - 1}}\)
where \({{\bf{u}}_t}\) is the mean model residual and \({{\bf{\bar Q}}}\) is the unconditional covariance matrix. DCC=CORRELATION is Engle's original idea of
\({{\bf{Q}}_t} = (1 - a - b){\bf{\bar Q}} + a{\varepsilon _{t - 1}}{\varepsilon '_{t - 1}} + b{{\bf{Q}}_{t - 1}}\)
where \({\varepsilon _t}\) is the vector of standardized residuals (\({{\bf{u}}_t}\) divided by the model estimate for its standard deviation) and \({{\bf{\bar Q}}}\) is the sample covariance matrix of the \({\varepsilon _t}\). Engle's recursion is really designed for "two-step" estimation procedures which estimate univariate models first and take the standardized residuals as given in a second step of estimating the joint covariance matrix. However, it can't be applied easily with any of the VARIANCE models which have interactions among the variances from different equations. It also, in practice, rarely fits better than DCC=COVARIANCE, and often fits quite a bit worse. (It tends to be more easily dominated by outliers.) DCC=COVARIANCE is the calculation that GARCH has been doing since DCC was added and remains the default.
DCC=CDCC (corrected DCC) is based upon the suggestion in Aielli(2013). Aielli shows the Engle's DCC recursion isn't internally consistent, in the sense that \(E({\varepsilon _t}{{\varepsilon '}_t}) \ne {{\bf{Q}}_t}\) as it would be if the secondary model were actually "GARCH", and he proposes an alternative which fixes that. Aielli's model has the same problem as Engle's that it doesn't really apply except to models which can be done in two steps (mainly because the calculation of the implied \({{\bf{\bar Q}}}\) requires that the individual variances be known), so DCC=CDCC uses a "feasible" estimator of the sample correlation matrix.
For whichever model is chosen for DCC, the QBAR option can be used to override the sample calculation of the \({{\bf{\bar Q}}}\) in case you want to experiment.
General Estimation Options
METHOD=BHHH/[BFGS]/[SIMPLEX]/GENETIC/ANNEALING/GA/EVALUATE
This chooses the method used for the final estimation. The two most common choices for this are BFGS (the default) and BHHH. These are the only two which can produce standard errors—the others don't assume enough to permit that. Instead, those are derivative-free methods which can compute point estimates of the coefficients. They can be helpful in refining initial guess values and are usually used as a PMETHOD for preliminary estimation.
With METHOD=EVALUATE, GARCH simply evaluates the model given the initial parameter values (input using the INITIAL option), without trying to estimate new coefficient values. You can use options like HSERIES and RESIDS to save the resulting variance and residual series for evaluation.
ITERATIONS=iteration limit [100]
SUBITERATIONS=subiteration limit [30]
CVCRIT=convergence limit [.00001]
TRACE/[NOTRACE]
ITERATIONS sets the maximum number of iterations, SUBITERS sets the maximum number of subiterations, CVCRIT the convergence criterion. TRACE prints the intermediate results. For the derivative-free methods, an “iteration” is defined in a way to make a comparable number of calculations per iteration to the derivative-based ones.
PMETHOD=BHHH/BFGS/SIMPLEX/GENETIC/ANNEALING/GA
PITERS=number of PMETHOD iterations to perform [none]
Use PMETHOD and PITERS if you want to use a preliminary estimation method to refine your initial parameter values before switching to one of the other estimation methods. For example, to do 20 simplex iterations before switching to BFGS, use PMETHOD=SIMPLEX, PITERS=20, and METHOD=BFGS.
INITIAL=VECTOR of initial guess values for the parameters
INITIAL can be used to feed in initial guess values for estimation, or can be used with METHOD=EVALUATE, for evaluating the likelihood at specific values.
HESSIAN=initial guess for inverse Hessian (METHOD=BFGS only)
This allows you to supply initial values for the inverse Hessian. This option is only available on instructions that offer the BFGS method, and only when using that method. Without it, the estimation will start with a BHHH matrix, but with diagonal elements only.
PARMSET=PARMSET to use for additional parameters [not used]
DENSITY=FUNCTION to compute the log density [not used]
You can use these to extend the GARCH instruction to handle certain types of additional models. The DENSITY option FUNCTION must take two arguments: the first is the REAL variance (univariate) or SYMMETRIC covariance matrix (multivariate) produced by the GARCH recursion, and the second is the REAL residual (univariate) or VECTOR of residuals (multivariate). Using those, it should return the log density to be used for the likelihood element at the current entry. You can use in the FUNCTION any of the parameters in the PARMSET that you provide, and you can also use the current entry number T if something is time-varying. For instance,
nonlin(parmset=switchparms) nu1 nu2
function logswitcht h u
type real h u
compute logswitcht=%logtdensity(h,u,%if(t<=1000,nu1,nu2))
end
compute nu1=nu2=10.0
garch(parmset=switchparms,density=logswitcht) / dlogdm
will estimate a standard GARCH model but with t distributed errors with different degrees of freedom for the first 1000 observations and the remainder of the sample. The added parameters will come at the end of the output. Note that you do not use DISTRIB=T with this (that would add a SHAPE parameter that has no effect, since you've overridden the distribution calculation).
See GARCHUVFLEX.RPF and GARCHSEMIPARAM.RPF for full examples.
[PRINT]/NOPRINT
VCV/[NOVCV]
TITLE="title for output" [depends upon options]
These are the standard output control options.
ROBUSTERRORS/[NOROBUSTERRORS]
LAGS=correlated lags [0]
LWINDOW=NEWEYWEST/BARTLETT/DAMPED/PARZEN/QUADRATIC/[FLAT]/PANEL/WHITE
LWFORM=VECTOR with the window form [not used]
CLUSTER=series with category values for clustered standard errors [not used]
DAMP=value of \(\gamma\) for LWINDOW=DAMPED [0.0]
These permit calculation of a consistent covariance matrix or clustered standard errors if you are doing Quasi Maximum likelihood estimation. The LAGS, LWINDOW, LWFORM and CLUSTER options are used for dealing with correlation in the gradient elements.
DERIVES=(output) VECTOR[SERIES] for partial derivatives [unused]
This saves the series of partial derivatives of the log likelihood. The first series in the VECTOR will be the partials with respect to the first parameter displayed in the GARCH output, the second series will be the partials with respect to the second parameter, and so on.
Variables
%BETA |
coefficient VECTOR |
%CONVERGED |
=1 or 0. 1 indicates that the process converged (INTEGER) |
%CVCRIT |
final convergence criterion (REAL). This will be equal to zero if the sub-iteration limit was reached on the last iteration. |
%FUNCVAL |
final value of the function being maximized (REAL) |
%ITERS |
iterations completed (INTEGER) |
%LOGL |
log likelihood value (REAL) |
%NFREE |
number of free parameters (INTEGER) |
%NOBS |
number of observations (INTEGER) |
%NREG |
number of regressors (INTEGER) |
%NREGMEAN |
number of regressors in the mean model only (INTEGER) |
%NVAR |
number of variables (INTEGER) |
%RESIDS |
SERIES containing the residuals (univariate) |
%SHAPE |
estimated shape parameter (for non-normal DISTRIB) (REAL) |
%STDERRS |
VECTOR of coefficient standard errors |
%TSTATS |
VECTOR of t-statistics of the coefficients |
%XX |
covariance matrix of coefficients (SYMMETRIC) |
Order of the Coefficients
The parameters are added in the following order:
1.Mean model coefficients
2.Constant terms in the GARCH variance model
3.Lagged squared variance (ARCH) terms
4.Lagged variance (GARCH) terms
5.Asymmetry terms in the variance model (if any)
6.Extra explanatory variables in the variance model (if any).
For multivariate models, many of these are matrices. Within each category, elements are ordered by row. For symmetrical or lower triangular matrices, this would mean (1,1), (2,1), (2,2), (3,1), etc., For instance, with the simple multivariate GARCH, the first will be for the model for the variance of series 1, the second for the covariance of 1 with 2, the third for the variance of 2, etc. With more than one lag, each lag is in a separate block.
Examples
The two main examples of the use of GARCH are GARCHUV.RPF (for univariate model types) and GARCHMV.RPF (for multivariate model types). What follows below are short examples to illustrate how the instruction is used.
ARCH(2) on an AR(1) regression model, with the presample variance fixed at the value of %SEESQ from a previous regression.
garch(p=0,q=2,regressors,presample=||%seesq||) / ffed
# constant ffed{1}
ARCH(1) with a t-distribution with 5 degrees of freedom, saving the residuals in AT and the variance estimates in FVAR.
garch(p=0,q=1,dist=t,shape=5,resids=at,hseries=fvar) / rt
EGARCH(1,1) model with asymmetry on an MA(1) mean model.
garch(p=1,q=1,exp,asymmetric,regressors) / ibmln
# constant %mvgavge{1}
GARCH-X(1,1), adding the variable U to the variance equation.
garch(xreg,p=1,q=1,resids=at,hseries=fv) / rt
# u
Bivariate GARCH(1,1) model
garch(p=1,q=1,method=bfgs) / futures spot
Trivariate DCC GARCH(1,1) model, with separate mean models for each variable.
group meanm rspeq rnkeq rhseq
garch(p=1,q=1,mv=dcc,model=meanm,method=bhhh)
This uses HADJUST to include the square root of the variance of the third equation (the OILGROW equation) as a regressor in the mean equation of a VAR GARCH. This updates the variable HOIL as a function of the variances, which are being saved in the (SERIES of SYMMETRIC arrays) HH:
set hoil = 0.0
system(model=basevar)
variables pgrow ipgrow oilgrow rate
lags 1 to nlags
det constant hoil
end(system)
garch(model=basevar,mv=diag,hmatrices=hh, $
hadjust=%(hoil=sqrt(hh(t)(3,3))))
Copyright © 2025 Thomas A. Doan