error message running dynare first codes

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.

error message running dynare first codes

Postby Blewusi » Mon Nov 18, 2013 6:17 pm

Hi,
I am dynare new user.
I try to run this model on .mod file :

var y c k i l r w a lamda;
varexo e;

parameters beta delta gamma alpha sigmae rho_a;


alpha = 0.33;
beta = 0.99;
delta = 0.023;
gamma = 0.3;
rho_a = 0.95;
sigmae = 0.01;



model;

gamma/c = lamda;
((1-gamma)/gamma)*(c/(1-l))=w;
lamda=beta*lamda(+1)*(1-delta+r(+1));
k=(1-delta)*k(-1)+ i;
y=exp(a)*(k(-1))^alpha*l^(1-alpha);
w=(1-alpha)*(y/l);
r=alpha*(y/k(-1));
y=c+i;
a=rho_a*a(-1)+e;



initval;

k= log(29);
y= log(3);
a=0;
c=log(2.5);
i=log(1.5);
l = 0.34;
w = 3.23;
lamda = 0.32;
r = 0.033;
end;

shocks;
var e = sigmae^2;
end;

steady;

stoch_simul(hp_filter=6.25,order = 1, irf=20);

- And I have these error returns :
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Starting Dynare (version 4.3.3).
Starting preprocessing of the model file ...
ERROR: test.mod:31.1-7: Unknown symbol: initval

??? Error using ==> dynare at 114
DYNARE: preprocessing failed

1) Please, tell me where I am wrong
2) Is it advised to put the langrangian multiplier in the model like variable? If yes, what type of variable?

I am working on dynare 4.3.3 and MATLAB 7.9.0(R2009b). Thank you!
Blewusi
 
Posts: 7
Joined: Fri Aug 26, 2011 1:55 am

Re: error message running dynare first codes

Postby macroresearch123 » Mon Nov 18, 2013 10:47 pm

I am 99% sure that the error is because you forgot to write "end;" after your "model;" section. For these things, often the error is very small and just takes comparing it closely.

RE: Lagrangian -- no, I do not think it is necessary since you can write in the FOCs yourself. Dynare is not great at defining new variables unless they are explicitly endogenous or exogenous at the beginning; Matlab you can do that with no problem, but then you face other challenges.
macroresearch123
 
Posts: 90
Joined: Wed Nov 06, 2013 3:28 pm

Re: error message running dynare first codes

Postby jpfeifer » Tue Nov 19, 2013 9:12 am

Yes, there is an end missing after the model block.

The Langrange multiplier is an endogenous variable in the model that is equal to the marginal utility of consumption. For a CES power utility function
Code: Select all
lambda=c^(-sigma)

You can add such an equation to the model and then use lambda as any other variable.
------------
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: error message running dynare first codes

Postby Blewusi » Wed Nov 20, 2013 3:43 am

Thank a lot, jpfeifer and macroresearch123!
Everything is ok now!
Blewusi
 
Posts: 7
Joined: Fri Aug 26, 2011 1:55 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests