Fitting a nonlinear model: Which is the best function?

25 ビュー (過去 30 日間)
Ralph
Ralph 2014 年 5 月 22 日
コメント済み: HIGASHI mitsuya 2020 年 9 月 14 日
I have to fit more than a thousand vectors of data to biexponential curves, one curve fitting per vector. I was using de function "fit" to this purpose, but it was taking too long. I have tried to look for different ways to do the curve fitting and I have found some useful functions, and I would like to know which are the differences between them, because all of them seem similar to me. Which function is faster? The functions are:
fitnlm
nlinfit
lsqnonlin
lsqcurvefit
Thanks in advance

採用された回答

Star Strider
Star Strider 2014 年 5 月 22 日
The choice is between nlinfit and lsqcurvefit, depending on what you want to do. The Statistics Toolbox nlinfit provides myriad statistics if you want them, but will only fit vector dependent variables. The Optimization Toolbox lsqcurvefit can fit matrix dependent variables, but doesn’t have all the statistics options. (Both can take matrix independent variables, but that requires you deceive the fitting function into believing it has a vector independent variable in your objective function programming. That’s not difficult. The fitting functions are credulous.)
So, if you’re fitting vector dependent variables, go for nlinfit. If you’re fitting matrix dependent variables, go for lsqcurvefit.
My opinion. Others may differ.
  1 件のコメント
HIGASHI mitsuya
HIGASHI mitsuya 2020 年 9 月 14 日
Hello Star Strider,
I have a question about The Statistics Toolbox fitnlm.
Can fitnlm fit matrix dependent variables ?
I will be really thankgul if you give some information.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by