Page 1 of 1
Help please- Syntax error for 'shocks;' in model
Posted:
Sat Dec 03, 2011 11:25 am
by Carol
Can anyone help me PLEASE?
I have been running a model quite a while now and I keep getting a syntax error, unexpected ';', expecting equal for the line with shocks in it. The line is:
shocks;
Don't you have to type shocks; before specifying what variables you want to be shocked? What is causing this error?
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sat Dec 03, 2011 1:36 pm
by jpfeifer
Could you please post the mod-file.
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sat Dec 03, 2011 2:29 pm
by Carol
Thanks for replying jpfeifer,
I have attached the file. I got the model to run when I put end at the end of the model block. However the simulation is off. I am new to dynare and the file I am working with is the RBC_Monop_JFC.mod which I got from the models folder under the UserGuide in the installation of Dynare. I made some changes to this file to put the steady state equations as deep parameters as you suggested previously.
If you run the attached .mod file you will notice the simulation for only one variable (which is the orthogonalized shock to e) is shown. Ideally the simulations for the other variables, k , w, y, l, i etc should be shown. Can you please tell me why this is happening? Why I am not seeing the fgures/charts for the other variables when I simulate the model?
Thanks.
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sat Dec 03, 2011 7:44 pm
by jpfeifer
Sorry, but the mod-file is totally broken. Please consult the sample mod file and the Dynare manual. In particular, fix the timing of the predetermined state capital. As a general tip, always use
- Code: Select all
steady;
check;
before stoch_simul.
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sun Dec 04, 2011 12:18 am
by Carol
Hi Jpfeifer,
I have amended the model as suggested. I notice that the steady state values depend on other values and these other values depend on others. In light of this, I have used a separate steady state file to get the model to solve. However, the model is still not working (I have attached both files).
Also, I saw on page 24 of the user guide (chapter 3) that the steady state file for the example is to be added. Is it possible that you can send me this steady state file or tell me when it will be added.
Please assist me. I have been trying to solve this model for weeks.
I really, really, need your assistance in solving this model. Thanks.
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sun Dec 04, 2011 8:38 am
by jpfeifer
For your model, you don't need a steady state file. You can just specify a good guess.
- Code: Select all
var
y,
c,
k,
i,
l,
w,
r,
z;
varexo
e;
parameters
alpha,
beta,
delta,
psi,
rho,
gamma,
sigma,
epsilon;
alpha = 0.33;
beta = 0.99;
delta = 0.023;
psi = 1.75;
rho = 0.95;
gamma = 0.5;
sigma = (0.007/(1-alpha));
epsilon = 10;
model;
y = alpha*k(-1)+(1-alpha)*l;
c = (-delta)*(1+r(+1)-c(+1));
k(-1) = l+w-r;
i = (1-(1-delta))*i;
l = (c-w)/l*(1-l);
w = y-l;
r = y-k(-1);
z = rho*z(-1)+e;
end;
initval;
k = 9;
c = 0.7;
l = 0.3;
w = 2.0;
r = 0;
z = 0;
e = 0;
end;
steady;
check;
shocks;
var e=sigma^2;
end;
stoch_simul(periods=2100);
However, the model itself is wrong. Where is the law of motion for capital?
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sun Dec 04, 2011 10:52 am
by Carol
Jpfeifer,
I understand that you are saying that I don't need a separate steady state file. However, the reason why I used one is because I was asked to show how I arrived at the initial values.
Anyway, you said the model is wrong. Note that the model equations here represents the log linearized equations. Also, the law of motion for capital that you are talking about is it this equation
k(+1) = i + (1-delta)k
Jpfeifer, I am a student and I have been working on getting this model right for weeks. I have to get it to solve. Please, please, please let me know if you have any suggestions. Thanks for your help thus far.
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sun Dec 04, 2011 11:40 am
by jpfeifer
Your problem is not a Dynare problem, but a conceptual problem with your model and your log-linearization. There I cannot help you. If you know the law of motion, why did you not enter it? Where does
- Code: Select all
i = (1-(1-delta))*i;
come from? It implies that i has to be 0 in every period. If you log-linearize a budget constraint, there are usually multiplicative constants. Where did they go?
Moreover, given the small size of the model, it should be trivial to compute the steady state in terms of deep parameters using pencil and paper. Given this solution, you can then enter these formulas in the initval-block without the need for a separate steady state file (which would introduce unnecessary complication for Dynare programming). There is no need for a numerical solver.
Just sit down and make sure your algebra is correct.
Re: Help please- Syntax error for 'shocks;' in model
Posted:
Sun Dec 04, 2011 12:18 pm
by Carol
Thanks jpfeifer, I am going to try what you suggested now.