We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
NonlinearModelFit[{{x1,y1},{x2,y2},…},form,{β1,…},x]
constructs a nonlinear model with formula form that fits the yi for each xi using the free parameters βi.
NonlinearModelFit[data,form,params,{x1,…}]
constructs a nonlinear model where form depends on the variables xk.
NonlinearModelFit[data,{form,cons},params,{x1,…}]
constructs a nonlinear model subject to the parameter constraints cons.
Details and OptionsFit a nonlinear model to some data:
Evaluate the model at a point:
Visualize the fitted function with the data:
Extract and plot the residuals:
Scope (15) Data (7)Fit a model of one variable, assuming increasing integer-independent values:
Fit a model of more than one variable:
Fit a rule of input values and responses:
Specify a column as the response:
Give starting values when parameters are far from the default value 1:
With the default starting values, the model is effectively 0:
Obtain a list of available properties for a nonlinear model:
Properties (8) Data & Fitted Functions (1)Obtain the fitted function as a pure function:
Residuals (1)Visualize scaled residuals in stem plots:
Plot the absolute differences between the standardized and Studentized residuals:
Sums of Squares (1)Fit a nonlinear model to some data:
Extract the estimated error variance:
Obtain the analysis of variance table:
Get the sums of squares column from the table:
Parameter Estimation Diagnostics (1)Obtain a formatted table of parameter information:
Extract the column of -statistic values:
Curvature Diagnostics (1)Fit a nonlinear model to some data:
Obtain a table of curvature measures for the fitted model:
Extract the list of numeric values from the table:
Extract the max parameter effects curvature value:
Influence Measures (1)Fit some data containing extreme values to a nonlinear model:
Use single deletion variances to check the impact on the error variance of removing each point:
Check the diagonal elements of the hat matrix to assess influence of points on the fitting:
Prediction Values (1)Plot the predicted values against the observed values:
Obtain tabular results for mean- and single-prediction confidence intervals:
Get the single-prediction intervals from the table:
Extract 99% mean prediction bands:
Goodness-of-Fit Measures (1)Obtain a table of goodness-of-fit measures for a nonlinear model:
Generalizations & Extensions (2)Fit data to a model defined by a numerical operation:
Use ParametricNDSolveValue to make the computation much faster by caching solutions of the differential equation:
Perform other mathematical operations on the functional form of the model:
Integrate symbolically and numerically:
Find a predictor value that gives a particular value for the model:
Options (10) ConfidenceLevel (1)The default gives 95% confidence intervals:
Set the level to 90% within FittedModel:
Method (3)Use the default method for minimizing the least-squares objective function:
Use Newton's method for optimization:
Configure the step control method for Newton's algorithm:
Use the interior point method with constraints:
Perform a more exhaustive search with the global optimization methods from NMinimize:
Use the submethod "RandomSearch":
Specify the number of initial search points for the "RandomSearch" algorithm:
VarianceEstimatorFunction (1)Use the default unbiased estimate of error variance:
Assume a known error variance:
Estimate the variance by the mean squared error:
Weights (4)Fit a model using equal weights:
Give explicit weights for the data points:
Use Around values to give different weights to data points:
Find the weights that were used to account for the uncertainty in the data:
Use Around values in both the independent values and responses:
In some cases, the root finding algorithm that handles uncertainty in the independent variates does not converge using the standard option settings:
Use the FixedPoint algorithm with a low DampingFactor and high MaxIterations to reach convergence:
WorkingPrecision (1)Use WorkingPrecision to get higher precision in parameter estimates:
Reduce the precision in property computations after the fitting:
Applications (1)Fit a nonlinear model to the data:
Obtain and visualize 90% confidence bands for the fit:
Obtain 95%, 99%, and 99.9% confidence bands:
Visualize the confidence bands for the various levels:
Properties & Relations (5) Possible Issues (3)Distributional assumptions are based upon an unconstrained model:
Here the confidence interval for contains points that violate the constraint:
The coefficient of determination in NonlinearModelFit is calculated with uncorrected data:
The coefficient of determination:
Direct calculation using residuals and data:
Sometimes is defined using centralized data:
Fit data that spans over multiple orders of magnitude:
An exponential fit might appear correct at first glance:
But shows significant deviations on a log scale:
This can be addressed by using weights inversely proportional to the variance:
Wolfram Research (2008), NonlinearModelFit, Wolfram Language function, https://reference.wolfram.com/language/ref/NonlinearModelFit.html (updated 2025). TextWolfram Research (2008), NonlinearModelFit, Wolfram Language function, https://reference.wolfram.com/language/ref/NonlinearModelFit.html (updated 2025).
CMSWolfram Language. 2008. "NonlinearModelFit." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/NonlinearModelFit.html.
APAWolfram Language. (2008). NonlinearModelFit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NonlinearModelFit.html
BibTeX@misc{reference.wolfram_2025_nonlinearmodelfit, author="Wolfram Research", title="{NonlinearModelFit}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/NonlinearModelFit.html}", note=[Accessed: 12-July-2025 ]}
BibLaTeX@online{reference.wolfram_2025_nonlinearmodelfit, organization={Wolfram Research}, title={NonlinearModelFit}, year={2025}, url={https://reference.wolfram.com/language/ref/NonlinearModelFit.html}, note=[Accessed: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4