Forecast does not create output

Hey Guys,

I try to compare DSGE forecast peformance with VAR and this is my first time using Matlab/Dynare so the Question is hopefully a Basic one.

So I used the model creation of Johannes Pfeifer:
Basicly I got rid of everything non Basic, so the plots as well as everything that splits the data in pre and post 1980.

Now I got two issues I can’t solve,

  1. I added the forecast ; command, and it does plot forecasts, but no variable is saved in the Workspace where I could look at the values.

  2. I get that warning message About the hessian and the initial values but they are set according to the paper, is that an actual issue and Maybe the reason for the NaN in the ML estimation?

I hope somebody is able to help. Anyway thanks in Advance!


Nikolas Messerschmidt

  1. Do you mean there is no data in oo_.forecast?
  2. The reason for the warning is described in the notes to the mod-file

Some of the estimated parameters in Ireland are extremely close to the lower bound of 0. This creates problems in the computation of the Hessian at the mode as two-sided numerical derivatives cannot be computed. Ireland (2004) sidesteps this issue by using one-sided derivatives and an individually selected step size. Dynare does not (yet) offer this tailored approach as it is not generic.

The man himself, nice!

  1. There just is no oo_.forecast that I could look at.

  2. I see, sorry I overlooked that. Are the results still valid?

Ps: Really grateful for yout Github page, made getting into Matlab way more interesting as one can learn something about economics while doing so.



  1. That is strange. I would need to see the file.
  2. The point estimates are valid. You simply don’t get standard errors for inference.

ireland2.mod (3.1 KB)

This is the Code I changed, the rest is taken and left original from your GitHub page, should I upload that as well?

I am not sure what you are trying to do here, but I would have expected a forecast-option in the estimation command.

Oh okay, as I said I’m new to Matlab, sry if it’s something trivial. I checked the dynare Manual on forecasting command. There they just used forecast ; as a simple command just as I did, after the stoch_simul command. Specificly I just want to forecast the observable variables, namely g, pi and r.
Do I have to specify them as gobs, robs and piobs in the estimation command or what is the issue?

Usually when people put an estimation command in their forecasting mod-file, they want to do out of sample forecasts after the end of the estimation sample, given the estimated final smoothed states. For that, we have the forecast option of the estimation-command.

I’m sorry, I just can’t get it to work, my estimation command looks like this now:
estimation(datafile=data_full_sample,mode_compute=4, forecast= 12, consider_only_observed);

which gives me some forecasts, but I still got no oo_.forecast in the Workspace…

Please provide all files required to replicate the issue. Which version of Dynare are you using?

I use Version 4.5.7. The data is a .dat but I’m not allowed to upload such a file and can only upload two links. But it is also on your GitHub page :slight_smile:
ireland2.mod (3.1 KB) 4.m) (140 Bytes)

data_full_sample.m (140 Bytes)

After running your code and entering in the command window

I get

ans =

struct with fields:

  Mean: [1×1 struct]
HPDinf: [1×1 struct]
HPDsup: [1×1 struct]

Just as it should be

I’m sorry, it did work for me as well now, thank you a lot for the help, the hint to include it into estimation was gold!



One more thing, as mentioned the forecast is done, but it calculates Zero for all values over all periods, that can’t be Right?

You need to delete the last forecast-command. Given that you did not set any path or initial condition, it starts at the steady state and will overwrite the forecasts from the estimation command.