14
$\begingroup$

I have a question about the prediction of volatility and returns of a time series. Basically it is a question about predict in the fGarchpackage.

The following code is from the book Analysis of financial time series and it is an example of AR/GARCH models for the log returns of the SP500

library(fGarch)
sp5=read.table("http://faculty.chicagobooth.edu/ruey.tsay/teaching/fts/sp500.dat")#Load data
plot(sp5,type="l")
m1=garchFit(formula=~arma(3,0)+garch(1,1),data=sp5,trace=F)
summary(m1)
m2=garchFit(formula=~garch(1,1),data=sp5,trace=F,cond.dist="std")
summary(m2)
stresi=residuals(m2,standardize=T)
plot(stresi,type="l")
Box.test(stresi,10,type="Ljung")
predict(m2,5)

First we assume an ARMA/GARCH model. However, we see that all the coefficient from the AR model are not significant. Hence we model a pure GARCH time series. My question is about the very last command. Running this command gives the following output:

    > predict(m2,5)
  meanForecast  meanError standardDeviation
1  0.008455044 0.05330089        0.05330089
2  0.008455044 0.05327886        0.05327886
3  0.008455044 0.05325781        0.05325781
4  0.008455044 0.05323769        0.05323769
5  0.008455044 0.05321847        0.05321847

What is here the meanForecast and why is it always the same number? Is there a way to get the n-th volatility forecast as well as the n-th return forecast, e.g. the predicted volatility for the next day as well as the return. In the case of the model m2 the volatility forecast will be the return forecast, since we assume a pure GARCH model. But how can we extract both in the m1case?

Edit: as asked by user12348 here are my outputs of summary(m1) and summary(m2).

> summary(m1)

Title:
 GARCH Modelling 

Call:
 garchFit(formula = ~arma(3, 0) + garch(1, 1), data = sp5, trace = F) 

Mean and Variance Equation:
 data ~ arma(3, 0) + garch(1, 1)
<environment: 0x6ac79b0>
 [data = sp5]

Conditional Distribution:
 norm 

Coefficient(s):
         mu          ar1          ar2          ar3        omega  
 7.7077e-03   3.1968e-02  -3.0261e-02  -1.0649e-02   7.9746e-05  
     alpha1        beta1  
 1.2425e-01   8.5302e-01  

Std. Errors:
 based on Hessian 

Error Analysis:
         Estimate  Std. Error  t value Pr(>|t|)    
mu      7.708e-03   1.607e-03    4.798 1.61e-06 ***
ar1     3.197e-02   3.837e-02    0.833  0.40473    
ar2    -3.026e-02   3.841e-02   -0.788  0.43076    
ar3    -1.065e-02   3.756e-02   -0.284  0.77677    
omega   7.975e-05   2.810e-05    2.838  0.00454 ** 
alpha1  1.242e-01   2.247e-02    5.529 3.22e-08 ***
beta1   8.530e-01   2.183e-02   39.075  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log Likelihood:
 1272.179    normalized:  1.606287 

Description:
 Wed Apr 23 18:07:32 2014 by user:  


Standardised Residuals Tests:
                                Statistic p-Value     
 Jarque-Bera Test   R    Chi^2  73.04843  1.110223e-16
 Shapiro-Wilk Test  R    W      0.9857968 5.961505e-07
 Ljung-Box Test     R    Q(10)  11.56744  0.3150483   
 Ljung-Box Test     R    Q(15)  17.78746  0.2740041   
 Ljung-Box Test     R    Q(20)  24.11916  0.2372259   
 Ljung-Box Test     R^2  Q(10)  10.31614  0.4132084   
 Ljung-Box Test     R^2  Q(15)  14.22819  0.5082978   
 Ljung-Box Test     R^2  Q(20)  16.79404  0.6663039   
 LM Arch Test       R    TR^2   13.34305  0.3446074   

Information Criterion Statistics:
      AIC       BIC       SIC      HQIC 
-3.194897 -3.153581 -3.195051 -3.179018 

> 

and for summary(m2):

> summary(m2)

Title:
 GARCH Modelling 

Call:
 garchFit(formula = ~garch(1, 1), data = sp5, cond.dist = "std", 
    trace = F) 

Mean and Variance Equation:
 data ~ garch(1, 1)
<environment: 0x6b70f70>
 [data = sp5]

Conditional Distribution:
 std 

Coefficient(s):
        mu       omega      alpha1       beta1       shape  
0.00845504  0.00012485  0.11302582  0.84220210  7.00318063  

Std. Errors:
 based on Hessian 

Error Analysis:
        Estimate  Std. Error  t value Pr(>|t|)    
mu     8.455e-03   1.515e-03    5.581 2.39e-08 ***
omega  1.248e-04   4.519e-05    2.763  0.00573 ** 
alpha1 1.130e-01   2.693e-02    4.198 2.70e-05 ***
beta1  8.422e-01   3.186e-02   26.432  < 2e-16 ***
shape  7.003e+00   1.680e+00    4.169 3.06e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Log Likelihood:
 1283.417    normalized:  1.620476 

