Hi, we have a problem concerning the use and forecasting on the GARCH (1,
1) on financial data.
We would like to make predictions on future returns in a loop which moves
the window of estimation forward one unit for each iteration. Our code is
as follows:
> BJORN <-
read.table("C:/Users/Osvald/Desktop/DATATILLUPPSATS.txt",
+ header=TRUE, sep="\t", na.strings="NA", dec=",",
strip.white=TRUE)> t <- as.timeSeries(BJORN)
> start=length(t[2:1834])
> end=length(t)
> fore = array(0, dim=(end-start))
> for (i in start:end) {
+fit <- garchFit(formula =garch(1,1), data = t[1:i])
+pred <- predict(fit, n.ahead=1)
+fore[i-start+1] = pred[,1]
+ }
[[alternative HTML version deleted]]