estimation endog priors & historical and smoothed variables

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

estimation endog priors & historical and smoothed variables

Postby pap » Wed Nov 02, 2016 7:43 pm

Dear all,

I am a beginner with Dynare, DSGE models and DSGE estimation. So, I hope that my questions are not that inappropriate.

I am learning how to use Dynare to do Bayesian estimation with a linearized small open economy NK model. So far, the simulation has worked pretty well, but unfortunately, the estimation has been giving me a headache.

In particular, I have ecountered two problems:

1) Dynare reports the "Historical and smoothed variables" for all observable variables, and one of the variables is very poorly matched. I've read this can be the case because of stochastic singularity, but I have as many osbervables as shocks. Any ideas how can I fix this?

2) I wanted to try the estimation using endogenous priors as in Christiano, Trabandt and Walentin. So far, I believe that I understand the statistics behind this approach well. However, here I've encountered some problems:
When I use lik_init=2, I get the following message: "Error using dsge_likelihood (line 812) Endogenous prior not supported with non-stationary models"
Therefore I've changed it to lik_init=1 (which, btw, does not work for me when I try to estimate whitout endogenous priors, any idea why?). Anyway, after changing to lik_init=1, Dynare works until it crashed because of: "Error using chol Matrix must be positive definite." I've read that a quick war to fix this is by changing mode_compute. I've tried this several times but it does not work. ANy idea how to fix this?

I woul dreally appreciate your help! Thank you very much in advanced!

Best,
Paul
Attachments
estimation.zip
(20.56 KiB) Downloaded 114 times
pap
 
Posts: 3
Joined: Wed Nov 02, 2016 6:22 pm

Re: estimation endog priors & historical and smoothed variab

Postby jpfeifer » Thu Nov 03, 2016 8:51 am

1. Having as many shocks as observables is necessary, but not sufficient to avoid stochastic singularity. It must also hold that the observables are not linearly dependent like it would be the case if you were observing all components of the budget constraint.

2. Your model has a unit root, implying that some of the variables in your model do not have finite moments. That's why you need to use the diffuse filter. The endogenous_prior option relies on the moments of the observables being finite. For that reason we currently do not allow it with non-stationary models. That may change in the future, because we only need the observables to be stationary, not all variables.

3. The big problem with your model are the observation equations. You are trying to estimate your linearized model where all variables are mean 0 with non mean zero data. At the same time, your standard deviations suggest you are thinking about observables scaled by 100, but they were not scaled. You should also check whether the frequency of the inflation and interest rates matches your model frequency. See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: estimation endog priors & historical and smoothed variab

Postby pap » Thu Nov 03, 2016 10:29 am

Wow, thanks for the super quick and useful reply! I really apreciate it!
pap
 
Posts: 3
Joined: Wed Nov 02, 2016 6:22 pm

Re: estimation endog priors & historical and smoothed variab

Postby pap » Tue Nov 08, 2016 5:42 pm

Dear Prof. Pfeifer,

thanks for the quick reply to my previous question. I have changed the model such way, that I believe it is stationary (in the policy function, I do not have any coefficients equal or larger to 1). However, I still have problems with the estimation (basic bayesian estimation, not with endogenous priors). Since my model does not have a unit root, I choose lik_init=1, which should work. However, when I do that, I get the following error message before the mh starts:

Error using chol
Matrix must be positive definite.
Error in gmhmaxlik (line 197)
dd = transpose(chol(CovJump));
Error in dynare_estimation_1 (line 438)
gmhmaxlik(objective_function,xparam1,[lb ub],...
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in JP10_est (line 493)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;

Again, I've tried to overcome this issue trying different values for mode_compute. Also, when I try the estimation with lik_init=2, I have results but they are weird: I have a lot of coefficients (much) larger than 1 on the policy functions, and, from seing the IRFs, some of the responses are even explosive!

Do you have an idea what could be the problem? I really appreciate your help!
Thank you very much!!!
Attachments
estimation.zip
(25.39 KiB) Downloaded 101 times
pap
 
Posts: 3
Joined: Wed Nov 02, 2016 6:22 pm

Re: estimation endog priors & historical and smoothed variab

Postby jpfeifer » Wed Nov 09, 2016 7:47 pm

1. Unit roots have nothing to do with coefficient in policy rules, unless you are in univariate equations. The check command actually provides the eigenvalues of your model and the unit root is still there.
2. There was a bug in Dynare 4.4.3 that affects your model (the qz_criterium was not correctly set, explaining why explosive IRFs are accepted during estimation). Please use the unstable version. Because of the unit root, you still need the diffuse filter. The unstable version will also tell you that there is still stochastic singularity in your model
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 4 guests