External function

Hi together

I have a Monacelli DSGE model with consumption habits (‘new.mod’). This works fine. However, I would like to show the typical aggregate demand function which one can built from eqn 8 and 10 (Risk sharing equation and market clearing equation and using the Euler equation).

To do so, I replaced the market clearing eq. (10) with the aggregate demand equation (new 10). Doing so in the model (‘new_ad2.mod’), I get the following error message:
“To use an external function within the model block, you must first declare it via the external_function() statement.”

I don’t understand the error message with regard to my changes, I have added a parameter rho_y and another parameter omega_s which is a function of other paramters, so this should not be an external function.

Does anybody know why this error message appears? I would be very happy about any help.

best regards,
new_ad2.mod (3.66 KB)
new.mod (3.96 KB)

The variable phif in eqn10 is not declared. When you have ‘phif(+1)’ as a part of the expression for that equation, Dynare reads it as a function when it tries to parse the file. Declaring the variable should take care of it…

Thanks a lot for the hlep, now it worked.