smooth approximation max 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.

smooth approximation max function

Postby Simon » Mon Oct 22, 2012 10:07 am

Hello everyone,

i need to use the max()-function for my model. From this forum i learned that the max-function is only supported in a deterministic setup, so it is of little help for me. The obvious alternative is a smooth approximation to the max function, which has no kinks and therefore allows the model to be solved by standard pertubation methods. The one I used is the following (for max(0,variable) )

ABS= ( sqrt(VARIABLE^2) + VARIABLE) / 2 ;

The problem i am now encountering is that dynare somehow ignores the square on my VARIABLE^2. Even if i define a variable like
TEST = VARIABLE^2 , this variable becomes negative on the adjustment path.

Is there any reason for this?

The alternative would be to use the extended-path method, but i am not sure about this as i know little about it.

Many thanks!
Simon
Simon
 
Posts: 12
Joined: Wed Dec 22, 2010 12:58 am

Re: smooth approximation max function

Postby SébastienVillemot » Mon Nov 12, 2012 2:54 pm

Simon wrote:i need to use the max()-function for my model. From this forum i learned that the max-function is only supported in a deterministic setup, so it is of little help for me. The obvious alternative is a smooth approximation to the max function, which has no kinks and therefore allows the model to be solved by standard pertubation methods. The one I used is the following (for max(0,variable) )

ABS= ( sqrt(VARIABLE^2) + VARIABLE) / 2 ;

The problem i am now encountering is that dynare somehow ignores the square on my VARIABLE^2. Even if i define a variable like
TEST = VARIABLE^2 , this variable becomes negative on the adjustment path.

Is there any reason for this?


Yes: at order 1, Dynare linearizes around the steady state, so the positivity constraint of your square function is not enforced. At second order, Dynare will use a 2nd-degree polynomial expressed in terms of state variables and exogenous shocks; if your VARIABLE is not a state variable, the polynomial will not necessarily be the one you entered, and the sign condition can therefore be violated.

Essentially it is not possible to emulate a max-like constraint with a pure perturbation method. You really need deterministic simulations or extended path.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: smooth approximation max function

Postby Simon » Thu Nov 22, 2012 1:50 pm

Dear Mr. Villemot, many thanks for your answer!

One thing I do not undersand about it is why you said "deterministic simulations OR extended path". Does the extended path method not provide a deterministic solution as well? As far as i understood this method, agents assume future shocks to be zero when computing their expectations.

Is this different if you run a simulation using extended path in dynare? This point is very important to me, as i want to conduct a welfare analysis.

many regards,
Simon
Simon
 
Posts: 12
Joined: Wed Dec 22, 2010 12:58 am

Re: smooth approximation max function

Postby SébastienVillemot » Mon Jan 07, 2013 3:49 pm

What I meant by "deterministic solver" was the "simul" command, which is a deterministic solver assuming perfect foresight. The extended path indeed uses a deterministic solver, but does not make the perfect foresight assumption.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

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