IF statements in model block

Hi, I am very new to Dynare, and I have the following TANK model, where I have implemented a parameter “gamma” that incorporates some kind of level of adaptive expectations for one of the agents. I would like to in the 6th equation in the model block to add an if statement that makes it the following:

If gamma = 0
q-sigma_H*c_H = -(1-beta*(1-delta))*chi_H*x_H+beta*(1-delta)*(q(+1)-sigma_H*c_H(+1))
q-sigma_H*c_H = -(1-beta*(1-delta))*chi_H*x_H+beta*(1-delta)*(gamma^2*q(-1)-sigma_H*c_H(+1))

I tried using @#if directly in the model block, although this did not work.

Could anybody advise?
kladde5.mod (5.3 KB)


You cannot condition on the value of a parameter using the macro processor. But you can define a macro-switch to set gamma and then condition on that macro-switch. See e.g. the sticky_prices-switch: