If statement

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

If statement

Postby eta » Mon Dec 15, 2014 4:22 pm

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=..."
eta
 
Posts: 70
Joined: Sat Sep 27, 2014 3:48 pm

Re: If statement

Postby jpfeifer » Wed Dec 17, 2014 3:47 pm

In the context of stochastic simulations: no.
In the context of deterministic simulations, you have to rewrite the conditions using min and max operators.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: If statement

Postby eta » Wed Dec 17, 2014 6:02 pm

So if I have w=mrs, I have to impose w=max(mrs,x(-1))?
eta
 
Posts: 70
Joined: Sat Sep 27, 2014 3:48 pm

Re: If statement

Postby jpfeifer » Thu Dec 18, 2014 6:23 am

Yes.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 12 guests