# In sample forecast, but more than one step

In a paper ( Policy analysis using DSGE models: an introduction), the authors estimate their model using data from 1984:1 to 2007:4.

And then they do a forecast from 2003:1 to 2005:1 (inflation was increasing during that episode). So they wanna ask if the surge in inflation was foreseeable by comparing actual data with the model forecast for that episode.

In dynare (Bayesian estimation), I can reduce the sample to 1984:1 to 2002:4 and do an out-of-sample forecast from 2003:1 to 2005:1. But that means the parameters of the model will be estimated only with data from 1984:1 to 2002:4.

However, in the paper, the estimation is done using data from 1984:1 to 2007:4.

`My question is:` can dynare do in-sample forecast but more than one step? Thanks! I am not sure I understand what you want to do here. There are two sources of uncertainty: parameter uncertainty and state uncertainty. It seems you want to use the full sample to estimate the parameters, but not use the full sample to get a smoothed estimate of the states. This would imply you un the `calib_smoother` with the `filter_step_ahead`-option.

Dear Prof Pfeifer, sorry for the confusion. So in the paper, they do the following:

1. Estimate the model using Bayesian technique and the full sample.
2. They then present moment matching results (the model matches data quite well).

Then they say the following, “To show how our model can be used to address specific policy questions, we examine a particular historical episode: the puzzling pickup in inflation in the first half of 2004. This exercise allows us to illustrate how we use the model’s forecasts to construct alternative scenarios for counterfactual policy analysis.”

1. So they forecast inflation from 2003:1 to see if the model could predict the data (i.e., inflation, output, federal funds rate)…which answers the question, “was the inflation pickup in 2004 foreseeable according to the model?”

I understand what they are doing but not sure how they did that forecast…because they didn’t re-estimate the model using data prior to 2003:1 to do an out-of-sample forecast from 2003:1. Seems to be an in-sample forecast but many steps ahead.

`calib_smoother` with the `filter_step_ahead`-option seems to be it. I will check it. Thanks!