Page 1 of 1

error 17.134

PostPosted: Wed Jul 29, 2009 1:53 pm
by basher1
Hello!

I am starting to learn Dynare and now I have a problem with a .mod file.
I just copied the model from the Paper of Sargent et. al. (Practicing Dynare):

periods 1000;

var c k lab z;
varexo e;

parameters bet the del alp tau rho s;

bet = 0.987;
the = 0.357;
del = 0.012;
alp = 0.4;
tau = 2;
rho = 0.95;
s = 0.007;

model;
(c^the*(1-lab)^(1-the))^(1-tau)/c=bet*((c(+1)^the*(1-lab(+1))^(1-the))^(1-tau)/c(+1)*(1+alp*exp(z(-1))*k(-1)^(alp-1)*lab^(1-alp)-del);
c=the/(1-the)*(1-alp)*exp(z(-1))*k(-1)^alp*lab^(-alp)*(1-lab);
k=exp(z(-1))*k(-1)^alp*lab^(1-alp)-c+(1-del)*k(-1);
z=rho*z(-1)+s*e;
end;

initval;
k = 1;
c = 1;
lab = 0.3;
z = 0;
e = 0;
end;

schocks;
var e;
stderr 1;
end;

steady;

stoch_simul(dr_algo=0,periods=1000);
datasaver('simudata',[]);

So, it is just a copy, but when I start Dynare, the following error Message occurs:

ERROR: prac_dy_sec2.mod:17.134: syntax error, unexpected ';'
Starting Dynare ...
Starting preprocessing of the model file ...

error: DYNARE: preprocessing failed
error: evaluating if command near line 94, column 1
error: called from `dynare' in file `/home/basher/Desktop/dynare_v4/matlab/dynare.m'

But I do not see, that I have an `;` somewhere, that does not belong there? So what is the Problem?? Can someone help me?

Thanks in advance!

basher

Re: error 17.134

PostPosted: Thu Jul 30, 2009 6:51 am
by JamieHall
Hi Basher,

You might be missing a ")" after the second "c(+1)" on the RHS of the first equation.

cheers
Jamie

Re: error 17.134

PostPosted: Thu Jul 30, 2009 6:52 am
by JamieHall
P.S. the "17.134" means that the error is near line 17, column 134, of the mod file.

Re: error 17.134

PostPosted: Thu Jul 30, 2009 7:16 am
by basher1
Oh, thank you JamieHall I see!!
I corrected the mistake, but now he tells me, that e is declared twice with different types! But as far as I understood, I have to declare e as varexo, and then when I model the schock section, I have to type "var e". Isn't that right? Has something changed? Because also in the manual, it is done in the same manner. I tried also to model the schock in the following way:

schocks;
varexo e;
...
end;

Then he tells me that e is declared twice (not with different types).

The other problem is, that when I try to compile the example1.mod file, there is an error which tells me, that dmperm is not available in this version of octave. Does anyone know what I can do???



Can you help me??
basher

Re: error 17.134

PostPosted: Thu Jul 30, 2009 2:07 pm
by gbel
Scrap the 'e = 0;' line from the 'initval section. That section is for endogenous variables.

Re: error 17.134

PostPosted: Thu Jul 30, 2009 2:47 pm
by basher1
Hello,

I deleted the line in initval, but the error is still the same and it also refers to the line in the schocks section.
I am really confused!! Do you have an idea what else could be the mistake??

basher

Re: error 17.134

PostPosted: Thu Jul 30, 2009 2:56 pm
by gbel
shocks; not schocks;

this should work.

Gilles

Re: error 17.134

PostPosted: Thu Jul 30, 2009 3:00 pm
by gbel
One last thing 'dr_algo' doesn't work. You should take it out too.

Re: error 17.134

PostPosted: Thu Jul 30, 2009 3:11 pm
by basher1
Ok, great just a typo! I am sorry for that... :oops:

Now there are no more errors concerning the .mod file, but I still have this problem with dmperm in octave. Do you maybe have a guess how I can find a solution for this??
If not, THANK YOU so far :P for your help!!!

basher

Re: error 17.134

PostPosted: Tue Aug 25, 2009 2:00 pm
by SébastienVillemot
Hi,

What do you mean by "an error with dmperm in Octave"? The function "dmperm" is implemented in Octave (at least recent versions), and it works as under MATLAB.

Maybe you could post your error message?

Best,

Re: error 17.134

PostPosted: Wed Oct 26, 2011 1:04 pm
by xiang8482890
I also ran this program, after correcting the defect above. But there were error messages, saying that "??? Undefined function or method 'datasaver' for input arguments of type 'char'."
I thought it means that "datasaver" is an unrecognized function. But how could that be, because I copied that program from a paper without changing it at all.

Two more errors:

Error in ==> growthmodel at 121
datasaver('simudata',[]);

Error in ==> dynare at 120
evalin('base',fname) ;


Can anyone help? THANKS!

Re: error 17.134

PostPosted: Wed Oct 26, 2011 1:04 pm
by xiang8482890
I also ran this program, after correcting the defect above. But there were error messages, saying that "??? Undefined function or method 'datasaver' for input arguments of type 'char'."
I thought it means that "datasaver" is an unrecognized function. But how could that be, because I copied that program from a paper without changing it at all.

Two more errors:

Error in ==> growthmodel at 121
datasaver('simudata',[]);

Error in ==> dynare at 120
evalin('base',fname) ;


Can anyone help? THANKS!

Re: error 17.134

PostPosted: Fri Nov 18, 2011 9:17 am
by SébastienVillemot
The "datasaver" function that is called at the end of the MOD file is not a Dynare command, at least in version 4. I guess it was an internal command of Dynare 3 that was used to save results in a file.

You can probably safely remove it. In Dynare 4, all the results are automatically saved into "<filename>_results.mat". You can also use the "datatomfile" command which probably does a job similar to the old "datasaver" command.

Best,