Error 17.134

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+alpexp(z(-1))k(-1)^(alp-1)lab^(1-alp)-del);
c=the/(1-the)
(1-alp)exp(z(-1))k(-1)^alplab^(-alp)(1-lab);
k=exp(z(-1))k(-1)^alplab^(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

Hi Basher,

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

cheers
Jamie

P.S. the “17.134” means that the error is near line 17, column 134, of the mod file.

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

Scrap the ‘e = 0;’ line from the 'initval section. That section is for endogenous variables.

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

shocks; not schocks;

this should work.

Gilles

One last thing ‘dr_algo’ doesn’t work. You should take it out too.

Ok, great just a typo! I am sorry for that… :blush:

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 :stuck_out_tongue: for your help!!!

basher

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,

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!

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!

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 “_results.mat”. You can also use the “datatomfile” command which probably does a job similar to the old “datasaver” command.

Best,