Matlab Functions in Dynare 4

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

Matlab Functions in Dynare 4

Postby bigbigben » Thu May 15, 2008 6:11 pm

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?
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: Matlab Functions in Dynare 4

Postby fabio_portugal » Sat Oct 25, 2008 1:57 pm

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

http://www.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
Fabio Verona
Research Economist
Monetary Policy and Research Department
BANK OF FINLAND
fabio_portugal
 
Posts: 10
Joined: Thu Sep 27, 2007 10:06 am
Location: Helsinki

Re: Matlab Functions in Dynare 4

Postby SébastienVillemot » Mon Oct 27, 2008 4:29 pm

Hi

In Dynare v4, only some functions are allowed in the model block. See:
viewtopic.php?p=3368#p3368

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
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Matlab Functions in Dynare 4

Postby fabio_portugal » Sat Nov 01, 2008 1:39 pm

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
You do not have the required permissions to view the files attached to this post.
Fabio Verona
Research Economist
Monetary Policy and Research Department
BANK OF FINLAND
fabio_portugal
 
Posts: 10
Joined: Thu Sep 27, 2007 10:06 am
Location: Helsinki

Re: Matlab Functions in Dynare 4

Postby SébastienVillemot » Mon Nov 03, 2008 9:52 am

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
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 2 guests