Error! evalin('base',fname) ;

thank you very much!

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).
leviathanopt-ramsey.mod (394 Bytes)

There are many problems. For starters:
[ul]
] Don’t use a hyphen “-” in the filename. It gives you the mentioned error./:m]
*] The syntax is

planner_discount=DOUBLE;
which means you have to substitute a number for DOUBLE. By default, it is

planner_discount=1; /*:m]
*] Add

steady; check;
after the initval block to compute the steady state from the initial values ./*:m]
]Dynare cannot handle inequality constraints like the first one./:m]
*] You did not specify an initial value for q.The default starting value for the steady state search is then 0.

q^(-a-1)
will give you an error as the exponent is negative and hence you would have a division by 0./*:m][/ul]

Thanks for the response. I will try making those changes and run it again.

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.
leviathanoptramsey.mod (385 Bytes)

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
CashInAdvanceModel-1.mod (2.92 KB)

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.

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
homework_4_ques1.mod (3.87 KB)

The command

works fine for me. Did you rename the mod-file before uploading it?

Hi,

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

thank you very much…

Hello
I am trying to run fixed labor of Ramsey model with tax.But I have a problem.
my MATLAB version is R2012b.

error is

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

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

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

Error: Unexpected MATLAB operator.

Error in ==> dynare (line 120)
evalin(‘base’,fname) ;

Can you help me to solve this problem?

thanks
unt.mod (667 Bytes)

Why are there @ signs in you file?

Hello,

I am trying to run the attached file but I keep on receiving this error message:

??? Error using ==> sigma at 83
Not enough input arguments.

Error in ==> RBClevels2nd at 102
set_param_value(‘sigma’,sigma)

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

I am spending a lot of time on it, could you please provide any help with it?

Thank you.
RBClevels2nd.mod (629 Bytes)

Matlab does not know sigma and tries to call the function called sigma. Are you sure that the file you load actually contains a parameter named sigma?

Even if I give some value to sigma (0.07) and nu (3) it doesn’t work

The attached file works on my machine. Did you forget the semicolon at the end of the line?
RBClevels2nd.mod (588 Bytes)

Great! I don’t really know how you did it, but It works!

Tanks a lot!

On the same model I would like to display (and eventually manage) the time varing policy matrix.
I tried different solutions but I just couldn’t, can anyone help me with it?

What do you mean with

?

I mean the G3 matrix in the model 3rd order aproximated.