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 CenterFile Exchange에서 Get 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