Estimating GARCH Modeling Using Metropolis-Hastings Method in R ()
1. Introduction
The R-project is an open statistics programming software. Modelling and forecasting volatility or, in other word, the covariance structure of asset returns, is important. A central property of economic time series, being common to many financial time series, is that their volatility varies over time. Describing the volatility of an asset is a key issue in financial economics. Returns were modelled as independent and identically distributed over time. The most popular class of models for time-varying volatility is represented by GARCH type models [1] . GARCH models are commonly used for describing, estimating and predicting the dynamics of financial returns. Recent surveys of the existing GARCH models literature can be found in Davidson [2] and Rombouts et al. [3] . In contrast to Engle’s [4] ARCH model, a double autoregressive (DAR) model, which is a special case of the ARMA-ARCH models in Weiss [5] and an example of weak ARMA models in Francq and Zakoïan [6] [7] , is also increasingly concerned about researchers. Under the assumption of the disturbance following a normal distribution, Ling [8] considered the structure and the maximum likelihood estimation. In addition, stochastic volatility (SV) models have enjoyed great popularity in analyzing financial data in the last couple of decades [9] .
In this paper, an R package named bayesGARCH [10] was mentioned to contrast with our procedure. This package makes use of the priors based on the work of Nakatsuma [11] , consists of Metropolis-Hastings (MH) algorithm [12] a proper algorithm to sample the posterior distribution.
The remainder of this paper is organized as follows. In Section 2 we describe the GARCH (1, 1)-t process and introduce how to estimate the parameters by using the Metropolis-Hastings method. Through an example, we contrast our model with the bayesGARCH package in Section 3. Section 4 provides the R procedure to execute our model in details. An empirical example is reported in Section 5, and Section 6 concludes this paper.
2. Univariate GARCH-t Model
Let
denote a asset return. The general structure of an asset return series modeled by a GARCH-type models can be written as Audronė Virbickaitė et al. 2014 [13] :
In general
is a Normal variable. Without loss information, we set
. To capture the fat tail so prominent a Student-t distribution is used for conditional density. The model is, GARCH-t, is
(1)
where
is a Student-t distribution with mean 0 and
is the degree of freedom parameter.
is the conditional variance given
in the GARCH (1, 1) model.
,
are restrictions for positive variance, and
for the covariance stationarity. Then the posterior density function could be:
(2)
It is indicated that the
obey the Student-t distribution in (1). The following, we will show how we get (2), the density distribution of
is
Through the equation
, the distribution of
is
So the density is
(3)
Because,
, to ensure the conditional variance of
to be
, we replace “
” with “
”, then the (3) changed into (2).
Given a dataset
, model parameter
and the posterior density is
According to Jensen [14] , the priors are independent and identically distributed (IID) as N (0, 100) with the following restrictions
,
,
to impose identification and
. Since the variance is non-negative, the positive constraints on coefficients are reasonable. The restriction on the degrees of freedom parameter
ensures the conditional variance to be finite and the restrictions on the GARCH parameters
,
and
guarantee its positivity. One of the most popular MCMC algorithm used in estimating GARCH model parameters, is the Metropolis-Hastings (MH) method. We emphasize the fact that only positivity constraints are implemented in the MH algorithm; no stationarity conditions are imposed in the simulation procedure. We employ a MH sampler. Given the current value
of the chain, the proposal
is sampled from
where V is the inverse Hessian matrix of
. The accepted probability equal to
, and
empirically. After the test sample collecting the new
, the predictive density is
3. The Priors and bayesGARCH Package
In this section, an R package named bayesGARCH was applied to deal with the GRACH model, then we’ll describe the difference of the priors between our model and the package. The package bayesGARCH provides functions for the Bayesian estimation of the parsimonious and effective GARCH (1, 1) model with Student-t innovations. The priors in the bayesGARCH package distributions on
is a bivariate truncated Normal distribution;
is a univariate truncated Normal distribution;
is a translated Exponential distribution. The estimation procedure is fully automatic and thus avoids the tedious task of tuning an MCMC sampling algorithm. It is obviously there are some differences set of priors between our model and the package, so we couldn’t cite the package directly. Next, we will show the estimation results to demonstration that the different priors could inference the estimation result.
3.1. Example
We set the initial value of
is (1, 0.2, 0.4, 5). 800 simulation values are obtained by simulation in R.
Then we use bayesGARCH package to estimate
, we remain the number of MCMC chains and the length of each MCMC chain to be the default value.
We receive the estimation of
is (1.2630, 0.2367, 0.4829, 11.3285). Obviously, there’s a big difference estimation of
and the estimation of other parameters is equally unsatisfactory.
3.2. The Priors
The difference sets of the priors see Table 1. The GARCH (1, 1) model with Student-t innovations in package bayesGARCH is written in Geweke [15] .
Table 1. The difference sets of priors.
Note. This table shows the priors set in our model are all independent each other and more typical.
4. Conducting GARCH-t in R
The estimate results in our model
In this section, we design and developed the R program. We will show the whole procedure of how we conduct GARCH-t in R. Our results is (1.0103, 0.1838, 0.4694, 9.2587) is closer to the true value, and we can see the procedure in Figure 1.
The R program
We set the all necessary initial values to be zero, the number of MCMC chain to be 10,000, meanwhile
is a 10,000 times 4 matrix. We leave out the R programs for these simple settings, giving only the necessary parts of the program.
The above procedure could give the estimate value of
, and the estimation of the other rest of the parameters is very like it, we won’t go back to that.
5. Empirical Application
This section will use Metropolis-Hastings method by the actual financial data to fit the model. The using data is the DAX(Ibis) index of German in European stock market, a total of 1860 data. In order to make the data smooth, we need to do some processing to the original data. Let
denote the logarithm and
denote the order difference of
, i.e.
, see Figure 2.
Figure 1. MCMC results of GARCH (1, 1)-t.
Figure 2. We can see the data in figures (a) and (b) shows a growing trend, while data in figure (c) is stable through the numeric transform.
We apply the R program in the section 5 to estimate the DAX data, achieve the result of
is (0.0028, 0.0600, 0.0676, 7.7485). That is, the equation of variance is
. Through compute the Ljung-Box test statistic for examining the null hypothesis of independence in ARCH model, we get the
squared 0.0023 with p-value 0.9621. It obvious to show our GARCH (1, 1)-t model is sufficient.
6. Conclusion
In this article, the R program to estimate GARCH-t model has been developed. The parameters’ distribution has been modeled using Gaussian model with the most common setting. The results we achieved in each of our experiments with either simulation study or real data application, are quite encouraging.
Foundation
This research was partially supported by the PhD research startup foundation of Guizhou Normal University (Grant No. GZNUD[2017]27) & Science and Technology Foundation of Guizhou Province (LKS[2013]5 & LKS[2012]11), China. & Teaching Project of Guizhou Normal University in 2016: Contract No. [2016] XJ No. 09.