lgarch: Estimate a log-GARCH model

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/lgarch.R

Description

Fit a log-GARCH model by either (nonlinear) Least Squares (LS) or Quasi Maximum Likelihood (QML) via the ARMA representation. For QML either the Gaussian or centred exponential chi-squared distribution can be used as instrumental density, see Sucarrat, Gronneberg and Escribano (2013), and Francq and Sucarrat (2013). Zero-values on the dependent variable y are treated as missing values, as suggested in Sucarrat and Escribano (2013). Estimation is via the nlminb function, whereas a numerical estimate of the Hessian is obtained with optimHess for the computation of the variance-covariance matrix

Usage

1
2
3
4
5
lgarch(y, arch = 1, garch = 1, xreg = NULL, initial.values = NULL,
  lower = NULL, upper = NULL, nlminb.control = list(), vcov = TRUE,
  method=c("ls","ml","cex2"), mean.correction=FALSE,
  objective.penalty = NULL, solve.tol = .Machine$double.eps,
  c.code = TRUE)

Arguments

y

numeric vector, typically a financial return series or the error of a regression

arch

the arch order (i.e. an integer equal to or greater than 0). The default is 1. NOTE: in the current version the order canno be greater than 1

garch

the garch order (i.e. an integer equal to or greater than 0). The default is 1. NOTE: in the current version the order canno be greater than 1

xreg

vector or matrix with conditioning variables

initial.values

NULL (default) or a vector with the initial values of the ARMA-representation

lower

NULL (default) or a vector with the lower bounds of the parameter space (of the ARMA-representation). If NULL, then the values are automatically chosen

upper

NULL (default) or a vector with the upper bounds of the parameter space (of the ARMA-representation). If NULL, then the values are automatically chosen

nlminb.control

list of control options passed on to the nlminb optimiser

vcov

logical. If TRUE (default), then the variance-covariance matrix is computed. The FALSE options makes estimation faster, but the variance-covariance matrix cannot be extracted subsequently

method

Estimation method to use. Either "ls", i.e. Nonlinear Least Squares (default), "ml", i.e. Gaussian QML or "cex2", i.e. Centred exponential Chi-squared QML, see Francq and Sucarrat (2013). Note: For the cex2 method mean-correction = FALSE is not available

mean.correction

Whether to mean-correct the ARMA representation. Mean-correction is usually faster, but not always recommended if covariates are added (i.e. if xreg is not NULL)

objective.penalty

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 (this can be fatal for simulations). The value objective.penalty is the value returned by the objective function lgarchObjective in the presence of NA or +/-Inf values

solve.tol

The function solve is used for the inversion of the negative of the Hessian in computing the variance-covariance matrix. The value solve.tol is passed on to solve, and is the tolerance for detecting linear dependencies in the columns

c.code

logical. TRUE (default) is (much) faster, since it makes use of compiled C-code in the recursions

Value

A list of class 'lgarch'

Note

Empty

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

References

Francq, C. and G. Sucarrat (2013), 'An Exponential Chi-Squared QMLE for Log-GARCH Models via the ARMA Representation', MPRA Paper 51783: http://mpra.ub.uni-muenchen.de/51783/

Sucarrat and Escribano (2013), 'Unbiased QML Estimation of Log-GARCH Models in the Presence of Zero Returns', MPRA Paper 50699: http://mpra.ub.uni-muenchen.de/50699/

Sucarrat, Gronneberg and Escribano (2013), 'Estimation and Inference in Univariate and Multivariate Log-GARCH-X Models When the Conditional Density is Unknown', MPRA Paper 49344: http://mpra.ub.uni-muenchen.de/49344/

See Also

lgarchSim, coef.lgarch, fitted.lgarch, logLik.lgarch, print.lgarch, residuals.lgarch and vcov.lgarch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##simulate 500 observations w/default parameter values:
set.seed(123)
y <- lgarchSim(500)

##estimate a log-garch(1,1) w/least squares:
mymod <- lgarch(y)

##estimate the same model, but w/cex2 method:
mymod2 <- lgarch(y, method="cex2")

##print results:
print(mymod); print(mymod2)

##extract coefficients:
coef(mymod)

##extract Gaussian log-likelihood (zeros excluded) of the log-garch model:
logLik(mymod)

##extract Gaussian log-likelihood (zeros excluded) of the arma representation:
logLik(mymod, arma=TRUE)

##extract variance-covariance matrix:
vcov(mymod)

##extract and plot the fitted conditional standard deviation:
sdhat <- fitted(mymod)
plot(sdhat)

##extract and plot standardised residuals:
zhat <- residuals(mymod)
plot(zhat)

##extract and plot all the fitted series:
myhat <- fitted(mymod, verbose=TRUE)
plot(myhat)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric


Date: Wed May 15 10:36:05 2019 
Method: LS 
Message (nlminb): relative convergence (4) 
No. of observations: 500 
Sample: 1 to 500 

Coefficients:
             intercept      arch1    garch1      Elnz2
Estimate:   -0.2929861 0.04273328 0.7082512 -1.2657802
Std. Error:         NA 0.03313073 0.2178691  0.0716916
                                     
Log-likelihood (log-garch):  -361.026
Log-likelihood (arma):      -1085.667
Sum Squared Resids. (arma):    2251.6
No. of non-zeros:                 500
No. of zeros:                       0


Date: Wed May 15 10:36:05 2019 
Method: CEX2 (w/mean-correction) 
Message (nlminb): relative convergence (4) 
No. of observations: 500 
Sample: 1 to 500 

Coefficients:
             intercept      arch1    garch1       Elnz2
Estimate:   -0.4915509 0.04258921 0.5633112 -1.27634643
Std. Error:         NA 0.02213739 0.1945688  0.06348243
                                     
Log-likelihood (log-garch):  -361.369
Log-likelihood (arma):      -1026.757
Sum Squared Resids. (arma):   2254.15
No. of non-zeros:                 500
No. of zeros:                       0

  intercept       arch1      garch1       Elnz2 
-0.29298607  0.04273328  0.70825122 -1.26578023 
'log Lik.' -361.0257 (df=3)
'log Lik.' -1085.667 (df=3)
          intercept        arch1      garch1       Elnz2
intercept        NA           NA          NA          NA
arch1            NA  0.001097645 -0.00325630          NA
garch1           NA -0.003256300  0.04746696          NA
Elnz2            NA           NA          NA 0.005139685

lgarch documentation built on May 1, 2019, 6:33 p.m.