Page 1 of 1

Indicator function

PostPosted: Thu Dec 03, 2009 4:04 pm
by gio_mel
Does anyone know how to include an indicator function in a dynare code?
Giovanni

Re: Indicator function

PostPosted: Thu Dec 03, 2009 8:07 pm
by pakocica
Dear Giovanni,

can you specify more in detail what you mean by the indicator function? Can you explain your what is your idea why you want to include an indicator function in your model?

Regards,
Pavel

Re: Indicator function

PostPosted: Fri Dec 04, 2009 9:41 am
by SébastienVillemot
Hi Giovanni,

There is indeed an equal operator which evaluates to 1 if the equality is satisfied, or 0 otherwise.

For example, you can put this in your model:
Code: Select all
x = delta*(y == 3);


x=delta when y=3, and x=0 otherwise.

Similarly, you have other comparison operators: != < > <= >=

However note that the use of this only make sense in a deterministic setup where we fully handle the non-linearities.

In a stochastic setup, we make a local approximation around the steady state. So if the steady state doesn't satisfy the equality, the equality will always be unsatisfied in the neighborhood of the steady state, so Dynare will act as if the equality is always unsatisfied. And if the steady state satisfies the equality, then you can't make a local approximation, because you have a singularity at the steady state.

Best,

Re: Indicator function

PostPosted: Sun Dec 06, 2009 12:25 pm
by gio_mel
Dear Sebastien,

Thank you for your answer. It'll be very helpful to me. I'm not sure whether in my case I am going to have the problems you have mentioned. However, it is indeed worth trying. I'll let you know.

Best

Giovanni

Re: Indicator function

PostPosted: Sun Dec 06, 2009 3:18 pm
by pakocica
Dear Giovani,

if you send me your code or at least explain how you use the indicator function, I will try to find out if it can cause some problems.

Pavel