Error!!!! evalin('base',fname) ;

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.

Re: Error!!!! evalin('base',fname) ;

Postby audrey64140 » Wed May 26, 2010 7:36 pm

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);
>>
audrey64140
 
Posts: 6
Joined: Mon May 24, 2010 1:49 pm

Re: Error!!!! evalin('base',fname) ;

Postby audrey64140 » Wed May 26, 2010 7:40 pm

Sorry but i have nothing else except the mod.file called simul_olg!! I make my debut on this software!!
audrey64140
 
Posts: 6
Joined: Mon May 24, 2010 1:49 pm

Re: Error!!!! evalin('base',fname) ;

Postby jpfeifer » Wed May 26, 2010 7:45 pm

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.
Attachments
simul_olg.mod
Running file with guessed parameters
(3.44 KiB) Downloaded 333 times
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Error!!!! evalin('base',fname) ;

Postby audrey64140 » Wed May 26, 2010 7:51 pm

I thank you infinitely!!!!! it works!I shall be more watchful in the future..
audrey64140
 
Posts: 6
Joined: Mon May 24, 2010 1:49 pm

Re: Error!!!! evalin('base',fname) ;

Postby jpfeifer » Wed May 26, 2010 7:54 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Error!!!! evalin('base',fname) ;

Postby audrey64140 » Wed May 26, 2010 8:08 pm

thank you very much!
audrey64140
 
Posts: 6
Joined: Mon May 24, 2010 1:49 pm

Re: Error!!!! evalin('base',fname) ;

Postby paragw » Tue Nov 09, 2010 7:54 pm

Hi
I am trying to run the attached code to solve for ramsey policy. When I run the code in MATLAB, I get the following.

>> dynare C:\dynare\4.1.3\work\leviathancomp\leviathanopt-ramsey.mod

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.3).
Starting preprocessing of the model file ...
Substitution of exo leads: added 1 auxiliary variables and equations.
Found 5 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Computing static model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

??? Error: Unexpected MATLAB operator.

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

So I do have some computations but program stops with the above error message. Any suggestions? I am using MATLAB 7.10.0(R2010a).
Attachments
leviathanopt-ramsey.mod
(394 Bytes) Downloaded 250 times
paragw
 
Posts: 3
Joined: Mon Nov 08, 2010 2:38 am

Re: Error!!!! evalin('base',fname) ;

Postby jpfeifer » Tue Nov 09, 2010 10:54 pm

There are many problems. For starters:
  • Don't use a hyphen "-" in the filename. It gives you the mentioned error.
  • The syntax is
    Code: Select all
    planner_discount=DOUBLE;

    which means you have to substitute a number for DOUBLE. By default, it is
    Code: Select all
    planner_discount=1;
  • Add
    Code: Select all
    steady;
    check;

    after the initval block to compute the steady state from the initial values .
  • Dynare cannot handle inequality constraints like the first one.
  • You did not specify an initial value for q.The default starting value for the steady state search is then 0.
    Code: Select all
    q^(-a-1)

    will give you an error as the exponent is negative and hence you would have a division by 0.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Error!!!! evalin('base',fname) ;

Postby paragw » Sat Nov 13, 2010 6:25 pm

Thanks for the response. I will try making those changes and run it again.
paragw
 
Posts: 3
Joined: Mon Nov 08, 2010 2:38 am

Re: Error!!!! evalin('base',fname) ;

Postby paragw » Tue Nov 16, 2010 8:54 pm

Ok. So i made the changes you suggested and I still keep on getting the following error:

>> addpath c:\dynare\4.1.3\matlab
>> dynare C:\dynare\4.1.3\work\leviathancomp\leviathanoptramsey.mod

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.3).
Starting preprocessing of the model file ...
Substitution of exo leads: added 1 auxiliary variables and equations.
Found 4 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Computing static model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

??? Error: Unexpected MATLAB operator.

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

I am attaching the corrected mod file. Let me know if you think of something.
Attachments
leviathanoptramsey.mod
(385 Bytes) Downloaded 237 times
paragw
 
Posts: 3
Joined: Mon Nov 08, 2010 2:38 am

Re: Error!!!! evalin('base',fname) ;

Postby jrb » Tue Mar 08, 2011 4:42 pm

Good afternoon,

I am writting here because I am currently experiencing the same problem. I tried all the solutions mentioned above, I reinstalled Dynare, tried several versions, and created a dedicated "work" subfile.

Here is the complete Matlab output. I am using a student version, 7.10.0 (R2010a)

EDU>> addpath c:\dynare\4.1.0\matlab
EDU>> cd c:\dynare\work
EDU>> dynare CashInAdvanceModel-1

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 13 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 ==> evalin
Undefined function or variable 'CashInAdvanceModel'.

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


It seems to me that the problem comes from that Matlab doesn't recognize the "CashInAdvanceModel" function which is defined in the .mod file

This is really frustrating because I have been stuck with this issue for a couple of hours and I can't finish my work...

I really appreciate your help,

Thank you for your time and consideration.

Best regards,

Julien
Attachments
CashInAdvanceModel-1.mod
(2.92 KiB) Downloaded 238 times
jrb
 
Posts: 1
Joined: Tue Mar 08, 2011 4:36 pm

Re: Error!!!! evalin('base',fname) ;

Postby jpfeifer » Tue Mar 08, 2011 5:20 pm

First, only use alphanumeric characters in the filename. So do not use a "-".
Second, in the mod-file, delete the last for loop. The "%" used for defining the string format interferes with Matlab's use of % for comments, when preprocessing with Dynare.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Error!!!! evalin('base',fname) ;

Postby merdogul » Sun Jan 22, 2012 4:38 pm

Hi,

i am using Dynare 4.2.4 and Matlab 7.12.0 (R2011a) and i set path to the directory c:\dynare\4.2.4\matlab but still have the same problem:

??? Error: Unexpected MATLAB operator.

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

what can i do to fix this?

Thanks
Attachments
homework_4_ques1.mod
(3.87 KiB) Downloaded 224 times
merdogul
 
Posts: 3
Joined: Sun Oct 18, 2009 6:06 pm

Re: Error!!!! evalin('base',fname) ;

Postby jpfeifer » Sun Jan 22, 2012 9:59 pm

The command
Code: Select all
dynare homework_4_ques1

works fine for me. Did you rename the mod-file before uploading it?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Error!!!! evalin('base',fname) ;

Postby merdogul » Sun Jan 22, 2012 10:53 pm

Hi,

i did not change the file name but recognize that i wrote wrong command to run the code.

thank you very much...
merdogul
 
Posts: 3
Joined: Sun Oct 18, 2009 6:06 pm

PreviousNext

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests

cron