Could this be a bug?

Dear all,
While trying to simulate the attached file the following error message pops up. What could be wrong? Does it means Matlab files cannot be called from within DYNARE? The error seems to point to quad.m in Matlab. Please help me

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

Starting Dynare …
Starting preprocessing of the model file …
ERROR: KrauseLubik.mod:31.10: character unrecognized by lexer

??? Error using ==> dynare at 96
DYNARE: preprocessing failed

KrauseLubik.mod (4.44 KB)


The problem is caused by the use of the symbol @ in a dynare statement (where the parameter Hauc is defined). This is Ok with dynare version 3 but not with dynare version 4, where this symbol is used for the macroprocessor (see here). You are only allowed to use @ in a non dynare statement, that is a line beginning by anything except a declared parameter, a declared variable or a dynare keyword. For dynare v4 the workaround is to replace the Hauc line by

function_handle = @afa ;
Hauc = quad(function_handle,at,8);

The first line is not a dynare statement so you can use the @ symbol. Obviously you need the afa.m.

You should also look at this post.

Best, Stéphane.