Hack for imposing inequality constraints during estimation

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.

Hack for imposing inequality constraints during estimation

Postby cfp » Sat Jun 25, 2011 12:17 am

So I wanted to impose some non-linear inequality constraints during estimation. The following code seemed to work and may be of use to others. The trick is to introduce a new dummy variable with an equation that violates the Blanchard-Kahn conditions if the inequalities aren't satisfied.

Code: Select all
var dummy;
...
model;
...
   #ineqtest = 1.5 -
      ( p * gamma * lambda < 1 ) *
      ( eta * gamma * lambda >= 1.0 ) *
      ( STEADY_STATE( jP ) > 0 ) *
      ( STEADY_STATE( log_1PmuP ) > STEADY_STATE( log_1Pmu ) ) *
      ( STEADY_STATE( LR ) > 0 ) *
      ( STEADY_STATE( o_log_rd_share ) > -3.5915 ) *
      ( STEADY_STATE( o_log_rd_share ) < -3.5905 );
   dummy = ineqtest * ( 1 + dummy(+1) ) - 0.5;

The first equation specifies all of the inequalities I want to hold (and is the bit you would need to change). Note that the things in the inequalities can be functions of the steady state, and of model local variables (eta is in this particular example). The second ensures that the BK conditions are violated if the inequalities don't hold. When the inequalities hold, ineqtest = 0.5, and so the dummy equation is explosive, meaning dummy = 0 is the only solution and the BK conditions hold. If one of the inequalities doesn't hold, then ineqtest = 1.5, and so the dummy equation is indeterminate (and so violates the BK conditions), with a mean of -2 (to make clear what's going on).

If any of the Dynare dev's are reading this it would be great if there was a non-hacky way of doing this. (Perhaps there already is and I've just missed it.)

Tom
cfp
 
Posts: 60
Joined: Mon Mar 15, 2010 9:18 pm

Re: Hack for imposing inequality constraints during estimati

Postby azuo1001 » Wed Feb 15, 2012 2:18 am

Hi Tom, I tested it, but it seemed that it didn't work, the result was just liking not imposing the restritions.
azuo1001
 
Posts: 7
Joined: Mon Jan 09, 2012 10:56 am

Re: Hack for imposing inequality constraints during estimati

Postby cfp » Wed Feb 15, 2012 11:04 am

Your PM suggested that you're trying to use this method to impose bounds on simulated variables rather than on the steady state. See Michael's post here for details on doing that: http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3104
cfp
 
Posts: 60
Joined: Mon Mar 15, 2010 9:18 pm


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 2 guests