These Lecture series are relating the use R language software, its interface and functions required to evaluate financial risk models. Furthermore, R software applications relating financial market data, measuring risk, modern portfolio theory, risk modeling relating returns generalized hyperbolic and lambda distributions, Value at Risk (VaR) modelling, extreme value methods and models, the class of ARCH models, GARCH risk models and portfolio optimization approaches.
2. 2
TOPICS OF CHAPTER NO. 8
In this lecture, we will cover the following topics:
8. Modelling Volatility
i. Preliminaries
ii. The Class of ARCH Models
iii. Discussion relating ARCH models
iv. Synopsis of R packages
a. The package bayesGARCH
b. The package ccgarch
c. The package fGarch
d. The package GEVStableGarch
e. The package gogarch
f. The package lgarch
g. The package rugarch and rmgarch
h. The package tseries
3. 3
TOPICS OF CHAPTER NO. 8
v. Empirical Applications of volatility models
a. R code 8.1 Expected shortfall derived from
GARCH(1, 1) models
4. 4
PRELIMINARIES
The previous two chapters introduced quantitative
methods for risk modelling in the case of non-
normally distributed returns, that is, extreme value
theory and the generalized hyperbolic and
generalized lambda distribution classes.
The first method addresses the tail modelling of a
return process, whereas the second focuses on
adequately capturing the entire distribution.
5. 5
PRELIMINARIES
The value-at-risk and expected shortfall risk measures
have assumed that the financial market returns are iid.
Hence, these risk measures are unconditional in the
sense that these measures do not depend on prior
information.
However, Volatility clustering is one of the stylized facts
of financial market returns.
Given this stylized fact, the assumption of iid returns is
clearly violated.
6. 6
PRELIMINARIES
This chapter introduces a model class that takes
volatility clustering explicitly into account.
As will be shown, conditional risk measures can be
deduced from these models.
Here the phenomenon of volatility clustering
directly feeds into the derived risk measures for
future periods in time.
7. 7
THE CLASS OF ARCH MODELS
The class of autocorrelated conditional
heteroscedastic (ARCH) models was introduced in
the seminal paper by Engle (1982).
This type of model has since been modified and
extended in several ways.
The articles by Engle and Bollerslev (1986),
Bollerslev et al. (1992), and Bera and Higgins
(1993) provide an overview of the model extensions
during the decade or so after the original paper.
8. 8
THE CLASS OF ARCH MODELS
Today, ARCH models are not only well
established in the academic literature but also
widely applied in the domain of risk modelling.
In this section the term “ARCH” will be used
both for the specific ARCH model and for its
extensions and modifications.
9. 9
THE CLASS OF ARCH MODELS
The starting point for ARCH models is an
expectations equation which only deviates from
the classical linear regression with respect to the
assumption of independent and identically
normally distributed errors:
16. 16
SYNOPSIS OF R PACKAGES
Details are provided in the book.
The package bayesGARCH: The package
bayesGARCH implements the Bayesian estimation of
GARCH(1, 1) models with Student’s t innovations (see
Ardia 2008, 2009, 2015; Ardia and Hoogerheide 2010;
Nakatsuma 2000).
The package is contained in the CRAN “Bayesian,”
“Finance,” and “TimeSeries” Task Views. It has
dependencies on the packages mvtnorm and coda.
17. 17
SYNOPSIS OF R PACKAGES
The package ccgarch: This package is one of three
in which multivariate GARCH models can be dealt
with.
In particular, the conditional correlation approach to
multivariate GARCH (CC-GARCH) is implemented
(see Nakatani 2014).
The package is contained in the CRAN “Finance”
Task View.
18. 18
SYNOPSIS OF R PACKAGES
The package fGarch: the package fGarch is part of the
Rmetrics suite of packages (see Würtz and Chalabi
2013).
It is contained in the CRAN “Finance” and “TimeSeries”
Task Views and is considered a core package in the
former.
This package is the broadest implementation of
univariate ARCH models and the extensions thereof.
It interfaces with FORTRAN routines for the more
computationally burdensome calculations.
Within the package, S4 methods and classes are utilized.
As a technicality, a unit testing framework based on the
package RUnit is implemented (see Burger et al. 2015).
19. 19
SYNOPSIS OF R PACKAGES
The package GEVStableGarch: The package
GEVStableGarch has recently been added to
CRAN (see do Rego Sousa et al. 2015).
It is listed in the task views “Finance” and
“Time Series.”
The package is written purely in R and employs
neither the S3 nor the S4 class/method scheme.
20. 20
SYNOPSIS OF R PACKAGES
The package gogarch: The package gogarch (see Pfaff
2012) implements the generalized orthogonal GARCH
(GOGARCH) model, a multiple GARCH model proposed
by Boswijk and van derWeide (2006); van derWeide
(2002) and Boswijk and van derWeide (2009).
The package is contained in the CRAN “Finance” and
“TimeSeries” Task Views.
It utilizes formal S4 classes and methods and is written
purely in R.
21. 21
SYNOPSIS OF R PACKAGES
The package lgarch: The focus of the package
lgarch is on the estimation and simulation of
univariate and multivariate log-GARCH models.
The package has recently been contributed to CRAN
is contained in the task views “Finance” and “Time
Series.” Within the package the S3 class/method
engine is used. Log-GARCH models can be
represented in the form of a (V)ARMA-X model (see
Francq and Sucarrat 2013; Sucarrat et al. 2013).
22. 22
SYNOPSIS OF R PACKAGES
The packages rugarch and rmgarch: A pretty
comprehensive suite of GARCH-type models for univariate
series is made available in the package rugarch (see
Ghalanos 2015b), which is contained in the “Finance” and
“Time Series” Task Views.
Four data sets are included in rugarch: a return series of the
Dow Jones Index (dji30ret), a return series of the S&P 500
index (sp500ret), the SPDR S&P 500 open/close daily returns
and the realized kernel volatility (spyreal) as used by Hansen
et al. (2012), and a spot exchange rate series for DEM/GBP
(dmbp), all daily.
23. 23
SYNOPSIS OF R PACKAGES
The package tseries: The package tseries was the
first contributed package on CRAN in which time
series models and related statistical tests are primarily
implemented (see Trapletti and Hornik 2016). Its
history dates back to the late 1990s.
It is contained in the “Econometrics,” “Finance,”
“TimeSeries,” and “Environmetrics” Task Views, and
it is a core package in the former three views.