Fitting a nonlinear model: Which is the best function?

25 Ansichten (letzte 30 Tage)
Ralph
Ralph am 22 Mai 2014
Kommentiert: HIGASHI mitsuya am 14 Sep. 2020
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

Akzeptierte Antwort

Star Strider
Star Strider am 22 Mai 2014
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 Kommentar
HIGASHI mitsuya
HIGASHI mitsuya am 14 Sep. 2020
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by