Steady-state error in "Fimod"

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.

Steady-state error in "Fimod"

Postby cesare_00 » Fri Jan 02, 2015 12:31 am

Hello everybody,
I'm trying to write the dynare code for "Fimod- a DSGE model for fiscal policy simulation", but I'm stuck with a steady state value error. Specifically, I can't get the residual of the static equations #181 and #182 (same denomination in my mod file) straight. I've attached the paper, my mod file and the mathematical Appendix of the paper where you can find a summary of all the equations with the related steady state calculations, which I have followed to write down the code. After days of debugging, I'm not able to see what's wrong, that's why I'm asking for help. I don't know if I'm missing something, or if there is an error in the appendix, since i have already found few of them. Thank you very much, useless to say any help would be very much appreciated.
Attachments
Fimod.mod
(45.81 KiB) Downloaded 114 times
StahlerThomas_EMappendix_2012.pdf
(129.45 KiB) Downloaded 160 times
StahlerThomas_EM_2012.pdf
(919.52 KiB) Downloaded 141 times
cesare_00
 
Posts: 5
Joined: Fri Jan 02, 2015 12:01 am

Re: Steady-state error in "Fimod"

Postby cesare_00 » Sat Jan 03, 2015 4:27 pm

Ok, i figured it out. There were a few errors in the mathematical appendix of the paper, i fixed them and now it works. Thanks
cesare_00
 
Posts: 5
Joined: Fri Jan 02, 2015 12:01 am

Re: Steady-state error in "Fimod"

Postby jpfeifer » Mon Jan 05, 2015 10:05 pm

Could you provide other users with the new file or give an indication what the issues were?
------------
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: Steady-state error in "Fimod"

Postby cesare_00 » Mon Jan 12, 2015 12:12 pm

Here is the final mod.file for Fimod ("Fimod.mod"). I have another question though; I'm trying to replicate the IRFs of the paper relatives to a permanent reduction in home government purchases. As the manual suggests, I've added a unit root process(at the end of the model block) for the error of Government purchases (e_Cg in my code) and simulted a shock for the new error(eps_Cg). Everything seems fine in the code, but i get NaN theoretical moments and the "All endogenous are constant or non stationary...." error. I don't really know where to look for fix this problem, can you help? Thanks a lot, the code with the permanent reduction in government purchases is "Fimod1.mod".
Attachments
Fimod1.mod
(48.92 KiB) Downloaded 98 times
Fimod.mod
(48.84 KiB) Downloaded 115 times
cesare_00
 
Posts: 5
Joined: Fri Jan 02, 2015 12:01 am

Re: Steady-state error in "Fimod"

Postby jpfeifer » Mon Jan 12, 2015 8:02 pm

There is no way to fix this. Having a unit root implies that some unconditional moments simply do not exist. You can generate IRFs, but you cannot compute unconditional moments.
------------
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: Steady-state error in "Fimod"

Postby cesare_00 » Tue Jan 13, 2015 3:42 pm

Fair enough, many thanks! I have two more questions:

1 - If I try to make the shock for C_g to last more than one period (using command "periods 1:4" in the shocks block), i don't get any Irfs( I checked the reference manual about this, even if use the command "varexo_det" at the beginning of my .mod file, nothing changes, i still don't get any plot or oo_.irfs file). What am I doing wrong?

2 - my final goal is to replicate the irfs from Fig.1 in the paper attached in my earlier post. My understanding is they simulate a permanent reduction in government purchase(C_g) at the beginning of the fourth year, i.e. after 16 quarters. I added a unit root process for C_g and I'm guessing the only way to perform this reduction is to impose a shock in period 16 for the error of the unit root process till period 17. But, as before, i don't get any irfs. I know it sounds a bit tricky, so it's possible I haven't understood what the two authors really do, but i don't see any other explanation.

the .mod file attached is the one relative to question n 1.Any idea how to replicate authors' irfs?
Last time i bother, promise.
Thanks a lot again for your precious help
Attachments
Fimod1.mod
(50.09 KiB) Downloaded 81 times
cesare_00
 
Posts: 5
Joined: Fri Jan 02, 2015 12:01 am

Re: Steady-state error in "Fimod"

Postby jpfeifer » Thu Jan 15, 2015 8:35 am

I found the time to have a quick look at the paper. They are not doing stochastic IRFs, but rather deterministic simulations, i.e. studying the transition from one steady state to another.

This means you should use
Code: Select all
simul

instead of
Code: Select all
stoch_simul

Specifying shocks for certain periods as you currently do is not compatible with stoch_simul. By treating the variables that change directly as exogenous (as opposed to having a unit root process with a separate shock), it should be straightforward to get the desired responses.
------------
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: Steady-state error in "Fimod"

Postby cesare_00 » Thu Jan 15, 2015 10:11 pm

Professor, Thanks for your help and your time! I'm doing what you told me, in simulating a permanent increase in labour tax(t_w) i took out of the model the stochastic process driving t_w and considered it as an exogenous variable. I added the "endval" block, the shock which starts in the 4th year and used the command simul as you said. But i keep having the following error, no matter what:

Error using sim1 (line 144)
Simulation terminated with NaN or Inf in the residuals or
endogenous variables. There is most likely something wrong
with your model.

Error in simul (line 126)
sim1;

Error in Fimod (line 3050)
simul();

Error in dynare (line 182)
evalin('base',fname) ;

Do you think it has something to do with the equation for t_w i took out?
I really don't know how to thank you anymore
Attachments
Fimod.mod
(52.35 KiB) Downloaded 120 times
cesare_00
 
Posts: 5
Joined: Fri Jan 02, 2015 12:01 am

Re: Steady-state error in "Fimod"

Postby jpfeifer » Sat Jan 17, 2015 3:39 pm

The setup for the simulations seems correct, but your model has problems. Have you noticed that k_o (private capital) has a negative steady state?
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 11 guests