Error! evalin('base',fname) ;

Hi,

I’m trying to use dynare. When I open le exemple1’s manual, I have a error.

This is it

dynare C:\dynare\4.0.4\ejemplos\example1.mod

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.

Starting Dynare …
Starting preprocessing of the model file …
WARNING: C:\dynare\4.0.4\ejemplos\example1.mod:5.11-25: Symbol beta declared twice.
6 equation(s) found
Processing derivation …
Processing Order 1… done
Processing Order 2… done
Processing outputs …
Preprocessing completed.
Starting Matlab computing …

??? Error: Unexpected MATLAB operator.

Error in ==> dynare at 103
evalin(‘base’,fname) ;

I have not idea about what’s happening. Help please!!

Att.,
Verónica
example1.mod (740 Bytes)

Hi Véronica, I tried your mod file and was unable to reproduce the eror message (even if you introduced some “bugs” in the mod file). Your problem seems related to the use of the evalin matlab’s function. What is your version of matlab ?

Best, Stéphane.

it’s Matlab 7.4.0.287 R2007a

I think that you need to CD to the directory where your file is:

cd C:\dynare\4.0.4\ejemplos
dynare example1

Best

Michel

Yes you’re rigth. that was the problem!!

Gracias!!!

I am sorry to re-open this subject, but I too obtained the error mentioned, and the “cd” method did not work for me (see below). I am using Matlab R2007a 7.4.0.287, under Windows7, with the “Windows 2000 compatibility” workaround to get Matlab to function. Any help to solve what is undoubtedly a simple error would be appreciated. Regards.

which dynare
D:\Quant\Dynare\Dynare_v4.1.0_23Dec2009\matlab\dynare.m
dynare D:\Quant\Dynare\work\lubikschorf2007.mod

Configuring Dynare …
[mex] Generalized QZ.
[m] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Fast model evaluation.

Starting Dynare …
Starting preprocessing of the model file …
8 equation(s) found
Processing derivation …
Processing Order 1… done
Processing Order 2… done
Processing outputs …
Preprocessing completed.
Starting Matlab computing …

??? Error: Unexpected MATLAB operator.

Error in ==> dynare at 102
evalin(‘base’,fname) ;

cd D:\Quant\Dynare\work
dynare lubikschorf2007
??? Undefined function or method ‘dynare’ for input arguments of type ‘char’.

Hi,

There seems to be an problem with your installation of Dynare. Please check the following points:

  1. Clean your MATLAB path, by removing any pointer to an old or current version of Dynare
  2. Maybe reinstall Dynare 4.1.0, using the Windows installer on the website: it looks like you don’t have all the MEX files (the one for “Sylvester equation” is missing)
  3. Then run MATLAB, and type the following
addpath D:\Quant\Dynare\Dynare_v4.1.0_23Dec2009\matlab
cd D:\Quant\Dynare\work
dynare lubikschorf2007.mod

In other words, you have to add Dynare “matlab” subdirectory to the path; and you need to first CD to the directory where your MOD file is, then run Dynare from there.

Hope that helps

Thank you very much! Following your suggestion, I have re-installed Dynare and now it works. (Curiously, for info, everything worked fine with Octave even before re-installation …)
Regards

I am also sorry to raise the subject again, but I am experiencing somewhat similar problem. I can’t open the .mod file and the error code in my case is 108

addpath c:\dynare\4.1.0\matlab
cd c:\dynare\4.1.0\matlab
Dynare minetest
Warning: Could not find an exact (case-sensitive) match for ‘Dynare’.
c:\dynare\4.1.0\matlab\dynare.m is a case-insensitive match and will be used instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly. Alternatively, you can disable this warning using
warning(‘off’,‘MATLAB:dispatcher:InexactMatch’).

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

??? Error using ==> dynare at 108
DYNARE: can’t open minetest.mod

I am currently using Matlab2007a on Windows 7.

Anyone knows what might be the problem?

Thanks,

Pete

Why do you ‘cd’ to the ‘matlab’ subdirectory of Dynare?

This directory contains internal M-files, and should not contain your MOD file. In your case, it seems indeed that your MOD file is not there.

Suppose that your MOD-file is in c:\dynare\work\minitest.mod, you should type:

addpath c:\dynare\4.1.0\matlab
cd c:\dynare\work
dynare minitest

thanks a lot Sébastien, now i see the problem.

dear,

When using Dynare the following error message appears:

addpath c:\dynare\4.1.1\matlab
cd c:\dynare\work\cours4
dynare simul_olg

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.1).
Starting preprocessing of the model file …
Found 19 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

??? Error: File: simul_olg.m Line: 121 Column: 73
Unexpected MATLAB operator.

Error in ==> dynare at 132
evalin(‘base’,fname) ;

attachmentssimul_olg.mod (3.46 KB)

We also tried to re-install dynare 4.1.1;
I am using matlab R2007a 7.4.0 under windows7

Any help to solve would be very appreciated.

Best regards,

audrey

If you click on the error message, simul_olg.m opens and you see what’s the problem. The preprocessor did not recognize your comments like

// do "help log10" - log10 <> log as comments.
You should delete these comments or move them to an own line and the code will run. Note that there is also a semicolon missing after

Thank you for your post !!but it doesn’t change anything, i have always the same comments!!!

Then please post the param_matrix-file.

That’s what dynare compute…

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.0).
Starting preprocessing of the model file …
Found 19 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

??? Error using ==> load
Unable to read file param_matrix: No such file or directory.

Error in ==> simul_olg at 115
load param_matrix;

Error in ==> dynare at 132
evalin(‘base’,fname);

Sorry but i have nothing else except the mod.file called simul_olg!! I make my debut on this software!!

If you don’t have the parameter matrix, you must specify the parameters in Dynare. I just guessed some values. The attached code now runs. You only have to make sure that you insert the correct parameters. One more remark: always put the check command after the steady state command as otherwise the model cannot be checked correctly as the steady state values are still missing.
simul_olg.mod (3.44 KB)

I thank you infinitely!!! it works!I shall be more watchful in the future…

And one remark on your comments. Usually, comments with // work because the Dynare preprocessor recognizes them (e.g. in the model statement). However, your line is interpreted as pure Matlab code. In this case, comments are initiated with % instead of //. The reason is that you do not compute previously defined parameters here. If you had included uoptbar and ubar in the initial parameters statement, Dynare would have correctly recognized the comment. Instead, Dynare sees this line as a line of standard Matlab code with different rules for comments.