Quasi Maximum Likelihood (ML) estimation of a GARCH(q,p,r)-X model, where q is the GARCH order, p is the ARCH order, r is the asymmetry (or leverage) order and 'X' indicates that covariates can be included. Note that the underlying estimation theory assumes the covariates are stochastic. The estimation procedure will, in general, provide consistent estimates when the standardised innovations are not normal or independent (or both), see Francq and Thieu (2018).
garchx(y, order = c(1,1), arch = NULL, garch = NULL, asym = NULL,
xreg = NULL, vcov.type = c("ordinary", "robust", "hac"),
initial.values = NULL, backcast.values = NULL, lower = 0,
upper = +Inf, control = list(), hessian.control = list(),
solve.tol = .Machine$double.eps, estimate = TRUE, c.code = TRUE,
penalty.value = NULL, sigma2.min = .Machine$double.eps,
objective.fun = 1, turbo = FALSE)
A list of class 'garchx'
numeric vector, time-series or zoo
object. Missing values in the beginning and at the end of the series is allowed, as they are removed with the na.trim
command
integer vector of length 1, 2 or 3, for example c(1,1,1)
. The first entry controls the GARCH order, the second the ARCH order and the third the ASYM (asymmetry/leverage) order
NULL
or numeric vector containing the ARCH-terms to include. Note: If not NULL
, then the value of the ARCH
argument overrides the value of the first entry in the order
argument
NULL
or numeric vector containing the GARCH-terms to include. Note: If not NULL
, then the value of the GARCH
argument overrides the value of the second entry in the order
argument
NULL
or numeric vector containing the ASYM-terms (asymmetry/leverage terms) to include. Note: If not NULL
, then the value of the ASYM
argument overrides the value of the third entry in the order
argument
numeric vector, time-series or zoo
object. Missing values in the beginning and at the end of the series is allowed, as they are removed with the na.trim
command
character
, either "ordinary"
, "robust"
or "hac"
. The robust coefficient-covariance ("robust"
) is that of Francq and Thieu (2019). The Heteroscedasticity and Autocorrelation Consistent ("hac"
) variance-covariance estimates the variance of the score (the 'meat') based on Theorem 2.2 in De Jong and Davidson (2000). For the details of the kernel weights (Bartlett) and bandwidth, see the code in the vcov.garchx
function
NULL
or a numeric vector with the initial parameter values passed on to the optimisation routine, nlminb
. If NULL
, the default, then the values are chosen automatically
NULL
or a non-negative numeric. The backcast value is used to initiate the forward recursion of the conditional variance. If NULL
(default), then the value is chosen automatically (currently the average of y
squared is used). If backcast.values
is a non-negative numeric, then the initial recursion values are all set to this value
numeric vector, either of length 1 or the number of parameters to be estimated, see nlminb
numeric vector, either of length 1 or the number of parameters to be estimated, see nlminb
numeric value passed on to the tol
argument of solve
, which is called whenever the coefficient variance-coariance matrix is computed. The value controls the toleranse for detecting linear dependence between columns when inverting a matrix
logical, if TRUE
then estimation is carried out. If FALSE
, then the initial.values
are used
logical, if TRUE
then compiled C code is used in the forward recursion
NULL
(default) or a numeric value. If NULL
, then the log-likelihood value associated with the initial values is used. Sometimes estimation can result in NA
and/or +/-Inf
values. The penalty.value
is the value returned by the objective function garchxObjective
in the presence of NA
or +/-Inf
values
numeric with default .Machine$double.eps
. To avoid taking taking the log of a very small value when computing the log-likelihood, sigma2.min
is used as the lower bound of the fitted conditional variances, see the code of garchxObjective
numeric, either 1 or 0
logical. If FALSE
(default), then the coefficient variance-covariance is computed during estimation, and the fitted values and residuals are attached to the returned object. If TRUE
, then these operations are skipped, and hence estimation is faster. Note, however, that if turbo
is set to TRUE
, then the coefficient-covariance, fitted values and residuals can still be extracted subsequent to estimation with vcov.garchx
, fitted.garchx
and residuals.garchx
, respectively
Genaro Sucarrat, https://www.sucarrat.net/
Christian Francq and Le Quien Thieu (2019): 'QML inference for volatility models with covariates', Econometric Theory 35, pp. 37-72, tools:::Rd_expr_doi("10.1017/S0266466617000512") Christian Francq and Jean-Michel Zakoian (2019): 'GARCH Models', 2nd Edition, Wiley Robert M. de Jong and James Davidson (2000): 'Consistency of Kernel Estimators of Heteroscedastic and Autocorrelated Covariance Matrices', Econometrica 68, pp. 407-423
##simulate from a garch(1,1):
set.seed(123)
y <- garchxSim(1000)
##estimate garch(1,1) model:
mymod <- garchx(y)
##print estimation results:
print(mymod)
##extract coefficients:
coef(mymod)
##extract and store conditional variances:
sigma2hat <- fitted(mymod)
##extract log-likelihood:
logLik(mymod)
##extract and store standardised residuals:
etahat <- residuals(mymod)
##extract variance-covariance matrix:
vcov(mymod)
##generate predictions:
predict(mymod)
Run the code above in your browser using DataLab