11.3 GARCH(1,1) to forecast VaR

  • One of the most versatile and capable of them is the rugarch package. Here we use previously introduced asx_ret.RData dataset to demonstrate modelling GARCH using the functions and methods av ailable in the rugarch package.

  • Fitting a GARCH model using the rugarch package requires setting the model specification using the ugarchspec function.

  • A GARCH(1,1) model with a contant mean equation mean.model=list(armaOrder=c(0,0) can be specified as follows:

library(rugarch)
garch_spec = ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1,
    1)), mean.model = list(armaOrder = c(0, 0)))
  • The above specification stored in garch_spec can now be used to fit the GARCH(1,1) model to our data. The following code fits the GARCH(1,1) model to BHP log returns using the function and shows the results.
fit_garch = ugarchfit(spec = garch_spec, data = bhp_ret)
# show the estimates and other diagnostic tests
fit_garch

*---------------------------------*
*          GARCH Model Fit        *
*---------------------------------*

Conditional Variance Dynamics   
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model  : ARFIMA(0,0,0)
Distribution    : norm 

Optimal Parameters
------------------------------------
        Estimate  Std. Error  t value Pr(>|t|)
mu      0.000929    0.000590   1.5733 0.115648
omega   0.000022    0.000011   1.9495 0.051231
alpha1  0.190305    0.061330   3.1029 0.001916
beta1   0.754359    0.082123   9.1857 0.000000

Robust Standard Errors:
        Estimate  Std. Error  t value Pr(>|t|)
mu      0.000929    0.000606   1.5338 0.125072
omega   0.000022    0.000018   1.2469 0.212446
alpha1  0.190305    0.142428   1.3361 0.181501
beta1   0.754359    0.157071   4.8027 0.000002

LogLikelihood : 1747.092 

Information Criteria
------------------------------------
                    
Akaike       -5.3306
Bayes        -5.3031
Shibata      -5.3306
Hannan-Quinn -5.3199

Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
                        statistic p-value
Lag[1]                    0.03488  0.8518
Lag[2*(p+q)+(p+q)-1][2]   0.62736  0.6367
Lag[4*(p+q)+(p+q)-1][5]   1.62615  0.7089
d.o.f=0
H0 : No serial correlation

Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
                        statistic p-value
Lag[1]                     0.5304  0.4665
Lag[2*(p+q)+(p+q)-1][5]    2.1141  0.5917
Lag[4*(p+q)+(p+q)-1][9]    6.4221  0.2526
d.o.f=2

Weighted ARCH LM Tests
------------------------------------
            Statistic Shape Scale P-Value
ARCH Lag[3]    0.8395 0.500 2.000  0.3595
ARCH Lag[5]    1.3927 1.440 1.667  0.6210
ARCH Lag[7]    6.1375 2.315 1.543  0.1323

Nyblom stability test
------------------------------------
Joint Statistic:  0.5677
Individual Statistics:              
mu     0.06882
omega  0.28626
alpha1 0.15743
beta1  0.19222

Asymptotic Critical Values (10% 5% 1%)
Joint Statistic:         1.07 1.24 1.6
Individual Statistic:    0.35 0.47 0.75

Sign Bias Test
------------------------------------
                   t-value   prob sig
Sign Bias           0.2418 0.8090    
Negative Sign Bias  1.3289 0.1844    
Positive Sign Bias  0.1904 0.8491    
Joint Effect        2.9075 0.4061    


Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
  group statistic p-value(g-1)
1    20     22.45       0.2623
2    30     31.69       0.3337
3    40     48.63       0.1388
4    50     54.41       0.2761


Elapsed time : 0.1190131 
  • Selected fitted statistics can be obtained using various methods available to the ugarchfit object class
par1 = par()  #save graphic parameters

par(mfrow = c(1, 2))
# generate plots using the which argument Figure-12 1. ACF of
# standardised residuals
plot(fit_garch, which = 10)
# 2. Conditional SD (vs |returns|)
plot(fit_garch, which = 3)
Two Informative Plots for GARCH(1,1)

Figure 11.2: Two Informative Plots for GARCH(1,1)