Same model, Matlab and Dynare give different solution

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 = Bpi(t+1) + kx

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!
BasicModelCochrane.mod (495 Bytes)
inflation_output_exp_unexp.m (1.98 KB)

Are you sure that you are using the same solution concept and that his exercise can be conducted with Dynare?

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.

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

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!