# What is the "Automatic" MaxIterations in FindMinimum ?

Posted 4 months ago
970 Views
|
4 Replies
|
2 Total Likes
|
 I am using FindMinimum a lot. When it doesn't converge as well as I want, sometimes I want to increase MaxIterations. But the documented default value of MaxIterations is simply "AUTOMATIC". So if I want to increase it, I don't know what to increase it from! I don't know whether AUTOMATIC is a fixed number (that the mysterious W authorities are hiding from me), or whether it is set internally at each execution by FindMinimum. If it fixed, what is it? And if it is set internally, is there a way to have FindMinimum tell me what number it just used in some particular execution, so i can try again with a bigger number?Thanks. If you tell me the answer, I will tell you the Secret of Stradivarius.
4 Replies
Sort By:
Posted 4 months ago
 David,my guess is that one can count the actual number of iterations by using StepMonitor FindMinimum[Exp[x] + 1/x, {x, 1}, StepMonitor :> Print["Step to x = ", x]] (This is the very first example from the documentation on StepMonitor.)And: Now what is the "Secret of Stradivarius"?
Posted 4 months ago
 I suspect it is usually 100 but might be different for some methods if they are considered to be more costly. Usually in similar situations I start raising to 200, 400, etc. Until either I get the impression it won't help (e.g. stalling in the same place), or I get better results.
 To be honest: I cannot see anything frustrating here. My understanding (!) is: When you use FindMinimum and it gives a result without any warning, then in any case the number of iterations was obviously sufficient - and increasing MaxIteration is pointless. If MaxIteration was too small then it throws a warning, displaying the (insufficient) number of iterations used. (Here this is provoked:)But reading Daniels answer I get the suspicion that I might be wrong ...