Obtain forecasts after loading posterior means

Dear all, may I ask how to first load the posterior means after a Bayesian estimation and then generate forecasts?

What I did is the following:

(1) After running the estimation command in the first mod file, I stored everything in a mat file called “workspace”.

(2) There are “dataset_” and “oo_” (and other related structs) in the “workspace”. Inside the “oo_” struct, there are “oo_.posterior_mean”, “oo_.SmoothedVariables” (and other related structs).

(2) Then, in the second mod file that is used to obtain forecasts, I replaced the estimation command by the following two lines at the end:

load workspace;
forecast gdp_obs;

(3) After I ran this second mod file, Dynare didn’t end up with any error, but it didn’t calculate any forecasts either. There is a resulting “oo_.forecast” struct, but the values of the “gdp_obs” just stay at the steady state.

So what is the correct way to do it? Thanks for your attention in advance!

Please refer to Forecast from the last observations, calibrated model

Dear Professor Pfeifer,

Thanks for your reply. I read the post you mentioned, but I am not sure whether the goal is the same. In that post, the author wanted to forecast variables by setting parameters to their calibrated values, but here I would like to set parameters to their posterior means.

By using mode_compute=0, will Dynare calculate forecasts by fixing parameters at their
(1) calibrated values,
(2) maximum likelihood estimates, or
(3) posterior means?

The forecasts of the GDP growth in the graph below seem to suggest the first possibility.


The red line is the mean GDP growth forecast based on posterior subdraws and the blue line is the forecast based on mode_compute = 0.

It seems that the red line converges to 0.66, which is quite close to both the ML estimate (0.668) or posterior mean (0.667) of the steady state of the GDP growth. However, the blue line converges to 0.5, which is the prior mean of this steady state.

Of course I can write a program to systematically change the calibrated value of the parameters to their posterior means and then make forecast under mode_compute = 0, but I was wondering if there is an easier way to do it. Thank you!

Professor Pfeifer, I used the method you explained in that post and calculated the forecasts and smoothed variables by fixing all the parameters to their posterior means. I also compared these results to the results obtained from posterior subdraws.

The comparison results are summarized in the folloing post and are somewhat hard to explain. Could you please take a look them please?

mode_compute=0 will use the initial calibration, the starting values for estimation or the mode_file-specified, depending on what is present. For now, due to a bug, there is no easy alternative to manually setting the parameters. I will have deeper look at the other post soon.