Parameter estimation nlinfit vs. fitnlm

Hi
I want to fit a nonlinear model using nonlinear regression function nlinfit or fitnlm.Is there a difference? which one is more robust for a difficult kinetic model?
It seems both use Levenberg-Marquardt algorithm ?
Thank You,

 Akzeptierte Antwort

Star Strider
Star Strider am 26 Mai 2014

1 Stimme

There is no real difference. Both nlinfit and fitnlm are Statistics Toolbox functions for nonlinear regression, and so use the same fundamental functions. The fitnlm function is a shell around nlinfit and its friends. The advantage to fitnlm is that it’s slightly easier to use, and delivers a few more statistics. The important results — parameter confidence intervals and confidence intervals on the fitted equation — are easy to get with either, but actually slightly easier with nlinfit, nlparci and nlpredci.
Experiment with both, and see which is most appropriate to your application.
Don’t neglect lsqcurvefit if you have access to it (Optimization Toolbox). It can do two things that the Statistics Toolbox functions cannot: (1) accept bounds on the parameters, and (2) fit matrix dependent variables. It doesn’t have access to all the statistics the Statistics Toolbox functions do, but it definitely has its uses.

7 Kommentare

Nath
Nath am 26 Mai 2014
Thank you! So based on what you said lsqnonlin or lsqcurvefit seem to be more suitable for me but one more question here: if my objective model is in the form :
(X(measured)-X(predicted)^2 and the parameters that I want to estimate is not explicitly shown in X(predicted), but shown in another function that evaluates the X(predicted); would this be an acceptable input for lsqnonlin or lsqcurvfit?
Star Strider
Star Strider am 26 Mai 2014
My pleasure!
All the nonlinear solvers ( nlinfit, lsqcurvefit ) incorporate the objective function, so you only need to provide them with your model function, independent and dependent variable data, and whatever other options you may find necessary. Read up on the various options functions and structures for the various solvers. The options structures allow you to vary tolerances, number of function evaluations, iterations, and other characteristics.
Maria Sole  Ieraci
Maria Sole Ieraci am 22 Sep. 2017
So, is there no way to put lower and upper bound with fitnlm? I need to use this function, instead lsqnonlin, because I have more statistics. How could I add my bounds? Thank you
Star Strider
Star Strider am 22 Sep. 2017
The Statistics and Machine Learning Toolbox function fitnlm does not permit parameter constraints (at least in R2017b and prior versions). You must use the Optimization Toolbox lsqcurvefit function (or similar functions) for bounded parameters. Parameter confidence intervals, and other such statistics on models with bounded parameters, are likely not reliable. I am not certain it is even possible to calculate them.
Maria Sole  Ieraci
Maria Sole Ieraci am 25 Sep. 2017
Oh, ok. Thank you!
Star Strider
Star Strider am 25 Sep. 2017
My pleasure!
Ho Nam Ernest Yim
Ho Nam Ernest Yim am 3 Apr. 2018
Bearbeitet: Ho Nam Ernest Yim am 3 Apr. 2018
Hi, can I know other than lsqcurvefit (same as lsqnonlin ?) and nlinfit. Are there any other suggestions on fitting a nonlinear data ? Mainly, I would like to compare how well different methods could do. Many Thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by