error message

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

Postby nabilfrance » Tue May 08, 2007 2:45 pm

HI,
i tried to do this example in matalb by dynare( to be fimliar with dynare), but dynare give me in every steps an error message, like this one:

?? Error: File: Untitled.m Line: 17 Column: 19
The expression to the left of the equals sign is not a valid target for an assignment.
i think he mean the by line 17 column 19 the sign (=) , but really i dont see what's wrong with (=)


periods 20100;
var y, c, k, a, h, b;
varexo e,u;

parameters beta, rho, beta, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho = 0.95;
tau = 0.0025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;

model;

c*theta*h^(1+psi)=(1-alpha)* y;
k = beta*(((exp(b)*c)/exp(b(+1))*c(+1)))*(exp(b(+1)*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k= exp(b)*(y-c)+(1-delta)*k(-1);
a= rho*a (-1)+ tau*b(-1)+ e;
b= tau*a(-1)+rho*b(-1)+ u;

initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = -1.2;
k = 2.4;
a = 0;
b = 0;
e = 0;
u = 0;
sigma_e = [ 0.000081, phi*0.009*0.009; 0.000081];
stoch_simul;
nabilfrance
 
Posts: 11
Joined: Tue Oct 17, 2006 1:56 pm

Postby MichelJuillard » Tue May 08, 2007 4:14 pm

You are missing the keyword "end;"

at the end of the model section and of the initval section

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby nabilfrance » Wed May 09, 2007 8:30 am

sorry i have just miss it in uploading the code, but i have done it correctly in dynare . now the error message is : ?? Error using ==> var
Too many input arguments.
matlab give this error message any time i try to do an example.

Thanks
nabilfrance
 
Posts: 11
Joined: Tue Oct 17, 2006 1:56 pm

Postby MichelJuillard » Wed May 09, 2007 11:55 am

Could you put your file in attachment so that we can see exactly what you are submitting to Dynare?

Thanks

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby nabilfrance » Wed May 09, 2007 2:40 pm

ok this an example of what i have try to done ( i repeat your example, to see how does work)

periods 20100;

var y, c, k, a, h, b;
varexo e,u;

parameters beta, rho, beta, alpha, delta, theta, psi, tau;

alpha = 0.36;
rho = 0.95;
tau = 0.0025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;

model;
exp(c)*theta*exp(h)^(1+psi )=(1-alpha)*exp(y);
exp(k) = beta*(((exp(b)*exp(c))/(exp(b(+1))*exp(c(+1))))
*(exp(b(+1))*alpha*exp(y(+1))+(1-delta)*exp(k)));
exp(y)=exp(a)*(exp(k(-1))^alpha)*(exp(h)^(1-alpha));
exp(k)= exp(b)*(exp(y)-exp(c))+(1-delta)*exp(k(-1));
a = rho*a (-1)+tau*b(-1)+ e;
b = tau*a (-1)+rho*b(-1)+u;

end;

initval;
y = 0.1;
c = -0.2;
h = -1.2;
k = 2.4;
a = 0;
b = 0;
e = 0;
u = 0;
end;


and this the error message of matlab:

??? Error: File: Untitled3.m Line: 17 Column: 29
The expression to the left of the equals sign is not a valid target for an assignment.

thanks for help
nabilfrance
 
Posts: 11
Joined: Tue Oct 17, 2006 1:56 pm

Postby MichelJuillard » Wed May 09, 2007 3:22 pm

I'm attaching example1.mod that does what you are trying to do. I believe that when you are writing the model file, you aren't saving it the right way. This is indicated by "untitled.m"
When you save the file you should give it a name like "example1.mod". You shouldn't save it with the Matlab default extension .m

Note that with
periods 20100;

Dynare performs a Monte Carlo simiulation over 20100 periods which takes a long time. This isn't necessary to get the solution.

Best

Michel
Attachments
example1.mod
(740 Bytes) Downloaded 234 times
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Postby nabilfrance » Thu May 10, 2007 1:04 pm

Thanks a lot , merci beaucoup.

as you suggest the problem was the way i have save the file, i haven't change the extension to .mod

merci encore, mille merci
nabilfrance
 
Posts: 11
Joined: Tue Oct 17, 2006 1:56 pm


Return to Dynare help

Who is online

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