Matlab Functions in Dynare 4

Hi, I write a code with Matlab functions in Dynare. It looks like Dynare won’t recognize.

The function is just normcdf in Matlab, below is the line Dynare recognized as an error

normcdf((log(omeU)+sig_omeU^2)/sig_omeU);

The Error Message from dynare tells me there is an unmatched “)”, but there is not.

Do you have similar experience or just me?

Hi, I have the same problem. As you can see in Dynare web site,

dynare.org/manual/ch04s02.html#id384532 *

they say:
What doesn’t work
optimal policy rules
using Matlab functions beyond power, log(), exp(), sqrt(), sin(), cos(), tan()
some mixing of Matlab code inside the *.mod file
the manual isn’t updated

Therefore I think that the problem is that we are using the function NORMCDF, but I’m not sure.
Can you tell me something If you’ll solve the problem ? Thank you very much
Best Regard
Fabio

NB: * new url

Hi

In Dynare v4, only some functions are allowed in the model block. See:

However, normcdf() is supported and should work in the model block.

Maybe you could give us more information (the version of Dynare you are using, the MOD file and the exact error message) ?

Best

Sébastien

Hi, here there is the .mod code and the .m file where I save the steady state values.

I don’t have problem using Dynare v3_065, but with Dynare (I think that it is version 4-Prerelease) I obtain the following message:

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

**Starting Dynare …
Starting preprocessing of the model file …
ERROR: benchmark.mod:38.61: syntax error, unexpected ‘)’

??? Error using ==> dynare
Preprocessing failed**

Thank you very much for your concern to this matter
Best Regard
Fabio
SSV.m (2.51 KB)
benchmark.mod (11.6 KB)

Hi

Part of your problem comes from the fact that your are not using the latest Dynare release. Please upgrade to Dynare 4.0.2, and normcdf() will work as you would expect.

However, I have tested your mod-file with Dynare 4.0.2, and it fails when Dynare encounters normpdf(), which is not implemented in Dynare 4.0. You have to replace the PDF by its analytical expression, until we implement the shortcut in Dynare.

Best

Sébastien