Page 1 of 1

Weird Error when using an Indicator Function

PostPosted: Fri Oct 25, 2013 12:59 pm
by Daniel Bendel
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

Re: Weird Error when using an Indicator Function

PostPosted: Fri Oct 25, 2013 3:57 pm
by jpfeifer
Because you are not using the equation you write down, but a linear approximation (or higher order) to that equation.

Re: Weird Error when using an Indicator Function

PostPosted: Sat Oct 26, 2013 1:12 pm
by Daniel Bendel
Is there a way to solve this problem?

Re: Weird Error when using an Indicator Function

PostPosted: Sat Oct 26, 2013 5:15 pm
by jpfeifer
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.

Re: Weird Error when using an Indicator Function

PostPosted: Mon Oct 28, 2013 9:23 am
by Daniel Bendel
Ah, okay thank you. My problem can be solved when I used second order approximation and reduce the high number 500000 to 100.