Using variables defined by piecewise functions

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.

Using variables defined by piecewise functions

Postby sebastien.walker » Fri Oct 10, 2014 4:46 pm

Hello,

I need to define a variable X_t given by

X_t = 0 if A_t < B_t,

and

X_t = A_t - B_t otherwise.

Is there a way of doing this in Dynare?

Many thanks,

Sébastien
sebastien.walker
 
Posts: 2
Joined: Thu Mar 20, 2014 6:28 pm

Re: Using variables defined by piecewise functions

Postby jpfeifer » Sat Oct 11, 2014 2:48 pm

That means
Code: Select all
X_t=max(0,A_t-B_t)

You can enter this into Dynare, but only for deterministic simulations, not when using stoch_simul.
------------
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 13 guests