max() function deterministic simulation

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.

max() function deterministic simulation

Postby tropele » Wed Sep 16, 2009 7:26 pm

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:
MODEL SIMULATION :
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
Tiziano
tropele
 
Posts: 1
Joined: Wed Sep 16, 2009 6:52 pm

Re: max() function deterministic simulation

Postby pkaradi » Tue Nov 03, 2009 11:56 am

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
pkaradi
 
Posts: 6
Joined: Mon Oct 06, 2008 7:42 pm

Re: max() function deterministic simulation

Postby pakocica » Sat Nov 28, 2009 10:58 pm

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?

Best,
Pavel
pakocica
 
Posts: 46
Joined: Fri Nov 27, 2009 6:42 pm
Location: Taiwan (come from Prague)


Return to Dynare help

Who is online

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