How to increase the Max.Iteration option

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 increase the Max.Iteration option

Postby john » Sun Oct 03, 2010 7:52 pm

In advance, many thanks for many people's help for me to learn dynare.

I try to increase the MaxIter option.
I am using the
==> steady(solve_algo=0);

Based on manual, I wrote the
==> maxit_=20;

And also tried
==> maxit_=100;

But I cannot figure out any difference betwee two.
Calculation always finished when iteration goes 2000 for both cases.

Since the evalution of f(x) decreasing, it seems to work if I can increase the Max.Iteration option.



Maximum number of iterations reached:
increase options.MaxIter.
??? Error using ==> steady_ at 132
STEADY: convergence problems

Error in ==> steady at 52
steady_;

Error in ==> ver1003 at 585
steady;

Error in ==> dynare at 132
evalin('base',fname) ;
Attachments
ver1003.mod
(13.46 KiB) Downloaded 184 times
john
 
Posts: 6
Joined: Thu Sep 30, 2010 1:07 pm

Re: How to increase the Max.Iteration option

Postby john » Mon Oct 04, 2010 8:28 am

when I use 'fsolve' function in MATLAB.
I can controal fsolve function through the following command.... for maxIter, Display calculation procedure or not, and Max Fun Evaluation.
I tried these command in Dynare....
There was no erroe but ..... nothing change.
Is there anyone who can comment on this issue?


options.MaxFunEvals=100000;
options.MaxIter =100000;
options.Display = 'off';

new mod file is attached...
Attachments
ver1003.mod
(13.75 KiB) Downloaded 236 times
john
 
Posts: 6
Joined: Thu Sep 30, 2010 1:07 pm

Re: How to increase the Max.Iteration option

Postby jpfeifer » Mon Oct 04, 2010 1:34 pm

I am not sure that you can control the number of iterations with a Dynare option. However, what you can do is manually change the file dynare_solve.m
There you will find the default values in lines 46-50
Code: Select all
   
    options=optimset('fsolve');
    options.MaxFunEvals = 50000;
    options.MaxIter = 2000;
    options.TolFun=1e-8;
    options.Display = 'iter';

which you can adapt to your liking.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: How to increase the Max.Iteration option

Postby john » Mon Oct 04, 2010 3:34 pm

Thanks a lot.
It works.
john
 
Posts: 6
Joined: Thu Sep 30, 2010 1:07 pm


Return to Dynare help

Who is online

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