Error Running example1.mod

Hi,

I’m new to Dynare and I downloaded it following the directions here https://github.com/DynareTeam/dynare on my Ubuntu 16.04 machine. When I try to run the example1.mod file, Matlab finishes preprocessing and I get the following error message.

The class ‘dates’ is used in its own class definition as a base class, property value, or attribute
value. This is not allowed.

Error in global_initialization (line 408)
options_.dataset.firstobs = dates();

Error in example1 (line 24)
global_initialization;

Error in dynare (line 267)
evalin(‘base’,fname) ;

I’ve searched online but cannot find anyone else with a similar error message. Is there something obvious that I am missing or does anyone know how to fix this? Thank you in advance.

Which version of Dynare did you in compile and install ? The stable version ?

Best,
Stéphane.

Originally, I had the stable version, I believe. I just uninstalled Dynare and then reinstalled it using the unstable version and it works fine. Thank you for your comment!

Continuing the discussion from Error Running example1.mod:

Good morning,

I have just installed Dynare 4.6.2. and I get the same error krdoty mentioned 3 years ago. I also have version 4.5.2. in Dynare folder, but I deleted all paths of this older version from Matlab. I would like to keep the older version, because some of my codes do not work with the newest. The code I’m working with now produces the crash with a message about hessian_eq_zero not existing if I use the older version. A bug indicated in the FixedBugs for 4.6.2. I use Windows10.

    Using 64-bit preprocessor
Starting Dynare (version 4.6.2).
Calling Dynare with arguments: none
Starting preprocessing of the model file ...
Found 85 equation(s).
Evaluating expressions...done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 1).
Processing outputs ...
done
Preprocessing completed.

The class 'dates' is used in its own class definition as a base class, property
value, or attribute value.  This is not allowed.

Error in default_option_values (line 351)
options_.dataset.firstobs = dates();

Error in global_initialization (line 135)
    options_ = default_option_values(M_);

Error in dyn_main.driver (line 24)
global_initialization;

Error in dynare (line 293)
evalin('base',[fname '.driver']) ;

Can I solve this? Thank you so much!

What is the output if you type into Matlab after the crash

which dates

?

which dates
C:\dynare\4.6.2\matlab\modules\dseries\src@dates\dates.m % dates constructor

Did you try

?

Are you asking me whether I removed all 4.5.2 path entries in Matlab paths? Yes, I did. But I kept the older version in my computer. If I change directory or uninstall previous Dynare version, the ‘dates’ error disappears…

What do you mean with

?

If I move folder 4.5.2. from c:\Dynare to another folder in my computer (a part from removing the path to it in Matlab), then the problem is gone. Only 4.6.2. is now inside c:\Dynare.

But that means that for some reason, you did not properly remove the path in Matlab. Only be moving the folder does Matlab not detect it.

Hi everyone,

I jump in this thread since I receive a message similar to krdoty after running the example1.mod file on Matlab (preprocessing was successful):

The class ‘dates’ is used in its own class definition as a base class, property value, or
attribute value. This is not allowed.
Error in default_option_values (line 351)
options_.dataset.firstobs = dates();
Error in global_initialization (line 135)
options_ = default_option_values(M_);
Error in example2.driver (line 24)
global_initialization;
Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

I have just downloaded the 4.6.4 Dynare version and deleted the previous one (even from the bin). I have removed all paths from Matlab and added addpath /Applications/Dynare/4.6.4/matlab once again.
When I type which example1.mod, Matlab returns the current folder /Users/*name*/Documents/MATLAB/example1.mod, which I have set since I have writing permissions.

How shall I get rid of the error? Thanks for your help!

What happens when you type

which dates

Opened up MatLab today to type what you suggested and after updating my license the problem disappeared! Thanks for your assistance anyway.
For future references, this is what showed up: /Applications/Dynare/4.6.4/matlab/modules/dseries/src/@dates/dates.m % dates constructor

Dear all,

l’m new to dynare and matlab. I just downloaded the dynare 4.6.4. And I use win10. When I try to run the example1.mod file, I get the following message and fail to run:

dynare example1.mod
??? Undefined function or method ‘dynare’ for input arguments of type
‘char’.

What should I do to get rid of this error? Thanks for helping.

This suggests you did not correctly set the path. See the manual on this.

Thank you . I will check