Description:
 Wed Apr 23 18:09:17 2014 by user:  


Standardised Residuals Tests:
                                Statistic p-Value    
 Jarque-Bera Test   R    Chi^2  99.61249  0          
 Shapiro-Wilk Test  R    W      0.9836345 9.72802e-08
 Ljung-Box Test     R    Q(10)  11.37961  0.3287173  
 Ljung-Box Test     R    Q(15)  18.2163   0.2514649  
 Ljung-Box Test     R    Q(20)  24.91842  0.2045699  
 Ljung-Box Test     R^2  Q(10)  10.52266  0.3958941  
 Ljung-Box Test     R^2  Q(15)  16.14586  0.3724248  
 Ljung-Box Test     R^2  Q(20)  18.93325  0.5261686  
 LM Arch Test       R    TR^2   14.88667  0.247693   

Information Criterion Statistics:
      AIC       BIC       SIC      HQIC 
-3.228325 -3.198814 -3.228404 -3.216983 

> 
$\endgroup$

2 Answers 2

5
$\begingroup$

The mean could be the long run variance which is

sig2 = fit.Constant/(1-fit.GARCH{1}-fit.ARCH{1});

I hope this explains.

If not, note I ran this model through Matlab, I get different values. you can paste your m1 and m2 values and some other intermediate results so I can see why Matlab differs.

EDIT: The question refers to forecasting the returns. Using AR-GARCH model, $$r_t= μ+\epsilon_t$$ $$ z_t=\epsilon_t/σ_t $$ $z_t$ is white noise or i.i.d, and can take any distribution. $$σ_t^2=w+\alpha \epsilon_{t-1}^2+\beta σ_{t-1}^2$$ The predict function in R is forecasting $r_{t+k}$ where k is the periods into the future. It is also possible to forecast future variance, $σ_{t+k}^2$,as shown, using GARCH formula above.

$\endgroup$
13
  • $\begingroup$ you can find my outputs above. If it is indeed $\sigma^2$, then I would like to know how I can predict the ARMA part (in the first case) and therefore predict the returns at all. $\endgroup$
    – math
    Commented Apr 23, 2014 at 16:10
  • $\begingroup$ The predict is forecasting the returns series. You can see mu = 8.455e-03 which is what it is predicting too. The reason they are all the same is that data volatility has almost died out, the Garch variance will revert to mean. In terms of getting the predicted garch variance, Matlab has a infer function. Please search the R manual for it. Doing so will help deepen understanding. $\endgroup$
    – user12348
    Commented Apr 24, 2014 at 1:06
  • $\begingroup$ thanks for your comment. Just one additional question. Assuming ARMA-GARCH means a model of the form: $r_t=\mu_t+\sigma_tZ_t$, where $\mu_t$ is modelled by the ARMA process, $\sigma$ by the GARCH and $Z_t$ is strict white noise. In this case, since $\sigma$ is so small, the forecast is more or less $r_t$ but if $\sigma$ isn't that small, then we just forecast $\mu_t$ and not $r_t$, right? $\endgroup$
    – math
    Commented Apr 24, 2014 at 7:20
  • $\begingroup$ I would like agree with you. We always forecast $r_t$ the LHS. μ is not time dependent. $z_t$ is white noise. $z_t$ can be quite large. If $σ_t$ is zero then rt is just μ else it is $μ+σ_t z_t$. Smallness of sigma is deceiving. Percentage-wise RHS does make a difference. $\endgroup$
    – user12348
    Commented Apr 24, 2014 at 14:06
  • $\begingroup$ Actually that's not true. $\mu$ depends on $t$. I model this using an ARMA process (at least in the first case, model m1). This is a general approach where you model the conditional expectation (using ARMA) and the conditional variance (GARCH). $\endgroup$
    – math
    Commented Apr 24, 2014 at 14:14
1
$\begingroup$

What is here the meanForecast and why is it always the same number?

It is the point forecast due to the conditional mean model. Since it is just a constant in your model m2, the forecast is also constant.

Is there a way to get the n-th volatility forecast as well as the n-th return forecast, e.g. the predicted volatility for the next day as well as the return.

The documentation of the predict function is not very explicit, but the first column meanForecast gives the point forecast and I guess the third column standardDeviation gives the conditional standard deviation forecasts due to the GARCH model. Square them to get the conditional variance forecasts.

In the case of the model m2 the volatility forecast will be the return forecast, since we assume a pure GARCH model.

Volatility forecast will be the return forecast? In what sense? A return is a random variable, volatility is its property. If by return forecast you mean a point forecast, again this is not the same as volatility forecast.

But how can we extract both in the m1 case?

predict gives you the conditional mean and conditional standard deviation forecasts in the first and the last columns. Square the latter to get the conditional variance forecasts.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.