Min max function help

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.

Min max function help

Postby magonfru » Wed May 27, 2015 9:02 pm

Hello, I am solving a model with occasional constraints using a trick presented by Garcia and Zangwill (1981). Basically it replaces the lagrangian multipliers by max(0,nu) functions where is appropriate. I tried this trick and it seems to work. To recover the values of the original lagrangian multipliers one must set an extra equation as lambda=max(0,nu). This way when nu=0 you would see that lambda takes values of 0. However, this is not happening in my code :( , so I am not sure if the other part of the code is working :?: .
I wanted to know if someone could let me know what's going on
Best Regards
Mario
Attachments
banks_cia_obc.mod
Model file
(3.89 KiB) Downloaded 100 times
solvesss.m
File to find the some steady state variables
(407 Bytes) Downloaded 84 times
magonfru
 
Posts: 12
Joined: Sun Oct 27, 2013 5:39 am

Re: Min max function help

Postby jpfeifer » Thu May 28, 2015 1:55 pm

As Dynare reports, you cannot use non-differentiable functions with stoch_simul as Taylor approximations in this case are not well defined. You cannot easily get around the problem with occasionally binding constraints in stochastic simulations.
------------
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: Min max function help

Postby theta23 » Mon Jan 18, 2016 5:47 pm

A question concerning Garcia-Zangwill trick, what are the applications of it? In which setup is it currently used?

Any information and hints would be highly appreciated!
theta23
 
Posts: 20
Joined: Mon Apr 27, 2015 3:20 pm

Re: Min max function help

Postby jpfeifer » Tue Jan 19, 2016 9:30 am

It is used in cases where i) you need the complementary slackness condition because the constraint is not always binding and ii) the non-differentiability at the kink is honored by the solution technique. This implies that you can only use it in the perfect foresight context where no Taylor approximation is conducted.
------------
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: Min max function help

Postby theta23 » Tue Jan 26, 2016 8:12 am

But I thought that inequaility constraints can (trivially) be handled also by Matlab routine fmincon. I cannot see the advantage of Garcia Zangwill "trick" and recasting the problem into one with equalities. Or is the reason that with fmincon computational errors are larger/more probable?
theta23
 
Posts: 20
Joined: Mon Apr 27, 2015 3:20 pm

Re: Min max function help

Postby jpfeifer » Fri Jan 29, 2016 9:33 am

Dynare does not use fmincon with its syntax where you can provide various constraints. You need to enter the equations in Dynare syntax and one way to do this is by entering the complementary slackness condition to transform inequalities to equalities.
------------
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: Min max function help

Postby theta23 » Fri Jan 29, 2016 6:06 pm

Thanks!
theta23
 
Posts: 20
Joined: Mon Apr 27, 2015 3:20 pm


Return to Dynare help

Who is online

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