details of fitnlm and statset

1 回表示 (過去 30 日間)
B. Carol
B. Carol 2025 年 7 月 18 日
コメント済み: Walter Roberson 2025 年 7 月 18 日
I have three questions regarding fitnlm
  1. Where is the Jacobian? I set it 'on' in statset and the documentation says it will appear as a "second output" but I don't see where to find it
  2. is there a way to set lower and upper limits to the coefficients in fitnlm? My model will converge better with lower & upper limits.
  3. What is the algorithm used in fitnlm -- Levenberg-Marquardt or Trust-Region?
Code is
modelfun = @(b,X)exp(b(1))./(exp(b(2)./X)-1)./X.^5;
opts = statset('Display','iter','TolFun',1e-10,'RobustWgtFun','bisquare',...
'Tune',4.685,'Display','final','MaxFunEvals',600,'MaxIter',1000,...
'TolX',1e-6,'Jacobian','on','FunValCheck','on');
beta0 = [ 4.2417 5.1846 ];
[mdl] = fitnlm(X,Y,modelfun,beta0,'Options',opts);

採用された回答

Walter Roberson
Walter Roberson 2025 年 7 月 18 日
1) The 'Jacobian' statset() option is not relevant for fitnlm()
2) There is no way to set upper or lower limits.
3) fitnlm() uses the same algorithm as nlinfit(). In turn:
  • For nonrobust estimation, nlinfit uses the Levenberg-Marquardt nonlinear least squares algorithm [1].
  • For robust estimation, nlinfit uses the algorithm of Iteratively Reweighted Least Squares ([2], [3]). At each iteration, the robust weights are recalculated based on each observation’s residual from the previous iteration. These weights downweight outliers, so that their influence on the fit is decreased. Iterations continue until the weights converge.
  2 件のコメント
B. Carol
B. Carol 2025 年 7 月 18 日
Thank you. So if I choose 'RobustWgtFun','bisquare' then this is a robust estimation? I will study the second comment below about exploring other functions.
Walter Roberson
Walter Roberson 2025 年 7 月 18 日
I think in that case it would indeed be a robust estimation.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by