Max() function deterministic simulation

Dear all,
I am trying to simulate (using Dynare 4.0.4.) a non linear deterministic model imposing the zero lower bound on the nominal interest rate. To this purpose, I added in the model section of the mod file
max(1,(1+int)/(1/bet) - (infl)^1.5)
where int is the nominal interst rate, bet is the subjective discount factor and infl is the inflation rate.

  1. PROBLEM: when running the simulation, I obtain:
    1 - err = NaN
    Time of iteration :0.266
    10 - err = NaN
    Time of iteration :0.125
    Total time of simulation :1.56
    WARNING : maximum number of iterations is reached (modify options_.maxit).

  2. If I write a negative number in the first argument of the max function, e.g.
    max(-0.1,(1+int)/(1/bet) - (infl)^1.5)
    the simulation goes through.

  3. If I solve the model without imposing the zero lower bound constraint, there are no problems in the simulation (apart the negativity of the nominal interest rate in some periods!!)

What might be the problem? and the solution?
Many thanks

Hi Tiziano,

Have you tried reducing the step size of the Newton iteration (options_.slowc) from the default 1 to e.g. 0.1 and increasing the maximum number of iterations (options_.maxit) from 10 to e.g. 100? It has worked for me in a related problem.

Good luck: Peter

Dear Tiziano,

I guess the problem is due to the fact that the max function has discontinuous derivatives. You can approximate the function max(a,b) by the function
*max_sigma(a,b) = (0.5 * (a+m)^sigma + 0.5 * (b+m)^sigma) ^(1/sigma) - m *

The limit for sigma -> infty is the desired min function. Try to use some values of sigma around 10 … as bigger sigma is, as more exact and but unstable the model is.

Could you show me your code?