max() function

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

max() function

Postby sambler » Thu Jan 29, 2009 10:55 pm

Hello,

I am trying to simulate a model w/ a Taylor rule for monetary policy and want to impose the zero lower bound. Looking through these forums, I see in the "pound lines again" thread that there is a max() function defined in Dynare 4 that takes 2 arguments. My code compiles without error but I still get values as small as about 0.985 for the gross nominal interest rate. I have a few questions.

1) Is the command documented anywhere?

2) Dynare needs to calculate derivatives of functions up to order 2. A max(1 , x) function has a kink at 1, so Dynare must approximate the function with a function that is differentiable at the kink. What is the functional form used? I know that there is a literature on nondifferentiable optimization, for example Israel Zang (1980), "A Smoothing-Out Technique for Min-Max Optimization" Mathematical Programming 19, 61-77. The technique suggested there is to define a smooth curve in the region of the kink only and splice it to the max() function at either endpoint, ensuring that the function never takes a value lower than the 1 in the example above, but Dynare can't be using this technique.

3) Does the newest version of Dynare 4 allow for user-defined Matlab functions? I could easily write a Matlab script to reproduce the technique in the cited article, and run it to get the function into memory before invoking Dynare.

Thanks in advance.

Steve
sambler
 
Posts: 1
Joined: Thu Jan 29, 2009 9:18 pm

Re: max() function

Postby SébastienVillemot » Tue Feb 17, 2009 10:20 am

Hi,

1) Unfortunately the command is not yet documented

2) Our way of computing the derivative of the max() function is not as clever as the one you suggest; basically, the derivative of "max(f(x), g(x)" is "(f(x)>g(x))*f'(x) + (f(x)<=g(x))*g'(x)", where a comparison must be understood as evaluating to 1 or 0. So at the kink, by convention we give the derivative of the second argument, but this is clearly not satisfactory and is only meant as a convention.

Actually our max() function is principally meant for deterministic models where we don't make local approximations; if you use a first or second order approximation (such as with stoch_simul), you are basically replacing max(a,b) by whatever of the expressions is greater at the steady-state.

3) We should provide such a feature in the next major Dynare relase (probably numbered Dynare 4.1).

Best,

Sébastien
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 version 4

Who is online

Users browsing this forum: No registered users and 2 guests