Dynare always complains unknown variables when I put parameters (like parameter lam in the following code) in macro-expressions. I have to do some algebra for lam within the mod file. So it is not convinenent to use -D option after dynare command. Any ways out of this?
parameters alpha beta...... lam;
alpha = 0.1;
beta =0.95;
......
lam = alpha+ beta+....;
...
@#define iszero = (lam > 0)
What you are having here is not possible at the macro processor level. The expressions you are having depend on parameter evaluations not known when the preprocessor parses the file. These evaluations are only conducted when executing the Matlab codes. But you may be able to use something like
parameters isGS;
isGs = (Gs ==0)
model;
exp(Y) = exp(C) + isGs*(G) + (1-isGs)exp(G);
instead of
@#if isGs
exp(Y) = exp(C) + (G);
@#else
exp(Y) = exp(C) + exp(G);
@#endif
Thank you very much for the help. @jpfeifer