Substitute for signum function

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.

Substitute for signum function

Postby sm959 » Fri Jul 31, 2015 9:50 am

Hi,

I am currently running an IRBC bond economy model and would like to dampen bond trade by taxing the return on bond with (1 + tau). As I want to discourage borrowing and lending, tau should be positive when the bond position is negative (as to increase the interest cost when in debt), but negative when the bond position is positive (so as to reduce the return on savings).

Simply defining tau = 0.01*(-1)*sign(B), where B is the bond position, is not allowed in Dynare and trying something along the lines of tau = 0.01*(-1)*abs(B)/B leads to problems with the derivative as the bond position is zero in steady state.

Do you happen to know of any way to resolve this? All comments are greatly appreciated!

Many thanks,
Sam
sm959
 
Posts: 1
Joined: Fri Jul 31, 2015 9:36 am

Re: Substitute for signum function

Postby jpfeifer » Fri Jul 31, 2015 11:06 am

Both sign and max/min introduce non-differentiabilities that will not work with perturbation based methods. You would need to define something like a continuous barrier function. See e.g. http://www.robertkollmann.com/KOLLMANN_ ... C_2010.pdf
------------
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: No registered users and 4 guests

cron