Risk Forecasting of Karachi Stock Exchange: A Comparison of Classical and Bayesian GARCH Models

This paper is concerned with the estimation, forecasting and evaluation of Value-at-Risk (VaR) of Karachi Stock Exchange before and after the global financial crisis of 2008 using Bayesian method. The generalized autoregressive conditional heteroscedastic (GARCH) models under the assumption of normal and heavy-tailed errors are used to forecast one-day-ahead risk estimates. Various measures and backtesting methods are employed to evaluate VaR forecasts. The observed number of VaR violations using Bayesian method is found close to the expected number of violations. The losses are also found smaller than the competing Maximum Likelihood method. The results showed that the Bayesian method produce accurate and reliable VaR forecasts and can be preferred over other methods.


Introduction
Value-at-Risk (VaR) has become a popular tool and is widely used for risk management and capital allocation by financial institutions.Both underestimation and overestimation of risk could have a negative effect in financial markets.Therefore accurate estimates of VaR is crucial for the financial stability of markets.VaR can be defined as the quantile of the loss, during a specific time period, that can occur within a given portfolio.A precise quantile estimate far out in the left tail of the return distribution is desirable.A thorough survey of risk measures is provided by Jorion (2007).
Various approaches for estimating and predicting VaR exist in literature.These include nonparametric method such as historical simulation; semi-parametric method based on extreme value theory and quantile regression method and full parametric models (see McNeil andFrey, 2000 andEngle andManganelli, 2004, among others).Kuester et al. (2006) provided an overview and comparisons of these and further methods whereas a comprehensive overview is found in Abad et al. (2014).
Under the parametric statistical approaches, the autoregressive conditional heteroscedastic (ARCH) model of Engle (1982) and generalized ARCH (GARCH) model of Bollerslev (1986) are widely-used by researchers and practitioners.These models can capture the conditional variance structure and some of the stylized facts of many financial time series.Since then numerous extensions of the GARCH model have been proposed.Among them, the exponential GARCH model of Nelson (1991) and asymmetric model of Glosten et al. (1993) are popular.Accurate volatility estimates are essential for producing reliable VaR estimates.
The estimates of the parameters of GARCH model is usually obtained using the Gaussian maximum likelihood and the estimator is often called the quasi maximum likelihood estimator (QMLE).However, normality is often rejected in applications as the unconditional distribution of most financial asset returns has fatter tails than implied by this model with normal errors.The excess of (unconditional) kurtosis has been most commonly accommodated with Student-t distributed errors (e.g.Baillie and Bollerslev, 1989).Besides, robust methods for the estimation of GARCH models are also suggested (Peng and Yao, 2003;Muller and Yohai, 2008;Iqbal and Mukherjee, 2010 to cite few) Another approach to estimate the parameters and volatility of GARCH model is to use Bayesian framework.The Bayesian paradigm offers a natural way of taking both parameter uncertainty and model uncertainty into account.However, the literature on Bayesian treatment of GARCH model in not as enormous as in the case of QMLE.In Bayesian setup, most of the time a researcher has to rely on computational methods such as Markov Chain Monte Carlo (MCMC) for the estimation of these models (see Nakatsuma, 1998, 2000, Ardia, 2008and Deschamps, 2012 Mahmud and Mirza (2011) forecast the volatility of KSE before and after the financial crisis using GARCH models.Haque and Naeem (2014) investigated the volatility forecasting performance of GARCH models with various distribution of innovations.To the best of our knowledge, the Bayesian framework has not been yet applied for volatility or risk forecasting of KSE.This motivate us to fill this gap and contribute to the literature.
The main aim of this paper is to estimate and forecast VaR using GARCH models in Bayesian setup.The QMLE method is also used for the comparison of results.The estimates and forecasts of volatility and VaR are computed by these two methods using Gaussian and Student-t distributions for innovations.Various evaluation measures and backtesting methods are employed to compare the in-sample and out-of-sample forecasts of VaR.The daily closing prices of KSE from January 03, 2005 to December 30, 2011 are used in the present study.This study is important from various angles.First, as aforementioned, the VaR estimates of KSE are calculates using Bayesian method that to the best of our knowledge has not been studied.Another contribution of this study is to check the effects of large shocks on risk estimated of KSE not only in the full time period but also before and after the global financial crisis.This may help practitioners and researchers to understand the behaviour of risk measure when the market is hit by large shocks at different time periods and their after effects.Finally, the use of Bayesian method for forecasting in GARCH model may encourage academicians and researchers in Pakistan to apply Bayesian methods for local financial data.
The rest of the paper is organized as follows: In Section 2, a brief overview of GARCH model and both estimation methods are presented.Value-at-Risk estimation and prediction are briefly discussed along with various evaluation measures in Section 3. In Section 4, the results of this study are reported and discussed.Finally, Section 5 concludes the article.

GARCH Model and Estimation
For the simple GARCH (1, 1) model, the following representation of the return series is assumed.Observer such that , where is a sequence of independent and identically distributed (i.i.d.) unobservable real-valued random variables with mean 0 and variance 1 and distribution D; and [ ] the unknown parameter vector in the parameter space Under these parameter constratints, The GARCH(1,1) model in (2.1) is strictly stationary and hence covariance stationary under finite second moment.
In this study, two error distributions are used for the i.i.d innovations.The choice is a standard and Student-t distribution.Th later is standardized to have zero mean and unit variance.
The conditional likelihood can be written as: where and is the relevant error density function of .In the classical setup, is assumed to be the true and fixed value and the maximum likelihood estimator of is then obtained by ̂ In the Bayesian setup, is considered to be a random variable with a prior density which depends on the researcher's prior belief.These parameters are assumed to be a priori independent and normally distributed truncated to the intervals that define each one.It is also assumed that few known and constant hyperparameters specify their densities.
For example, as proposed in Ardia (2008), these are given by and ( ) , where is the indicator function.
The posterior density of is obtained using the Bayes' rule as ∫ where is the likelihood function of the model parameters and the denominator is the so called normalizing constant.But, this posterior distribution is generally not anlaytically tractable.Therefore, MCMC sampling strategies are adopted for obtaining samples from the joint posterior distributions.These include the famous Metropolis-Hasting algorithm (Metropolis et al., 1953 andHasting, 1970) and the Gibbs sampler (Geman and Geman, 1984), among others.
For the GARCH (1,1) model in (2.1) and assuming , the likelihood function of can be written as: where and is the determinant of a matrix.The likelihood for Student-t distribution can also be written in a similar fashion with additional parameter, , the degress of freedom, that is also estimated with the parameters.For a comprehensive details of MCMC method in GARCH model, interested reader are referred to Nakatsuma (1998) and Ardia (2008).

Value-at-Risk Forecasting and Evaluation
This section first describes the method of predicting VaR using GARCH model.Then, evaluation measures and bactesting methods are presented to evaluate these VaR estimates.VaR measures the worst expected loss of a portfolio over a target horizon at a given confidence level, due to an adverse movement in the relevant security price (Jorion, 2007).For a known probability , a VaR is defined as the th conditional quantile of the returns.Hence the VaR at time for the returns is defined as where is the conditional distribution of given then information available up to .Hence, from (2.1) we get where is the quantile function of the innovation .The estimate of VaR is then defined as The Basel Committee on Banking Supervision (1996) recommends a backtesting procedure to evaluate the accuracy of VaR forecasts.This is generally based on the number of observed violations, i.e. when actual losses exceed VaR in a sample period.

Coverage probability and violation rate
Let us define the total number of observed violations as

∑ ̂
Then the closeness of empirical rejection probability ̂ to ' ' can be used to assess the overall predicative performance of the VaR model.This probability also known as VaR violation rate provides an interesting insight to VaR forecasts.
In case a model correctly specifies the conditonal quantile of returns, its true ̂ should be equal to nominal level .The ratio ̂ can be used to compare and rank competing models.Of course, a model with this ratio close to unity is prefered and in case of ties, conservative model ( ̂ ) is chosen as superior .

Average quadratic loss
The magnitude of losses is also important in the evaluation of VaR.Lopez (1999) considered this magnitude and defined the average quadratic loss (AQL) of a VaR estimate.The overall AQL of a VaR estimate is obtained as ∑ where Next, we define formal tests for backtesting VaR estimates.

Coverage tests
The first test is the unconditional likelihood ratio test proposed by Kupiec (1995).It is defined as which is asymptotically .
Christoffersen (1998) defined the independence coverage test statistic, denoted by as follows.For let denotes the number of time points for which is followed by .Let The conditional coverage test statistic of Christoferssen (1998) which is asymptotically is

Dynamic quantile test
Higher order dependence in VaR violations also need to be checked.The dynamic quantile (DQ) test of Engle and Manganelli (2004)  Where ̂ is the ordinary least square estimator.
These measures and tests are used in this study to evaluate and compare the performance of risk estimates of QMLE and Bayesian method.

Data and preliminary analysis
The The returns at time is defined as , where is the closing index of KSE at time .Then using ̅ (with ̅ ∑ ) as our observations, the whole span in each time period is divided into two parts: the estimation or in-sample part of initial observations used for estimating the unknown parameters in GARCH models and the validation or out-of-sample part of observations for the prediction and assessment of VaR.For out-of-sample forecasting, which corresponds to one year observations.The recommended back-testing guideline proposed by the Basel Committee on Banking Supervision (1996) is to also evaluate a one percent (1%) VaR model over a 12 month test period (250 trading days).The daily closing prices (in thousands US dollar) and log-returns of KSE are shown in Figure 1 below.The effect of global financial crisis is evident on KSE.A large drop in the prices and high volatility and volatility clustering can also be seen in in log-returns.

Figure 1. Daily closing prices (left) and log-returns (right) of KSE
Table 1 presents the summary statistics for the full, before the crisis and after the crisis time periods.These statistics may help us to examine the behaviour of the stock returns.All time periods have higher kurtosis and negative skewness in returns.The normality in returns was tested using Jarque-Bera test for normality and high values of this test show that the KSE returns are significantly different from normality.High values of Ljung-Box ( ) statistic for the squared returns at lag 20 were also observed in all time periods.This is the indication of dependence in squared returns and thus a need for fitting GARCH models.In summary, the KSE return series do not conform to normal distribution, display negative skewness (the distribution has a long left tail) and high kurtosis (fat tails) for all periods.It can also be noticed that the unconditional volatility is higher just before the crisis period.Next, the GARCH model is fitted to all three time periods.The in-sample estimates of parameters, volatility and VaR are obtained using the QMLE and Bayesian method under the assumptions of both Gaussian and Student-t distributions.For the MCMC method, a total of 10,000 iterations are run discarding the first 2,000 realizations as burn-in period.
Posterior results are then based on 8,000 realizations of the Markov chain with the prior distributions as explained in Section 2. The simulated Markov chains are checked for convergence and good mixing by visual inspection of the marginal traces, density estimates, and autocorrelations are observed.Figure 2 shows an illustration of the diagnostic plots.

In-sample VaR analysis
Table 2 presents the in-sample VaR results of both estimation methods.First, the results of QMLE and Bayesian methods under Gaussian assumption for errors are discussed.For the sake of brevity, the results of only (90% VaR confidence level) is presented.Similar results are obtained for other levels.As it can be seen that both methods produce reasobaly indentical results for the full time period.The observed ratios ̂ were found close to 1 which means that the number of observed violations are close to expected number of violations.The results of all three tests (unconditional and conditional coverage tests and dynamic quantile test) values divided by their respective critical values at 5% confidence level are also reported.A value greater than 1 means rejection of the test at 5% level.Non-significant values for unconditional coverage test and significant values for conditional coverage and DQ test are found using QMLE.In Bayesian method, again only unconditional test is found non-significant.The average quadratic loss (AQL) produced by both methods are similar in magnitude.
For other two time periods (before and after financial crisis) considered in this study, some interesting findings are noticed.The expected and observed number of violation in Bayesian showed exactly same values, therefore VaR ratios of 1 can be seen in these periods.The number of observed violation for QMLE are found smaller than the expected violations.In after crisis period the conditional coverage and DQ tests are also rejected by QMLE whereas non-significant values of these test statistics in Bayesian confirms independence of violations from their lags and past VaR.Finally, the AQL of Bayesian is also found smaller than the QMLE in both time periods meaning that the losses using Bayesian are less on average.The result of in-sample VaR when Student-t distribution was assumed for errors showed similar trend.With Bayesian method outperforming the QMLE in terms of better VaR ratios, nonsignificant test statistics and lower AQL.Another feature that can be observed is that these results get slightly better than those in Gaussian case.This indicates that Student-t distribution is preferred for better risk forecasting in GARCH models.In summary, the Bayesian method provides reliable VaR forecasts than the QMLE and further improves the forecasts when heavy-tailed distribution is assumed for errors.

Out-sample VaR analysis
For policy and risk management, prediction and evaluation of VaR are considered more important.This subsection highlights the results of out-of-sample VaR forecats.To produce one-day-ahead forecast of VaR, a rolling window approach is used.More specifically, the model is fitted to the estimation period using in-sample part of K observations and one-day-ahead forecasts are obtained.Then the in-sample period is rolled forward by one day dropping the first observation.The model is re-estimated and again the next day forecasts are obtained.In this way out-of-sample VaR forecasts of approximately one year (250 days) are obtained for the forecast period using both methods.
Table 3 reports the results of VaR forecasts.Starting with the number of expected and observed voilations, it is found that though QMLE produced VaR ratios close to 1 in full and pre crisis period, the higher value of ̂ in after crisis period was observed.This is an indication that the QMLE understimated the market risk by producing number of voilations largert than the expected number of violation in a specific period.Understimated VaR is considered more risky than the overstimated VaR.All three tests are also rejected in this time period and average losses (AQL) are also on the higher side in case of QMLE.The Bayesian method again performed reasonbly well in predicting one-step-ahead VaR.In all time periods, the observed number of violations are found close to the expected numbers with smaller losses.Hence, it is conlcuded that this method provide better forecast of risk under different market conditions.

Conclusion
Maximum likelihood is a popular and widely-used method for the estimation of GARCH models.Bayesian methods can also provide a reasonably good estimates for GARCH models.In this paper, both these methods are fitted to the daily data of Karachi Stock Exchange returns before and after the global financial crisis.The estimates of in-sample and out-of-sample VaR are computed.Various evaluation measures and backtesting methods are applied to assess the accuracy of VaR forecast for both estimation methods.The result of the study showed that the Bayesian method can be safely used for the prediction of VaR as it provides reasonable VaR ratios and smaller losses.Bayesian methods in finance have gained a lot of attention of researchers.In Pakistan, this area of research is still lacking.The findings of this study may encourage researchers and academicians in Pakistan to adopt Bayesian paradigm for volatility and risk analysis of financial variables.
This study can be extended in following ways: The MCMC method used is very time consuming.New and efficient Bayesian methods such as Sequential Monte Carlo can be used for online estimation and prediction of GARCH models.A simple GARCH model is studied whereas other variants that consider asymmetry and jumps in volatility can be considered and may provide better risk forecasts.

Figure 2 .
Figure 2. Trace plots (top), autocorrelations (middle) and histograms (bottom) of parameters ). Karachi Stock Exchange (KSE) is the major stock market of Pakistan.Most of the studies on risk estimated of KSE that exist in literature applied classical methods for estimation and prediction.Iqbal et al. (2010) used four different parametric methods and two nonparametric methods for VaR computation of KSE.Qayyum and Nawaz (2010) used extreme value theory and Nawaz and Afzal (2011) computed the VaR using Historical Simulation and Risk Metrics method.
is used for this purpose.This test is described as follows.Let the th response be present study uses the daily closing prices of Karachi Stock Exchange (KSE 100 Index).The dataset is obtained from the http://finance.yahoo.comfor the period of January 03, 2005 to December 31, 2011.This period include the high volatile period because of the global financial crisis.This may help us to understand the dynamics of KSE before and after the financial crisis.The full data set consists of 1686 observations.