[R-SIG-Finance] Garch question

Spencer Graves spencer.graves at pdf.com
Sun Feb 3 21:19:12 CET 2008


The whitened residuals are assumed to be serially uncorrelated.  
Therefore, sqrt(cumsum(estimated variance)) should give an estimate of 
the standard deviations of the predictions. 

In particular, consider the following: 

      library(fGarch)
      fit <- garchFit(diff(log(x))

      pred.dlx <- predict(fit) 

      pred.lx <- cumsum(pred.dlx[, 1])

      pred.slx <- sqrt(cumsum(pred.dlx[, 3]^2))

      pred.x <- exp(pred.lx)
      ul <- exp(pred.lx + 1.96*pred.slx)
      ll <- exp(pred.lx - 1.96*pred.slx)

EXAMPLE: 

      library(FinTS)
      library(fGarch)
      data(sp500)
      spFit30.11 <- garchFit(sp500~arma(3,0)+garch(1,1),
                       data=sp500)
      pred.spFit00.11 <- predict(spFit00.11)

      cumPred <- cumsum(pred.spFit00.11[, 1])
      cumPredS <- sqrt(cumsum(pred.spFit00.11[, 3]^2))

... see the discussion of Figure 2.15 in 
"~R\library\FinTS\scripts\ch02.R", where "~R" is your local R 
installation directory. 

      Hope this helps. 
      Spencer

babel at centrum.sk wrote:
> 1. Can I use garch model on price series or do I need to transform it to return,  for example ret<-diff(log(x))?
> 2. If yes, then how can I predict the future values, while I am working with return? 
> 3. library(fArma)   
>   fit1 = armaFit(~ arma(1, 0), data = x)
>   predict(fit1, 10)
>
>  1.179176 1.179747 1.180312 1.180871 1.181425 1.181974 1.182517 1.183054   1.183586 1.184113
>
>
> with Arma there is no problem with prediction. But how can I use ARMA to predict a mean and GARCH for variance?
>
> fit = garchFit(~garch(1, 1), data =ret )     #if I use data=x the estimated coeficients are not significant
> predict(fit,n.ahead=10)
>  meanForecast meanError standardDeviation
> 1  -0.007308328 0.5299619         0.4586886
> 2  -0.007308328 0.5299619         0.4588551
> ....................................................................................
> How can this output help me, to improve the result of ARMA forecasting? Should I add Garch standard deviation to ARMA prediction?
> Or I can even use this formula>:
>
> fit = garchFit(~arma(1,0,0)+garch(1, 1), data =ret)
>
>  meanForecast meanError standardDeviation
> 1  -0.025711384 0.5292999         0.4589430
> 2  -0.006770741 0.5296301         0.4591042
>
> but what to do with this? I expected values like in pure ARMA>>  1.179176 1.179747  .... ...  or can I somehow transform this return back into price time series?
>
> Sorry for my english and poor statistical knowledge, I just dont understand what to do with garch output. I read that GARCH model gives better result in forecasting than ARMA, but I dont know how to get those future values. The values, that tells you something (price values) not the return series. Anyway, many thanks.
>
> John
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. 
> -- If you want to post, subscribe first.
>



More information about the R-SIG-Finance mailing list