Weird Error when using an Indicator Function
Posted: 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
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