Indicator function

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.

Indicator function

Postby gio_mel » Thu Dec 03, 2009 4:04 pm

Does anyone know how to include an indicator function in a dynare code?
Giovanni
gio_mel
 
Posts: 3
Joined: Thu Dec 03, 2009 4:00 pm

Re: Indicator function

Postby pakocica » Thu Dec 03, 2009 8:07 pm

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
pakocica
 
Posts: 46
Joined: Fri Nov 27, 2009 6:42 pm
Location: Taiwan (come from Prague)

Re: Indicator function

Postby SébastienVillemot » Fri Dec 04, 2009 9:41 am

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,
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Indicator function

Postby gio_mel » Sun Dec 06, 2009 12:25 pm

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
gio_mel
 
Posts: 3
Joined: Thu Dec 03, 2009 4:00 pm

Re: Indicator function

Postby pakocica » Sun Dec 06, 2009 3:18 pm

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
pakocica
 
Posts: 46
Joined: Fri Nov 27, 2009 6:42 pm
Location: Taiwan (come from Prague)


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 15 guests