I’ve already written this question, but probably I didn’t specified it well, for this reason I write it again. I need to use a random walk model (no-change) yt = yt(1+t) to compute the ratio of RMSFE. What I would like to do is:
- Fit the model to the data
yt,...,yt+k−1and letyˆt+kbe the forecast for the next observation. - Compute the forecast error as
et=yˆt+k−yt+k. Repeat for
t=1,...,n−k"residuals1 <- rep(0,58) residuals6 <- rep(0,58) residuals12 <- rep(0,58) y1 <- t(y[,1]) for (i in 1:58) { residuals1[i] <- y1[134+i+1]-y1[134+i] residuals6[i] <- y1[134+i+6]-y1[134+i] residuals12[i] <- y1[134+i+12]-y1[134+i] }
Is it a correct way to compute the out.of sample forecasting errors or am I missing something? I would appreciate any suggestions. Thanks!