error 17.134

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 17.134

Postby basher1 » Wed Jul 29, 2009 1:53 pm

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
basher1
 
Posts: 6
Joined: Wed Jul 29, 2009 11:22 am

Re: error 17.134

Postby JamieHall » Thu Jul 30, 2009 6:51 am

Hi Basher,

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

cheers
Jamie
JamieHall
 
Posts: 20
Joined: Wed Feb 11, 2009 4:42 am

Re: error 17.134

Postby JamieHall » Thu Jul 30, 2009 6:52 am

P.S. the "17.134" means that the error is near line 17, column 134, of the mod file.
JamieHall
 
Posts: 20
Joined: Wed Feb 11, 2009 4:42 am

Re: error 17.134

Postby basher1 » Thu Jul 30, 2009 7:16 am

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
basher1
 
Posts: 6
Joined: Wed Jul 29, 2009 11:22 am

Re: error 17.134

Postby gbel » Thu Jul 30, 2009 2:07 pm

Scrap the 'e = 0;' line from the 'initval section. That section is for endogenous variables.
gbel
 
Posts: 33
Joined: Thu Sep 04, 2008 8:34 pm
Location: Québec

Re: error 17.134

Postby basher1 » Thu Jul 30, 2009 2:47 pm

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
basher1
 
Posts: 6
Joined: Wed Jul 29, 2009 11:22 am

Re: error 17.134

Postby gbel » Thu Jul 30, 2009 2:56 pm

shocks; not schocks;

this should work.

Gilles
gbel
 
Posts: 33
Joined: Thu Sep 04, 2008 8:34 pm
Location: Québec

Re: error 17.134

Postby gbel » Thu Jul 30, 2009 3:00 pm

One last thing 'dr_algo' doesn't work. You should take it out too.
gbel
 
Posts: 33
Joined: Thu Sep 04, 2008 8:34 pm
Location: Québec

Re: error 17.134

Postby basher1 » Thu Jul 30, 2009 3:11 pm

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
basher1
 
Posts: 6
Joined: Wed Jul 29, 2009 11:22 am

Re: error 17.134

Postby SébastienVillemot » Tue Aug 25, 2009 2:00 pm

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,
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: error 17.134

Postby xiang8482890 » Wed Oct 26, 2011 1:04 pm

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!
xiang8482890
 
Posts: 9
Joined: Wed Oct 26, 2011 12:54 pm

Re: error 17.134

Postby xiang8482890 » Wed Oct 26, 2011 1:04 pm

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!
xiang8482890
 
Posts: 9
Joined: Wed Oct 26, 2011 12:54 pm

Re: error 17.134

Postby SébastienVillemot » Fri Nov 18, 2011 9:17 am

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,
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 12 guests