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))
else
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))
endif
```

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

Could anybody advise?
kladde5.mod (5.3 KB)

Thanks!

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:

```
/* Replicates the IRFs at the stochastic steady/ergodic mean in the absence of shocks
* by Basu/Bundick (2017): "Uncertainty shocks in a model of effective demand",
* Econometrica, 85(3), pp. 937-958
*
* Notes:
* - Due to pruning, one cannot simply use the stochastic steady state as the starting point
* for simult_.m as one would do with the deterministic steady state in a linear model. The reason
* is the pruned state space where one would need to provide the first, second, and third order components
* of the stochastic steady state. Dynare does currently not yet support this. For this reason, the impulse
* period is simply appended to the simulation for computing the stochastic steady state
* - Basu/Bundick only use 200 periods of burn-in for computing the stochastic steady state. This is not sufficient
* for convergence as can be easily verified by plotting a longer simulation. Setting true_stochastic_steady_state_IRFs=1
* therefore uses a longer burn-in, leading to slightly different IRFs.
*/
/*
* Copyright (C) 2016-17 Benjamin Born and Johannes Pfeifer
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
```

This file has been truncated. show original