Page 1 of 1

problem with mod file

PostPosted: Mon Sep 24, 2012 1:22 pm
by cup
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

Re: problem with mod file

PostPosted: Mon Sep 24, 2012 7:46 pm
by jpfeifer
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.

Re: problem with mod file

PostPosted: Tue Sep 25, 2012 6:40 am
by cup
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.

Re: problem with mod file

PostPosted: Tue Sep 25, 2012 11:44 am
by jpfeifer
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)

Re: problem with mod file

PostPosted: Tue Sep 25, 2012 12:24 pm
by kyri82
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.

Re: problem with mod file

PostPosted: Thu Sep 27, 2012 8:08 am
by cup
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)

Re: problem with mod file

PostPosted: Thu Sep 27, 2012 11:43 am
by cup
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!