max( ) fails in the stochastic environment?

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.

max( ) fails in the stochastic environment?

Postby superztt » Sat Feb 14, 2015 10:59 pm

I defined a variable in dynare, as x= max(1, y) since this variable cannot be beyond 1, say a probability.

Unfortunately, dynare returned me with such a warning,
"WARNING: you are using a function (max, min, abs, sign) or an operator (<, >, <=, >=, ==, !=) which is unsuitable for a stochastic context; see the reference manual, section about "Expressions", for more details. ".

I didn't find the solution in the reference manual. My question is how to limit the domain of a variable in dynare in a stochastic context?
superztt
 
Posts: 58
Joined: Sat Apr 26, 2014 8:24 pm

Re: max( ) fails in the stochastic environment?

Postby jpfeifer » Sun Feb 15, 2015 2:21 pm

In the stochastic context (except for extended path), the model must be differentiable. max operators introduce non-differentiabilities and will (mostly) be ignored. You can try to limit domains using transformations like:
for parameters with support [LB Inf): LB+exp(x) (inverse transformation of log(x-LB))
for parameters with support [LB UB]: (UB+exp(x)*LB)./(1+exp(x)) (inverse tranformation of log((UB-x)./(x-LB)))

However, a first order approximation will always approximate this linearly, i.e. in an unbounded way.
------------
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: max( ) fails in the stochastic environment?

Postby superztt » Sun Feb 15, 2015 6:21 pm

Thank you.

It is the IRFs that bother me. I can see that both the transformation and max ( ) work at the steady state, but fail at the IRFs. The response moved over the boundaries.

Just to clarify, does it fail only for first order approximation or for higher orders as well? Actually, I used 2nd order approximation.
superztt
 
Posts: 58
Joined: Sat Apr 26, 2014 8:24 pm

Re: max( ) fails in the stochastic environment?

Postby jpfeifer » Mon Feb 16, 2015 12:16 pm

Kinks cannot be smoothly approximated at all.
Any boundary will be violated with some probability for derivative-based approximations. There is no way to avoid this, even for nth-order approximations.
------------
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


Return to Dynare help

Who is online

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