Could this be a bug?

Hi,

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.