How is fmincon different from non linear solvers if the objective function for fmincon is written such that it return sum of square of error?
23 次查看(过去 30 天)
显示 更早的评论
Hi
Please help me understand this.. I am not able to find a simple explanation.
If I write the objective function for fmincon to return sum of square of error, which is the same what solvers like lsqnonlin and lsqcurvefit tries to solve, then what is the difference between these algorithms? Which algorithm is more efficient? Or are they all inherently the same?
Thanks for the help Nadia
0 个评论
采纳的回答
Matt J
2016-11-24
编辑:Matt J
2016-11-24
You can find detailed algorithm descriptions for fmincon here and compare them to algorithm descriptions for lsqnonlin here. There are substantial differences in the selection of minimization algorithms available and how they work. FMINCON, for example, doesn't support an option to use Levenberg-Marquardt, unlike lsqnonlin. Mathworks also has a page with its recommendations for algorithm selection
The simplest answer is that fmincon uses fancier algorithms than lsqnonlin and lsqcurvefit because fmincon must be able to deal with nonlinear constraints, whereas lsqnonlin/lsqcurvefit do not. Therefore, if you apply fmincon to a simple bounded least squares problem with no nonlinear constraints, it may invest more computation than you really need.
This is not a perfect rule, however. lsqnonlin algorithms all use first derivative information only, whereas some fmincon algorithms let you use second derivatives as well. This can be a benefit to convergence speed, though how significant will depend case-by-case on your problem.
The bottom line is that completely optimal algorithm selection requires experimentation...
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!