I have used the option: filter_step_ahead = [1 2 3 4] in the estimation command to generate 1 to 4 quarters-ahead filtered estimates of some variables. I want to evaluate the real-time forecast accuracy.
Now in the oo_ structure, I have 4 folders: Filtered_Variables_1/2/3/4_step_ahead.
Suppose I open Filtered_Variables_4_step_ahead. This has as many values as the number of time periods in my data. Now let us concentrate on the first value. What does it signify? Is it, 4-quarter ahead forecast evaluated at t=1 or 4-quarter ahead forecast evaluated at t = -3 ?
From the manual on
Variable set by the estimation command, if it is used with the filter_step_ahead option.
The k-steps are stored along the rows while the columns indicate the respective variables. The
third dimension of the array provides the observation for which the forecast has been made. For
example, if filter_step_ahead=[1 2 4] and nobs=200, the element (3,5,204) stores the four
period ahead filtered value of variable 5 computed at time t=200 for time t=204. The periods
at the beginning and end of the sample for which no forecasts can be made, e.g. entries (1,5,1)
and (1,5,204) in the example, are set to zero. Note that in case of Bayesian estimation the
variables will be ordered in the order of declaration after the estimation command (or in general
declaration order if no variables are specified here). In case of running the classical smoother,
the variables will always be ordered in general declaration order. If the [selected variables only],
page 77 option is specified with the classical smoother, non-requested variables will be simply
left out in this order.
I wanna do a 1-step to 7-steps ahead forecast from the 20th period in the sample, so I do something like the following, right?
calib_smoother(datafile=pickupdata0, filtered_vars, filter_step_ahead = [1 2 3 4 5 6 7]) y i pi;
Then outside the mod file, I do the following. (pi is 1st variable in
el = oo_.FilteredVariablesKStepAhead;
el20_pi = [el(1,1,21) el(2,1,22) el(3,1,23) el(4,1,24) el(5,1,25) el(6,1,26) el(7,1,27)];
Then I can compare the forecast over 7 periods (above) with filtered
pi over that same period.
Actually, I wanted to compare non-filtered-variable forecasts over some period in the sample with observed data over that same period. But it seems it is not possible in dynare yet, and the closest is comparing the forecast of filtered variables to the filtered variables themselves…over a given period in the sample (not outside the sample).