Specification of data for Bayesian estimation in log-linearized model

Dear all,

I have a question regarding the data adjustment for the Bayesian estimation with a log-linearized model. I have read the recommended publication from Prof. Pfeifer and since it was already discussed extensively in the forum, I followed the forum posts but I still get error messages and I assume that I haven’t fully grasp the procedure yet.
When I run the variables separately from each other in different files, I get a reasonable output for inflation (Infl_obs). However, I get error messages for r_obs and particularly y_obs constantly, so I must have done something wrong and I assume there is a mistake in my data.
And of course, when running all three variables together, I don’t get an output. Can one of you tell me, where my mistake is and why I can only run them separately ?
I have attached my Estimation file and the Data.

Thanks a lot for your help!


Datafile_Estimationfile.zip (45.6 KB)

You are still using trending data. You are supposed to use the log difference of output and of the price level. Instead, you are working with the log price level, for example.

Thank you very much for your answer, professor.

So, I would still apply:
I. log(real GDP per capita)-mean (log (real GDP per capita))
II. log (infl )- mean (log (infl))

and then I have to take the results from I. and II. and take the difference of the prior period. For example lets say my results from I. are

then y_obs would be (-0.104882400)-(-0.108141800) and

with an observation equation of y_obs=y

Would that be correct?

Thanks a lot, I appreciate it !

Which data do you want to use? I guess demeaned growth rates. So you should first take the log difference to obtain the growth rate and then subtract the mean growth rate.

I have spent a whole week on trying to estimate the model and with your advice I finally succeeded. Thanks a lot for your help, Professor

Dear Professor Pfeifer,

thanks to your advice I’ve managed to transform the data accordingly and got a reasonable output for my model. I’ve also observed mode_check and it was fine. However, if I’m running an extended version of the model, i.e. with external habit formation, it results again in error messages (Error using chol
Matrix must be positive definite […]). I have also checked the mode_check and several parameters display a lot of red dots. I cannot find mistakes in my data and for the baseline version it worked well, but as far as I have understood it the error message indicate a problem with the data. The model equations should be fine since I get an output for the irf. The prior of the habit parameter is taken from Smets and Wouters (2007).
Could you tell me whether there is still a mistake in my data or if the there is profound problem in my estimation file?
As before, I have attached both estimation file and data file.

Thanks very much,


Estimationfile and Datafile.zip (76.3 KB)

  1. There are identification issues in your model.
  2. With mode_compute=5, it works.

That was very helpful and now it works. Thank you very much, Professor!