Same model, Matlab and Dynare give different solution

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.

Same model, Matlab and Dynare give different solution

Postby Nicole » Fri Jun 03, 2016 12:58 pm

Hi everyone,

I hope someone is able to shed some light on an issue that's been bothering me for quite some time now. I'm simulating a two-equation deterministic new-Keynesian model. It's very simple - one equation for the output gap (x) and one for inflation (pi):

x = x(t+1) - sigma*(i(t) - pi(t+1))
pi = B*pi(t+1) + k*x

Where sigma =1, k = 0.2, and B = 0.97. I rendered interest rate (i) exogenous since I want that to be equal to 0 for all periods up to t=0, where it jumps to 1.

I have followed the paper (Cochrane, 2015) that simulates this model in deriving the model solutions manually and have graphed those in Matlab, producing the same output as in the paper (I have attached my Matlab code). However, if I put this model in Dynare (.mod file attached) - as far as I know including all correct blocks and commands etc. - the output is different: inflation and output both, when graphed, show much steeper and faster dynamics than when they are graphed in Matlab from the solutions. This strikes me as odd as the graphs should be the same! After all, solving the model manually versus having Dynare solve it should not make a difference. The steady state values derived are correct, it's only the dynamics in the graphs that are not correct.

Any ideas what might be going wrong here?

Note: please only focus on the dotted lines in the matlab graph, for the unexpected case (solid lines is expected), as this is the one I'm also modelling in Dynare.

Thank you very much in advance!
Attachments
BasicModelCochrane.mod
(495 Bytes) Downloaded 128 times
inflation_output_exp_unexp.m
(1.98 KiB) Downloaded 124 times
Nicole
 
Posts: 10
Joined: Tue Apr 05, 2016 8:25 am

Re: Same model, Matlab and Dynare give different solution

Postby jpfeifer » Sun Jun 05, 2016 6:23 pm

Are you sure that you are using the same solution concept and that his exercise can be conducted with Dynare?
------------
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: Same model, Matlab and Dynare give different solution

Postby Nicole » Mon Jun 06, 2016 1:12 pm

Thank you for your response.

I believe I do, but I am not 100% sure regarding the solution concept. Do you think there might be some crucial differences in solving the model manually and solving it with dynare? Could you possibly elaborate on this?

Also, I have simply assumed the this exercise could be conducted by Dynare. Since it is a rather simple linear two-equation model with a shock I did not see any reason why it would not be possible to use Dynare for this. It might be that I am overlooking something here, but it I double checked the equations and it all seems to be 'correct' - e.g., as in the article.
Nicole
 
Posts: 10
Joined: Tue Apr 05, 2016 8:25 am

Re: Same model, Matlab and Dynare give different solution

Postby jpfeifer » Wed Jun 08, 2016 5:18 pm

I haven't read the paper, but usually the model follows a Taylor rule after the ZLB period. This needs to be accounted for when specifying the terminal condition in endval. It might not be straightforward to implement this
------------
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: Same model, Matlab and Dynare give different solution

Postby Nicole » Fri Jun 10, 2016 7:45 am

Thank you for your reponse! I think the addition of the Taylor rule might indeed be the solution. I've tried a few things, but no luck so far. Including the taylor rule directly into the model block results in Dynare not finding any steady state values. I'll see what I can do though and work on it more. Again, thank you very much for your time and help!
Nicole
 
Posts: 10
Joined: Tue Apr 05, 2016 8:25 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests