Learn R Programming

lgarch (version 0.2)

lgarch-package: Simulation and estimation of log-GARCH models

Description

This package provides facilities for the simulation and estimation of log-GARCH models, see Sucarrat, Gronneberg and Escribano (2013). Let y[t] denote a financial return or the error of a regression at time t such that y[t] = sigma[t]*z[t], where sigma[t] > 0 is the conditional standard deviation or volatility, and where z[t] is IID with mean zero and unit variance. The log-volatility specifiction of the log-GARCH-X model is given by ln sigma[t]^2 = constant + Sum_i alpha_i * ln y[t-i]^2 + Sum_j beta_j *ln sigma[t-1]^2 + Sum_k lambda_k * x[t]_k, where the conditioning x-variables can be contemporaneous and/or lagged. The lgarch package estimates this model via its ARMA-X representation, see Sucarrat, Gronneberg and Escribano (2013), and treats zeros on y as missing values, see Sucarrat and Escribano (2013).

Arguments

Details

ll{ Package: lgarch Type: Package Version: 0.2 Date: 2014-04-28 License: GPL-2 LazyLoad: yes } The two main functions of the package are: lgarchSim lgarch The first function simulates a log-GARCH model whereas the second estimates one. The second function returns an object (a list) of class 'lgarch', and a collection of methods can be applied to this class: coef.lgarch, fitted.lgarch, logLik.lgarch, print.lgarch, residuals.lgarch, rss.lgarch and vcov.lgarch. The output produced by the lgarchSim and mlgarchSim functions, and by the fitted.lgarch and residuals.lgarch methods, are of the Z's ordered observations (zoo) class, which means a range of time-series and plotting methods are available for these objects.

References

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, mlgarchSim, lgarch, coef.lgarch, fitted.lgarch, logLik.lgarch, print.lgarch, residuals.lgarch, rss.lgarch and vcov.lgarch

Examples

Run this code
##simulate 500 observations w/default parameter values:
set.seed(123)
y <- lgarchSim(500)

##estimate a log-garch(1,1):
mymod <- lgarch(y)

##print results:
print(mymod)

##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:
sigmahat <- fitted(mymod)
plot(sigmahat)

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

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

Run the code above in your browser using DataLab