Page 1 of 1

If statement

PostPosted: Mon Dec 15, 2014 4:22 pm
by eta
Is i possible to specify an if cycle for endogenous variables ? I would like to have something like
"if w<w(-1)
w=w(-1)
else
w=..."

Re: If statement

PostPosted: Wed Dec 17, 2014 3:47 pm
by jpfeifer
In the context of stochastic simulations: no.
In the context of deterministic simulations, you have to rewrite the conditions using min and max operators.

Re: If statement

PostPosted: Wed Dec 17, 2014 6:02 pm
by eta
So if I have w=mrs, I have to impose w=max(mrs,x(-1))?

Re: If statement

PostPosted: Thu Dec 18, 2014 6:23 am
by jpfeifer
Yes.