Page 3 of 3

Re: Uribe & Schmitt-Grohe

PostPosted: Wed Apr 15, 2015 7:39 pm
by RMB
Pfeiffer,

I am trying to incorporate your suggestions. The results are incredible fast now, when I put the analytical steady state.
I really would like, if you want and have some time, that you run my model and see if the results seems to you reasonable.

Thanks a lot,
Raphael

Re: Uribe & Schmitt-Grohe

PostPosted: Mon Apr 20, 2015 9:04 pm
by jpfeifer
There are a whole bunch of issues.

1. You are neglecting parameter dependence. Your calibration only once updates the other parameters depending on the estimated one. That’s why you should use model-local variables (the ones with the pound operator) or a steady state file. See Remark 4 (Parameter dependence and the use of model-local variables) in 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. I corrected this in the attached file.
2. Your investment FOC looks wrong. Why is there an I when only K is inside the adjustment costs in the budget constraint? You need to check/fix this. I presume you try to replicate http://www.columbia.edu/~mu2166/closing/edeir_model.m
3. Your priors are too narrow for some parameters. I widened them in the attached file.
4. You should better use a different mode-finder. I use 9 in the attached file
5. How did you detrend your data?
6. How did you calibrate the measurement error?

Re: Uribe & Schmitt-Grohe

PostPosted: Wed Apr 22, 2015 7:56 pm
by RMB
jpfeifer wrote:There are a whole bunch of issues.

1. You are neglecting parameter dependence. Your calibration only once updates the other parameters depending on the estimated one. That’s why you should use model-local variables (the ones with the pound operator) or a steady state file. See Remark 4 (Parameter dependence and the use of model-local variables) in 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. I corrected this in the attached file.
2. Your investment FOC looks wrong. Why is there an I when only K is inside the adjustment costs in the budget constraint? You need to check/fix this. I presume you try to replicate http://www.columbia.edu/~mu2166/closing/edeir_model.m
3. Your priors are too narrow for some parameters. I widened them in the attached file.
4. You should better use a different mode-finder. I use 9 in the attached file
5. How did you detrend your data?
6. How did you calibrate the measurement error?



Pfeifer,

You are correct about these issues. I would like to add some comments:
1. Sure, I really neglected it. I am reading the remark and I will adjust the code to consider it;
2. I am reading the FOC and I have to remember what kind of adaptation I had done. I will consider your note about it. Actually, I am trying to replicate some of Uribe's models, from his manuscripts (http://www.columbia.edu/~mu2166/book/oem.pdf), this one is chapter4;
3. Yes, I put too narrow because I was afraid my computer would take a lot of time to process it, but the case is just the opposite, because too narrow is not solving the problem;
4. The mode-finder I hadn't this information. I saw in the Dynare Reference Manual, page 51 (item 13), that this option 9 is not listed. I would like to know about it, if you have references;
5. I had detrended them by quadratic time. First, I applied logarithm to them and so I have applied quadratic time detrending. I have listened about other methods, but I chose this for all series used;
6. That is a important question. I do not know to calibrate the measurement error, so, I used it form the book. If you have any reference about, I will be very grateful to know.

I think that's all. I will take some time to see these points (1, 2, mainly). However, I am following your comments during the job.
Thanks again for help.
Raphael

Re: Uribe & Schmitt-Grohe

PostPosted: Sun Apr 26, 2015 8:51 am
by jpfeifer
2. That is the model where I linked to the codes. There you can look up the correct FOCs.
5. You can find out more about CMAES in Martin Møller Andreasen (2009): How to Maximize the Likelihood Function for a DSGE Model, DOI:10.1007/s10614-009-9182-6
6. There is no guidance, but if you are not sure, estimate the standard deviation.

Re: Uribe & Schmitt-Grohe

PostPosted: Tue Apr 28, 2015 8:30 pm
by RMB
Pfeifer,

I have fixed the investment FOC.
Code: Select all
exp(lambda)*(1+phi*(exp(k)-exp(k(-1)))) = beta*exp(lambda(+1))*(alpha*exp(y(+1))/exp(k)+1-delta+phi*(exp(k(+1))-exp(k)));

But, the errors returned.

Error using chol
Matrix must be positive definite.
Error in metropolis_hastings_initialization (line 68)
d = chol(vv);
Error in random_walk_metropolis_hastings (line 62)
[ ix2, ilogpo2, ModelName, MetropolisFolder, fblck, fline, npar, nblck, nruns, NewFile,
MAX_nruns, d ] = ...
Error in dynare_estimation_1 (line 782)
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in uribe_chapter4_peru_bayes_corrected (line 232)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;


Do you know what possible it will be wrong? It's again the chol error. Because before, it was an identification problem, but and now?

Re: Uribe & Schmitt-Grohe

PostPosted: Thu Apr 30, 2015 2:59 pm
by RMB
It's funny because when I just write the FOC investment like Uribe did in MatLab code, for example:
Code: Select all
e6 = -la* (1+PHI*(kp-k)) + BETTA * lap * (1-DELTA + ALFA * ap * (kp/hp)^(ALFA-1) + PHI * (kfup-kp));

like,
Code: Select all
exp(lambda)*(1+phi*(exp(k)-exp(k(-1)))) = beta*exp(lambda(+1))*(alpha*a(+1)*(exp(k)/exp(h(+1)))^(alpha-1)+1-delta+phi*(exp(k(+1))-exp(k)));

I have errors too.
I think write alpha*a(+1)*(exp(k)/exp(h(+1)))^(alpha-1) or alpha*exp(y(+1))/exp(k), there is not differences, but there is!

Other thing is Dynare stops in Figure 15 - Mode Check plots, and the graphics for phi and omega there are discontinuity points. I do not know whether this can mean the error is in there, but it was an observation of mime.

Well, I still desperate about my model. A little shocked because always the same has showed a mistake.

Re: Uribe & Schmitt-Grohe

PostPosted: Tue May 05, 2015 3:50 pm
by jpfeifer
When using
Code: Select all
exp(lambda)*(1+phi*(exp(k)-exp(k(-1)))) = beta*exp(lambda(+1))*(alpha*a(+1)*(exp(k)/exp(h(+1)))^(alpha-1)+1-delta+phi*(exp(k(+1))-exp(k)));

you forgot that there must be an exp() around the a(+1). When you put it there, it is identical.

Regarding the error message you get, you need to play around with different mode-finders. In the current iteration of your file, it works with mode_compute=6 (the default). Regarding the red points, see the description of mode_check in Pfeifer (2014): An Introduction to Graphs in Dynare at https://sites.google.com/site/pfeiferecon/dynare

Re: Uribe & Schmitt-Grohe

PostPosted: Tue May 19, 2015 6:57 pm
by RMB
Dear Pfeifer,

I think I got it. This is the dynare's code for Chapter 4 of Uribe,

Sorry for later, but I am waiting for running the code on other computer to verify if it was correct.
Any comments would be appreciate.

Thanks for help!