Why do FilteredVariablesKStepAhead and RecursiveForecast differ?

I want to recursively estimate a model on a growing sample (say from 50 to 55 periods) and get 1&2-step ahead out-of-sample forecasts of endogenous variables for each sub-sample (that is E_{t}y_{t+k} where t \in [50,55] and k \in [1,2] ).

In the estimation options I have: nobs=[50:55], filter_step_ahead = [1 2], forecast = 2 which results in oo_.FilteredVariablesKStepAhead and oo_.RecursiveForecast.Mean, respectively. I will denote E^F for the filtered values, E^R for the recursive forecasts and T as the final period considered.

I noticed that for all variables oo_.RecursiveForecast.Mean and oo_.FilteredVariablesKStepAhead coincide for the last period (E^F_T y_{T+k} = E^R_T y_{T+k} ), but not for any of the previous periods (E^F_t y_{t+k} \not= E^R_t y_{t+k} , for t \not= T). I understand that oo_.RecursiveForecast.Mean keeps the forecasts for each iteration of the estimation (50:55), whilst oo_.FilteredVariablesKStepAhead probably gets overwritten and at the end consists of only the last estimation (1:55 periods in this example). But how should the values of this final oo_.FilteredVariablesKStepAhead be interpreted then?

Given the following description of the filtered values, I would expect both to be equivalent (i.e. E^F_t y_{t+k} = E^R_t y_{t+k} ~ \forall t)

(4. The model file — Dynare 5.4 documentation)
filter_step_ahead = [INTEGER1 INTEGER2 ...]

Triggers the computation k-step ahead filtered values, i.e. E_t y_{t+k} . Stores results in oo_.FilteredVariablesKStepAhead. Also stores 1-step ahead values in oo_.FilteredVariables. oo_.FilteredVariablesKStepAheadVariances is stored if filter_covariance.

Is the case that the last oo_.FilteredVariablesKStepAhead matrix (at T ) somehow uses information of [t+1,T] even for filtered variables for any t<T? Perhaps E^F_{t|T} y_{t+k} forecasts y_{t+k} at period t with respect to exogenous variables, but uses an estimated model based on information up to an including T whilst E^R_t y_{t+k} by definition always uses an estimated model up to an including only t . Thus by construction, oo_.FilteredVariablesKStepAhead are only valid as out of sample forecasts at the last period ( E^F_T=E^R_T ).

Is this the right intuition? If so, then the only valid way to get recursive out-of-sample forecasts will be through oo_.RecursiveForecast.Mean.

Many thanks,

Exactly. The FilteredVariablesKStepAhead use the full available sample used for estimation to pin down the parameter values of the model. It is only the estimation set for filtering that is restricted to the observations up to the current period. That is different for oo_.RecursiveForecast. Here, the data used for the both the forecast and the parameter estimates coincide.

Excellent! Thank you for the quick response

Actually, how does the recursive estimation work? Does it simply substitute for coding a loop which reestimates the model on an ever growing sample or does it use some updated priors on each successive estimation?
Is there a command to speed up the recursive estimations? Say, skip the full reestimation on 1:t+1 but only use the new information between t:t+1.

Exactly, it’s a loop that increases the observations by 1 at a time. And no, there is no way of speeding this up. The factorization you envision would not work with the MCMC techniques, because the chain is sequential.

Thanks for the quick response! Do I understand correctly that on each new estimation Dynare still uses the original priors?
Perhaps using the posterior from one run as the prior to the next is equivalent to just using the original prior and fully reestimating the new augmented sample (thinking in terms of a Kalman filter)

Yes, but that would require you to be easily able to evaluate the “new prior” at whatever parameter value the solution algorithm will propose in the next step. But it does not have a closed-form solution. That’s the reason you have to recompute the full likelihood.

1 Like