To save time, I do the Laplace approximation only when estimating a model (i.e, set mh_replic=0). But then the filter_step_ahead option in the estimation command gives the forecasts (i.e., in oo_.FilteredVariablesKStepAhead) that are inconsistent with the case of mh_replic>0, i.e., the place of the variable is different - not of the same order as the order of variables under the estimation command.

I still don’t get how the ordering in filter_step_ahead works in Laplace with Bayesian estimation [it is not the order of variable declaration].

Take Dynare 4.4.3. In estimation, specify filter_step_ahead. Indicate just one endogenous variable under the estimation command. If mh_replic>0 then everything is ok, that is, the variable will be the first and only in oo_.FilteredVariablesKStepAhead (even without `selected_variables_only’ option).

But if mh_replic=0 then 1) `selected_variables_only’ option does not work, and 2) filter_step_ahead is performed for all the endogenous variables in the model (222 in my case). Also, the order of the interested variable in oo_.FilteredVariablesKStepAhead (#35) does not correspond to its order in the declared endogenous variables (#136).

PS: Attached is a mod-file (hopefully you don’t want to run it as it requires several more files).
gin ctw_employer_surplus100forecast1.mod (72.1 KB)