Levenberg-Marquardt not an option for LSQNONLIN

6 次查看(过去 30 天)
hi, I am trying to find the optimum parameters to fit a data to another.Since I have many input parameters, and when using the trust-region-reflective (default) algorithm in LSQNONLIN, the warning told me to use Levenberg-Marquardt because there must be as many equations as variables. When I am setting up the "options", my code is
%%%% options=optimoptions('lsqnonlin','Levenberg-Marquardt',.005);
and the error message is that "Levenberg-Marquardt" is not an option for LSQNONLIN. Then I tried
%%%options={'levenberg-marquardt',1e-2,'Jacobian'};
there was no error message, but there was a warning
"Warning: Struct field assignment overwrites a value with class "cell". See MATLAB R14SP2 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning, for details.".
And it used trust-region-reflective algorithm again. The output of lsqnonlin didn't give me a global min, it stopped after several iterations as the step size is less than the tolerance. I don't think it used the levenberg-marquardt. What was wrong? Thank you!

采纳的回答

Alan Weiss
Alan Weiss 2015-5-18
What you should do depends on your MATLAB version. For R2014b or later, use the InitDamping option to pass Levenberg-Marquardt parameters. As the R2014b Release Notes describe, you set:
options = optimoptions(@lsqnonlin,'Algorithm','levenberg-marquardt','InitDamping',0.1);
But for earlier releases, use optimset instead of optimoptions:
options = optimset('Algorithm',{'levenberg-marquardt',0.1});
This works for R2008b and later.
Alan Weiss
MATLAB mathematical toolbox documentation

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by