How to use dynare to express sign and abs 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.

How to use dynare to express sign and abs function

Postby xujh03 » Sat Jan 30, 2010 2:48 pm

Hi, I have a model which uses sign and abs function. But when I put it into the dynare, it seems that dynare cannot recognize it. Does anyone know how to solve this problem?
Thanks
xujh03
 
Posts: 9
Joined: Sat Jan 30, 2010 2:39 pm

Re: How to use dynare to express sign and abs function

Postby SébastienVillemot » Thu Feb 04, 2010 11:45 am

Hi

Currently the abs() and sign() function are not available in Dynare models. We may add them in the future if requested.

Note that their use only makes sense in a deterministic context; in a stochastic context, since we are approximating around a point, we are either on one side or on the other side of the abs() function, but we won't cross the zero-point, because we are doing local approximation.

Best
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: How to use dynare to express sign and abs function

Postby StephaneAdjemian » Sat Feb 20, 2010 10:18 am

As sébastien says such functions are meaningless with a perturbation approach. However if you want to solve a perfect foresight model (deterministic) you can emulate the sign function as follows:

Code: Select all
signX = (X>=0) - (X<0) ;


where signX and X are declared endogenous variables. Obviously you can also emulate the abs function using the same trick.

Attached is an example with the ramsey model and a sign function on the variations of consumption.

Best,
Stéphane.
Attachments
ramst2.mod
ramsey model with a sign function on consumption variations.
(501 Bytes) Downloaded 84 times
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.


Return to Dynare help

Who is online

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