I'm using the DLM package to estimate a multivariate time series, I wanna check the out of sample forecasting, by estimating the residuals for 1, 6, 12 months ahead forecast? How can I calculate the 6 and 12 months ahead forcast like the kalman filter does for 1 month ahead forecast?
Thanks
Since this question is too general I update it.
My question was: I have a times series which go from 1970 to 1990, and I want to check if my model gives a good out of sample fit. In order to do so I divide my dataset in two parts and starting from January 1980 I calculate 1 month ahead forecast errors, by dlm (f). Than I want to calculate 12 months ahead forecast errors, so once my t is january 1980 then february 1980, and so on. I would like to know if there's a way to do so?
Thanks
Maybe is better to specify my question a little more, because I did a mistake, sorry. I estimate the model recursevely from 1970:1 to 1980:1 (dlm), , at t=1980:1 I estimate y(t+12) and I compare it with the real y(t+12), then I estimate y(t+12) but t=1980:2, and so on. I would like to know which is the way to do it automically? Cause I thought that i can ran a dlm and use the dlmForecast and change every time the dataset through the window command, but I don't think it's the right way. Maybe for (i in 1:10){ fit = dlmFilter((window(data, start=1, end=12+i),mod), dlmForcast(FIT, nahed=12)