problem with mod file

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.

problem with mod file

Postby cup » Mon Sep 24, 2012 1:22 pm

Hi

I have tried to code the code from "understanding the effects of covernment spending on consumption", but something is clearly wrong as i keep getting residuals. Have spent the last two day trying to figure it out but is still clueless. Would anyone mind taking a look? (my thesis is due this week so in trouble)

http://www.nber.org/papers/w11578
Attachments
gali_new.mod
(2.52 KiB) Downloaded 182 times
cup
 
Posts: 7
Joined: Tue Sep 18, 2012 7:56 am

Re: problem with mod file

Postby jpfeifer » Mon Sep 24, 2012 7:46 pm

All initial values have to be 0 as the model is expressed in deviations from steady state. In that regard, equations
Code: Select all
//Markup
my_p=y-n-w;
my_p=y-k-r_k;

are wrong. my_p is not a parameter but the deviation of the markup from its steady state (or actually it is a parameter, but the equations need \hat my_p and not my_p). Hence, it is a variable as written in the paper.

P.S.: Consider yourself lucky, usually I don' respond to questions at the last minute.
------------
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: problem with mod file

Postby cup » Tue Sep 25, 2012 6:40 am

jpfeifer wrote:All initial values have to be 0 as the model is expressed in deviations from steady state. In that regard, equations
Code: Select all
//Markup
my_p=y-n-w;
my_p=y-k-r_k;

are wrong. my_p is not a parameter but the deviation of the markup from its steady state (or actually it is a parameter, but the equations need \hat my_p and not my_p). Hence, it is a variable as written in the paper.

P.S.: Consider yourself lucky, usually I don' respond to questions at the last minute.



thank you very much, fixed it and it runs partly, however now I get the error message

Error using ones
NaN and Inf not allowed.
Error in dyntable (line 58)
hh = [hh char(32*ones(1,hlb)) deblank(headers(i,:)) ...
Error in disp_moments (line 97)
dyntable(title,headers,labels,autocorr,size(labels,2)+2,8,4);
Error in stoch_simul (line 154)
disp_moments(oo_.endo_simul,var_list);
Error in gali_new (line 224)
info = stoch_simul(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;
>>
the headline AUTOCORRELATION OF SIMULATED VARIABLES

and I do not get anu IRFs graphs out.

Understand that I am asking all too late, and would be very grateful if you had some input.
Attachments
gali_new.mod
(2.58 KiB) Downloaded 184 times
cup
 
Posts: 7
Joined: Tue Sep 18, 2012 7:56 am

Re: problem with mod file

Postby jpfeifer » Tue Sep 25, 2012 11:44 am

There is still something wrong in the model. Put
Code: Select all
resid(1);

before steady to see that the steady state is still not correct. Are you sure the FOCs as written in the model is correct? It seems as if once r is the level of the net interest rate (in the Taylor rule) and once its deviation from steady state (in the Euler equation)
------------
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: problem with mod file

Postby kyri82 » Tue Sep 25, 2012 12:24 pm

There is something wrong with your model. It is possibly not well defined, as you get negative values at steady-state and a huge negative real interest rate. Be careful with the timing of the variables. Capital is a pre-determined variable and needs to be treated as such. So the law of motion of capital writes k=delta*i+(1-delta)*k(-1) and the production function: y=(1-alpha)*n+alpha*k(-1). Btw, shouldn't this be: y=n^(1-alpha) + k(-1)^alpha ?? I tried to correct all these but problems persist.
K.
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: problem with mod file

Postby cup » Thu Sep 27, 2012 8:08 am

I cannot find the mistake. Can any of you recomend a (simple) closed economy model that includes government spending and lump sum taxes? (It does not need to include non-Ricardian consumers.)

(I have been fortunate enough to have been given an extention of the deadline)
cup
 
Posts: 7
Joined: Tue Sep 18, 2012 7:56 am

Re: problem with mod file

Postby cup » Thu Sep 27, 2012 11:43 am

cup wrote:I cannot find the mistake. Can any of you recomend a (simple) closed economy model that includes government spending and lump sum taxes? (It does not need to include non-Ricardian consumers.)

(I have been fortunate enough to have been given an extention of the deadline)



A found one

Thank you for all the help though!
cup
 
Posts: 7
Joined: Tue Sep 18, 2012 7:56 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 4 guests