shock equations for model written in their non-linear form

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.

shock equations for model written in their non-linear form

Postby jmohimon » Wed Oct 23, 2013 10:28 am

Dear dynare users,

I have a question regarding the shock equations for model written in their non-linear form (so that dynare does the linearization job).
I have downloaded the Adolfson et al. 2005 code written in dynare by Schmidt (already in its linearized form). I have tried to replicate the same model on my own but this time by writing the equation in their non-linear form and ask dynare to make the first order approximation. I then compared the results for both models. I think I have everything correct except that the size of some shock does not correspond. When I look at IRF of the non-linearized model, some correspond exactly to the linear one while some other correspond in shape, but not in size.
My conclusion is that I failed to write the shock equation. I take the consumption preference shock to illustrate. What the original code does is
ZETA_C=rho_zetac*ZETA_C(-1)+epsilon_zetac;

While in my code I have tried
ZETA_C = rho_zetac*ZETA_C(-1) + (1-rho_zetac)*zeta_c + epsilon_zetac;

As well as
log(ZETA_C) = rho_zetac*log(ZETA_C(-1)) + (1-rho_zetac)*log(zeta_c) + epsilon_zetac;

where zeta_c is steady sate of ZETA_C.

And we both define the shock as
var epsilon_zetac;
stderr 0.157;

But we end up with different IRF (same shape, different size). I’m doing something wrong?

With best regards,
Jolan
jmohimon
 
Posts: 6
Joined: Wed Oct 23, 2013 9:54 am

Re: shock equations for model written in their non-linear fo

Postby jpfeifer » Wed Oct 23, 2013 6:19 pm

Without seeing how those variables enter the actual equations, it is hard to tell. One general question: did you write down the model for linearization or log-linearization (putting everything in exp())? If not, the latter may explain the different sizes.
------------
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: shock equations for model written in their non-linear fo

Postby jmohimon » Thu Oct 24, 2013 11:38 am

Thank you for your answer. I did not use the exp. In particular, the FOC in the households’ problem w.r.t consumption reads

ZETA_C/(C-b*C(-1)/MU_Z) - beta*b*ZETA_C(+1)/(C(+1)*MU_Z(+1) - b*C) - PSI_Z*GAMMA_CD*(1+TAU_C) = 0;

Does it mean that my model is written for linearization? And how should i interpret my shock size in this case?
With best regards,
Jolan
jmohimon
 
Posts: 6
Joined: Wed Oct 23, 2013 9:54 am

Re: shock equations for model written in their non-linear fo

Postby jpfeifer » Fri Oct 25, 2013 5:24 am

Yes, your model is written for linearization. Thus, your IRFs are the absolute deviations from steady state, not the percentage deviations. E.g. if the SS of C is 2 and the IRF is 0.2 in period 1, this is a 0.2/2=0.1=10% deviation from steady state. If you put
Code: Select all
log_C=log(C)

as an additional line to your model, log_C will give you the IRF in percentage deviations.
------------
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: shock equations for model written in their non-linear fo

Postby jmohimon » Wed Oct 30, 2013 8:57 am

Thank you for your reply. I have updated my dynare file following your advice and now I think I have the percentage deviations from steady state. But there are still some shocks that give IRFs with different scales and I can’t find why. Here I have posted the 2 mod files (as well as the m files calling them and making the plots of the IRFs) because I could have forgot to mention something worth. With best regards,
Jolan
Attachments
run_and_compare_adolfson.m
m file calling the mod files. Run this one
(2.78 KiB) Downloaded 72 times
mtit.m
m file used in the plot
(3.86 KiB) Downloaded 75 times
EA_SR07_rep.mod
The original linear mod file
(28.55 KiB) Downloaded 91 times
Adolfson_2005_nl_replication.mod
My non-linear mod file
(18.92 KiB) Downloaded 98 times
jmohimon
 
Posts: 6
Joined: Wed Oct 23, 2013 9:54 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests