MATLAB’s Fitnlm Function

MATLAB’s Fitnlm is a nifty function that makes nonlinear curve fitting easy. It provides the most readable statistics about your nonlinear model of choice. For instance, Fitnlm makes the best guesses about coefficients and model parameters. Fitnlm is not limited to nonlinear regression models, though. It also provides the most readable statistics about linear regression models, including confidence intervals. Fitnlm is a small part of the Optimization Toolbox. It is not included in the default installation of MATLAB. You can install fitnlm manually, but it will take a lot of mucking about.

MATLAB’s fitnlm function is a shell around the nlinfit function. It is more readable, and gives the nlinfit function a run for its money. As a result, fitnlm gives more readable statistics about your nonlinear model than the nlinfit function, making nonlinear curve fitting a breeze. It is also easier to use, allowing you to do more with your time. For instance, fitnlm has the audacity of showing you exactly how many nonlinear models are fit, and exactly how many nonlinear models are fit by each method, making it a great tool for data scientists.

Fitnlm has one minor flaw. Although it’s most readable statistic is the most readable statistic, it is not the best statistic. The best statistic is the one about the most accurate prediction of model coefficients. This is a small problem, but it is something that will affect the quality of your models. It is best to use fitnlm only after all other methods have been exhausted. It also has one minor drawback, which is that it is not as fast as the nlinfit function. It also doesn’t have the same name-reference as the nlinfit function. For instance, fitnlm takes about a minute to calculate the estimated coefficients of your nonlinear model, whereas the nlinfit function takes about 30 seconds.