Levenberg-Marquardt not an option for LSQNONLIN

22 ビュー (過去 30 日間)
yuese zheng
yuese zheng 2015 年 5 月 18 日
編集済み: Stefanie Schwarz 2023 年 10 月 6 日
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
  1 件のコメント
yuese zheng
yuese zheng 2015 年 5 月 19 日
great thank you!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by