How to really use epilogue variables?

Hi all,

I was wondering if anyone could show me how to use epilogue variables. I already read the instruction in the manual, but it still confuses to me, so I am here to find some help.

Specifically, I wish to obtain the forecasts of a variable that is not defined in the model block. Say, the model includes real GDP growth and GDP deflator growth, and I want to obtain the forecasts of nominal GDP growth, which should be defined in the epilogue. My questions are:

(1) Where should I put this epilogue block? Before or after the estimation command?
(2) According to the Dynare manual, “posterior smoother subdraws can be recycled for computing epilogue variables without rerunning subdraws”, so how could this be done?


@sebastien Do you know?

Regarding the first question, I think the position of the epilogue block does not matter.

For the second question, @rattoma is the person to ask.

Hi, I will prepare an example and share it.

Thanks to @jpfeifer and @sebastien, and looking foward to the example from rattoma!

The epilogue block creates a function <mymodel>.epilogue_dynamic(M_.params, ds); that requires as input the model parameters and a time series object. Here <mymodel> denotes the name of your mod file.

the following code produces smoothed epilogue variables.

  1. produce a time series object out of your smoothed variables:
for j=1:M_.endo_nbr
ds = [ds dseries(oo_.SmoothedVariables.(M_.endo_names{j}), dates('2000Q1'), M_.endo_names{j})];
  1. get the augmented time series object including the epilogue variables
ds = <mymodel>.epilogue_dynamic(M_.params, ds);

If you want to recycle posterior subdraws, you need to load the variable stock in file <mymodel>/metropolis/<mymodel>_smooth1.mat.

Variable stock has size [ nendo * T * draws], so, for draw j you can produce the time series object of smoothed variables of draw j:

dspost = dseries(squeeze(stock(:,:,j))', dates('2000Q1'), M_.endo_names);

then you can get the epilogue similarly

dspost = <mymodel>.epilogue_dynamic(M_.params, dspost);

Thank you very much @rattoma! I will try to fit your code into my estimation and see if it works.