Hi,

I am currently trying to transform the model of CMR (2014) so that I can compare it to the Smets and Wouters (2007) Model which is in log-differences. As the CMR model is non-linear I tried to

- Use the loglinear option which is not possible as there are zero and negative steady-state values.
- I tried to transform every variable with the exp()-substitution but unfortunately it didn’t work out. The file in which I tried doing it is attached as US_CMR14_rep.mod.
- And I tried to append the logs of the variables which I want to observe as auxiliary variables to the model but then I get an issue with the steady-state file as I don’t know how to add the additional variables there. I attached the file it as well.

Now I am hoping that someone is able to help me and give me an insight what I am doing wrong.

Thanks a lot!

Model file:

US_CMR14_rep.mod (84.0 KB)

Steady-State File:

US_CMR14_rep_steadystate.m (24.2 KB)

Original CMR File:

financial_copy.mod (82.1 KB)

Option 3 should be straightforward. You can usually copy the exact definition of the auxiliary variables from the model block to the end of the steady state file.

Thank you very much for your fast reply!

I managed to add the auxiliary variables to my mod file and the steady state file:

gdp_log = log (c) + log (i) + log (g);

c_log = log(c);

i_log = log (i);

pi_log = log (pi);

h_log = log (h);

wtilde_log = log (wtilde);

However, I think that the variables are in levels and therefore if I want to have the percentage deviations from steady state I need to subtract the log of the steady-states of the variables as well, am I right? Like that:

gdp_log = (log (c)-log(steady_state(c))) + (log (i)-log(steady_state(i))) + (log (g)-log(steady_state(g)));

c_log = log(c)-log(steady_state(c));

i_log = log (i)-log(steady_state(i))

pi_log = log (pi)-log(steady_state(pi));

h_log = log (h)-log(steady_state(h));

wtilde_log = log (wtilde)-log(steady_state(wtilde));

US_CMR14_rep.mod (85.3 KB)

US_CMR14_rep_steadystate.m (24.4 KB)

Thanks!

Yes, that would be the correct way to get percentage deviations from steady state.

Okay thank you!

How exactly would I have to implement this? Because when I just change the equations in the mod file and in the steady-state file, I run into this error:

Index exceeds the number of array elements. Index must not exceed 0.

Error in US_CMR14_rep_static (line 34)

pitilde__ = y(26)^params(18)*y(24)^(1-params(18));

Error in resid (line 85)

z = feval([M_.fname ‘_static’],…

Error in US_CMR14_rep (line 2208)

resid;

Error in dynare (line 235)

evalin(‘base’,fname) ;

Do I have to specify the steady states of the variables as a parameter or what am I missing here?

Thank you!

US_CMR14_rep.mod (85.6 KB)

US_CMR14_rep_steadystate.m (24.7 KB)

Please upgrade to Dynare 6.1 and use

US_CMR14_rep_steadystate.m (24.7 KB)

US_CMR14_rep.mod (85.6 KB)