Fitting a nonlinear model: Which is the best function?

25 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Star Strider
Star Strider il 22 Mag 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 Commento
HIGASHI mitsuya
HIGASHI mitsuya il 14 Set 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by