Error in two-sector model

Dear all,

I am working on a 2 sector Ramsy model, I know that it is often the case the one gets singularity in the model, I like to try to figure out if this is the problem in my case, but I get the following error message all the time:

??? Error: Missing operator, comma, or semicolon.
Error in ==> c:\dynare\matlab\dynare.m
On line 21 ==> evalin('base',fname) ;

I have the feeling that this error message comes not from a singularity. Does anybody have an idea to my problem?

bellow is my mod file

Thank’s in advance

Johannes

periods = 400;
var C, Yc, Yh, H, N, K, Nc, Nd, Kc, Kd, L, Xl, r, w, Ph, Pl, Z;
varexo ep;

parameters alfa, gama, teta, mh, mc, bet, dk, dh, roh, b;

alfa = 0.4;
gama = 0.15;
teta = 0.894;
mh = 0.044;
mc = 0.32;
bet = 0.95;
dk = 0.05;
dh = 0.03;
roh = 0.95;
b = 1-mc-mh;

model;

mc/C = L;
bet*((mh/H(+1))+L(+1)Ph(+1)(1-dh)) = LPh;
bet
L(+1)(r(+1)+(1-dk)) = L;
b/(1-N) = L
w;
C + K(+1) +Ph H(+1) = wN + rK + PlXl + (1-dk)*K + (1-dh)PhH;
H(+1) = Yh + (1-dk)*H;

alfa*(Kc^(alfa-1))((ZNc)^(1-alfa))= Phgamateta*(Kd^(gamateta-1))((ZNd)^((1-gama)teta))(Xl^(1-teta));
(1-alfa)
(Kc^alfa)(Z^(1-alfa))(Nc^-alfa)= Ph*(1-gama)teta(Kd^(gamateta))(Z^((1-gama)teta))(Nd^((1-gama)teta-1))Xl^(1-teta);
Nc + Nd = N;
Kc + Kd = K;
Xl = 1;
Yc = Kc^alfa
(Z
Nc)^(1-alfa);
Yh = (Kd^(gamateta))((ZNd)^((1-gama)teta))(Xl^(1-teta));
Ph
gamateta(Yh/Kd)= r;
Ph*(1-gama)teta(Yh/Nd) = w;
Ph*(1-teta)*(Yh/Xl) = Pl;

Z=roh*Z(-1)*exp(ep);

end;

initval;
C = 0.5384385;
Yc = 0.67022096;
Yh = 0.0171486;
H = 1.2249047;
K = 2.7;
N = 0.275;
Nc = 0.27062340;
Nd = 0.00919934;
Kc = 2.6121432;
Kd = 0.0235045;
w = 1.2;
r = 0.3;
pl = 0.2;
L = 0.591247;
Ph = 1.04899637;
Xl =1;
Z = 1; ep = 0;

end;

shocks;
var ep = 0.001;
end;
stoch_simul;

I can’t replicate the error that you are reporting. It has to do with the syntax of .m created by the parser from your .mod

Try to execute .m directly from the Matlab prompt to get a clearer error message.

On my machine, I get an error indicating that Dynare can’t compute the steady state (version 3) or can’t compute svd(A) because of INF in A. This has also to do with computing the steady state.

Are you sure that Kd and Kc are uniquely determined at the steady state?

How far can you go computing the steady state analyticaly?

Best

Michel

Michel,

to execute my file directly from the matlab prompt does not work, I get the error message: Error: Missing operator, comma, or semicolon.

I do get the following ss values by mathematica, C = 0.542, Yc= 0.674, Nc = 0.271, Nd = 0.0031, Kc = 2.62, Kd = 0.0079, Pl = 0.00190682, Yh=0.0065, Ph = 0.932, H = 0.461, L = 0.58, w = 1.4859, r = 0.10263

so far I did not try to get the ss values analyticaly

best

johannes

Dear Michel,

you are right, for this version of the model Mathematica is only finding complex numbers for the ss, the ss values I found are for an (in my opinion) equivalent model, I attached the mod file below with the ss values from mathematica, if I try to run this file I get the same error message as for the other model

best
johannes

periods = 400;
var C, Yc, Yh, H, Nc, Nd, Kc, Kd, L, W, R, Ph, Pl, Xl, Z;
varexo ep;

parameters alfa, gama, teta, mh, mc, bet, dk, dh, roh, ac, ah, b;

alfa = 0.4; gama = 0.15; teta = 0.894;
mh = 0.044; mc = 0.32; bet = 0.95; dk = 0.05; dh = 0.014;
roh = 0.95;
ac = ((1-alfa)^(alfa-1)/alfa^alfa);
ah = ((((1-gama)/gama)^(teta*(gama-1))((1-teta)/(gamateta))^teta)/(1-gama));
b = 1-mc-mh;

model;

mc/C = L;
bet*((mh/H(+1))+L(+1)ph(+1)(1-dh)) = Lph;
b/(1-Nc-Nd) = L
W;
bet*(L(+1)(R(+1) + (1 - dk))) = L;
C(-1) + Kc + Kd - (1-dk)
(Kd(-1) + Kc(-1)) +ph(-1)(H -(1-dh)H(1))= R(Kc(-1)+Kd(-1)) + W(Nc(-1)+Nd(-1)) + Pl(-1)*Xl(-1);

(Z^(alfa-1))R^alfa(W^(1-alfa))ac = 1;
(Z^(teta
(1-gama)))(R^(tetagama))(W^((1-gama)teta))(Pl^(1-teta))ah = Ph;
(Z^(alfa-1))
(1-alfa)R^alfa(W^(-alfa))acYc = Nc;
(Z^(teta
(1-gama)))teta(R^(tetagama))(W^((1-gama)teta-1))(Pl^(1-teta))ahYh = Nd;
(Z^(alfa-1))alfaR^(alfa-1)(W^(1-alfa))acYc = Kc;
(Z^(teta
(1-gama)))gamateta*(R^(tetagama-1))(W^((1-gama)teta))(Pl^(1-teta))ahYh = Kd;
(Z^(teta*(1-gama)))(1-teta)(R^(tetagama))(W*((1-gama)teta))(Pl^(-teta))ahYh = Xl;
Yc = Kc^alfa*(ZcNc)^(1-alfa);
Yh = Kd^gama
(ZdNd)^(1-gama);
Z=roh
Z(-1)*exp(ep);

end;

steady;
check;

initval;

C = 0.542;
Yc= 0.674;
Nc = 0.271;
Nd = 0.0031;
Kc = 2.62;
Kd = 0.0079;
Pl = 0.00190682;
Yh = 0.0065;
Ph = 0.932;
H = 0.461;
L = 0.58;
Xl =1; W = 1.4859; R = 0.10263;
Z = 1; ep = 0;

end;

shocks;
var ep = 0.001;
end;
stoch_simul;

that is expected, but don’t you get an indication about the line number where the error occurs?

Can you send me the *.m file?

Best

Michel

no it does indicate on which line the error occurs,

attached the m file

thank’s

johannes
2secm.m (1.77 KB)

You can’t use a filename starting with a number …

Best

Michel

ok, now I get more accurate error messages

thank’s a lot
Johannes