Weird Error when using an 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.

Weird Error when using an Indicator Function

Postby Daniel Bendel » Fri Oct 25, 2013 12:59 pm

Dear all,

I've got a weird error, when I'm doing the following thing:

1. I want to have a model, in which the shock values are only smaller than one. The shock follows an AR(1) process. Say, A is the shock variable.
2. So I use an approximation of the indicator function to achieve this: if the shock value (eps_A) (eps_A is declared with varexo in the dynare code) is larger than one, set the shock value to one, otherwise use the actual shock value:

A = exp(eps_A)*(1-1/(1+exp(-500000*(exp(eps_A)-1)))) + 1/(1+exp(-500000*(exp(eps_A)-1)));

3. If I do that with random variables, I got a wonderful data set, where the upper bound of the time series is 1.
4. But if I do it with dynare, dynare gives me allways A's bigger than 1.

Why is dynare doing that???

With best wishes,
Daniel
Germany, Cologne
Daniel Bendel
 
Posts: 134
Joined: Tue Nov 15, 2011 1:06 pm
Location: Cologne, Germany

Re: Weird Error when using an Indicator Function

Postby jpfeifer » Fri Oct 25, 2013 3:57 pm

Because you are not using the equation you write down, but a linear approximation (or higher order) to that equation.
------------
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: Weird Error when using an Indicator Function

Postby Daniel Bendel » Sat Oct 26, 2013 1:12 pm

Is there a way to solve this problem?
Germany, Cologne
Daniel Bendel
 
Posts: 134
Joined: Tue Nov 15, 2011 1:06 pm
Location: Cologne, Germany

Re: Weird Error when using an Indicator Function

Postby jpfeifer » Sat Oct 26, 2013 5:15 pm

Depends on what exactly you are trying to achieve. The general answer would be: No, there is no way to do this that is consistent with rational expectations.
------------
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: Weird Error when using an Indicator Function

Postby Daniel Bendel » Mon Oct 28, 2013 9:23 am

Ah, okay thank you. My problem can be solved when I used second order approximation and reduce the high number 500000 to 100.
Germany, Cologne
Daniel Bendel
 
Posts: 134
Joined: Tue Nov 15, 2011 1:06 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests