Why does FindMaximum with Newton's method complain it can't find a sufficient decrease in function?

痴心易碎 提交于 2019-12-08 21:00:31

Mathematically, I'm not sure exactly why Netwon's method fails, but the examples in the documentation for FindMaximum point out this specific problem and error message under Possible Issues: "With machine-precision arithmetic, even functions with smooth maxima may seem bumpy".

Thus, if you increase the working precision with e.g. the WorkingPrecision -> 20 option to FindMaximum the warnings go away:

In[25]:= FindMaximum[o, {{j, 0}, {h, 0}}, Method->"Newton", WorkingPrecision->20]

Out[25]= {-2.0694248079871222533, {j -> -0.14189560954670761863, h -> 0}}

Given that the text of the error is fairly descriptive:

FindMaximum::lstol: The line search decreased the step size to within the tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient increase in the function. You may need more than MachinePrecision digits of working precision to meet these tolerances. >>

... I suspect Newton's method is failing to reached a fixed point with sufficiently small error using machine-precision arithmetic.

As the error message hints, you can instead use the AccuracyGoal option to specify the number of significant digits you want in the solution if you don't want to switch to slower high-precision arithmetic:

In[27]:= FindMaximum[o, {{j, 0}, {h, 0}}, Method -> "Newton", AccuracyGoal -> 5]

Out[27]= {-2.06942, {j -> -0.141896, h -> -2.78113*10^-17}}

Hope that helps!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!