# what is the return value of predict in the fGarch package

I have a question about a quit sophisticated model for a time series. Suppose $\{X_t:0\le t\le T\}$ is a time series. The plot of autocorrelation function and partialcorrelation function suggest and ARMA model. However, I also want to model the volatility, hence I use a ARMA(p,q)-GARCH(1,1) model, say. This means

$$X_t=\mu_t+\sigma_t Z_t$$ $$\mu_t=\mu +\sum_{i=1}^p\phi_i(X_{t-i}-\mu)+\sum_{j=1}^q\theta_j(X_{t_j}-\mu_{t-j})$$ $$\sigma_t^2=\omega+\alpha_1(X_{t-1}-\mu_{t-1})^2+\beta_1\sigma_{t-1}^2$$

Then $\mu_t$ models the conditional expectation and $\sigma_tZ_t$ the conditional variance, where $\{Z_t\}$ is a strict white noise.

In R we can use

model <- garchFit(formula=~arma(p,q)+garch(1,1),cond.dist="std",trace=F)


command where we have to specify $p,q$ and we decided to assume the white noise has a student $t$ distribution. Using the built in functin predict we can get a forecast for the next day:

predict(model,n=1)


However what is the return value of predict? Does it forecast $\sigma_{t+1}^2$, $\mu_{t+1}$ or $X_{t+1}$ and how can I get the other two forecasts within R?

• Is there anything that haven't been answered on quant.SE where you posted a closely related question?
– chl
Commented Apr 24, 2014 at 18:59
• @chl thanks for your comment. Meanwhile, there is just one question left: Is there a built in function in R or do I have to use the given relations.
– math
Commented Apr 25, 2014 at 6:45

## 1 Answer

I see that it is an old post, but I came across the same problem recently. I am not sure what this value implies, but, it is not the forecast for sure. One reason is that if you run the following

predict(model,n=1000)


and look at the time series, the values are the same with a greater mean squared error. Nevertheless, the main premise behind the GARCH model is stationarity such that the volatility converges to a fixed value over time.

To demonstrate this, for a stationary time series R, consider the following

g <- garchFit(formula = ~ garch(1,1),data = R,trace = F)
h.t <- [email protected]
eps <- g@residuals
B <- coef(g)
my.predict <- function(k) {
h.predict <- B[2] + h.t[length(R)]*B[4] + (eps[length(R)]^2)*B[3]
i <- 2
while(i <= k) {
h.predict[i] <- B[2] +  h.predict [i-1]*(B[4]+B[3])
i <- i + 1
}
return(h.predict)
}
plot(my.predict(1000), type = "l")
grid(20)
abline(h = B[2]/(1-B[3]-B[4]), lty = 2)


where the horizontal line is the unconditional variance: $$\sigma^2 = \frac{\omega}{1-\alpha-\beta}$$