Page 1 of 1

Using variables defined by piecewise functions

PostPosted: Fri Oct 10, 2014 4:46 pm
by sebastien.walker
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

Re: Using variables defined by piecewise functions

PostPosted: Sat Oct 11, 2014 2:48 pm
by jpfeifer
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.