Nonlinear regression
Intermediate
What you need first. Nothing else on this path comes first. This page is part of Statistical inference.
In regression, a nonlinear regression is a least-squares fit of a mean that is not linear in its unknown coefficients. A response sometimes bends, levels off, or decays in a way no straight line, and no polynomial in the predictors with fixed powers, can represent by coefficients that enter the mean only through sums and products. The curve is then nonlinear in the unknown coefficients, and the fit that minimises the sum of squared vertical gaps is nonlinear least squares. A mean is a nonlinear regression when it is not linear in the parameters. The same squared-error criterion is used as in a linear fit. What changes is that the minimiser is found by iteration.[1][2]
Nonlinear regression
| Fact | Value |
|---|---|
| Topic | Statistical inference |
| Listed on | Statistical inference |
| Worked example | 1 |
Motivating example
Concrete gains strength quickly at first and then approaches a ceiling as it cures. A straight line in time has no horizontal asymptote, so it keeps rising or falling at the extremes of the time axis. A mean such as can rise fast and then flatten, because the rate sits inside the exponential. The three coefficients cannot be recovered by the closed-form slope formula for a straight line. They are chosen by searching for the values that make the squared gaps between measured strength and the curve as small as possible. The way the parameters are estimated is conceptually the same least-squares idea as in a linear model. The search is what the nonlinearity forces.[2]
Definition
Observations are modelled as
where is a known function that is not linear in the coefficient vector . Nonlinear least squares chooses to minimise
The same criterion defines the procedure: a regression is called nonlinear when the mean is not linear in the coefficients, and the coefficients are estimated by least squares. Smoothness of and a unique minimum make the search practical, but they are not required for the definition.[2][1]
Setting the derivatives of to zero produces one equation for each coefficient,
Those normal equations are themselves nonlinear when is nonlinear in , so they need not have a solution, or they may have more than one. They are solved by iteration. Gauss–Newton linearises in the coefficients at the current guess, by a Taylor expansion, and solves the resulting linear least-squares step. Levenberg–Marquardt mixes that step with a move that only shrinks .[1]
A function that is nonlinear in can still be linear in . The mean is a polynomial curve and is estimated by ordinary linear least squares, because each term is a coefficient times a known function of . In that statistical sense the model is linear in the parameters even though the graph is curved. The mean is not. A function that is not linear in the parameters can sometimes be rewritten, by a transformation of the response, as a function that is. When no such transformation exists, the fit stays in the nonlinear iteration.[3][1]
Properties
The fitted coefficients minimise squared vertical error for the function that was written down. They are not, in general, available from a matrix formula. A second start can finish at a different value of when the surface has more than one dip. When a minimum has been reached, intervals for the coefficients and for the mean are available from the same linearisation used in the last step, and those intervals are approximate. The probabilistic reading of the interval is only approximately correct, and the approximation is still the interval that is used in practice.[2]
Small samples can still identify a nonlinear mean when the curve is a good description of the process, because the criterion uses every observation. One or two wild responses can move the curve a long way, for the same reason they move a least-squares line: the criterion squares their gaps. Nonlinear fits have fewer routine diagnostics for that movement than linear fits do.[2]
Worked example
Three measurements follow a decay: , , . The mean is nonlinear in . At the start the fitted values are , and , and
A numerical minimiser moves to , . The fitted values are , and , and
Shifting only the rate back to , with the scale held at , raises to . Shifting only the scale to , with the rate held at , raises to . This pair is a local improvement on those two neighbours. It is the minimiser along the profile that, for each rate, chooses the best scale: the profiled minimum is at rate and scale , and rounding to four decimals does not change at the reported precision.
The straight line fitted to the same three points has mean equal to , mean equal to , and , so the slope is and the intercept is . The fitted values are , and , and the residual sum of squares is . The exponential uses the same squared-error criterion and cuts that sum from to , because the drops from to to slow down rather than stay constant.[2][3]
Your turn. The curve is required to pass through and . Find , , and the residual sum of squares.
The point at forces . Then , so . Both residuals are zero, and the residual sum of squares is .
Assumptions and limits
The procedure assumes that the function was chosen before looking at the size of , that the gaps are the right scale on which to measure miss, and that a start near the minimiser is available. A bad start can stop at a local minimum, or the iteration can fail to move. Outliers pull the fit because they are squared. Approximate intervals inherit the usual least-squares story of comparable, weakly dependent errors, and they remain approximations even then. A process that truly levels off is a reason to leave the straight line. The formula still returns a number outside the times that were measured, and that number is an extrapolation of the fitted function, not a new observation.[2][1]
Taking logarithms and then using ordinary least squares minimises squared error on the log scale. The minimiser of on the original scale is the nonlinear least-squares fit. The two answers agree only when the logged model happens to match the criterion that was declared. A curve on the scatterplot is not, by itself, a nonlinear regression. Polynomial least squares draws a curve and still uses the linear normal equations.[3][1]
Check yourself
Try these questions before opening an answer.
A curved linear model
Why is a quadratic polynomial in the predictor still fit by linear least squares?
Each power of the predictor is a known column, and the unknown coefficients stand in front of those columns. Linearity is judged in the coefficients, not in the shape of the graph.
Two starts
Why can two different starting values finish at different fitted curves?
The sum of squared errors need not have a single minimum when the mean is nonlinear in the coefficients, so the iteration can stop in different dips.
History
The early published uses of a regression mean that is nonlinear in its coefficients date from the 1920s, including work by Fisher and Mackenzie on the manurial response of potato varieties. Routine fitting waited on automatic calculation in the 1970s, because each fit is an iterative minimisation of rather than one pass through the normal equations. The steps in common use linearise the mean at the current coefficients, in the manner of Gauss–Newton, or combine that linearisation with a damper, as in Levenberg–Marquardt. The least-squares criterion itself is older: Gauss, Legendre, and possibly Adrain developed it around the turn of the nineteenth century for problems that were linear in the parameters. Nonlinear regression is that criterion applied where the parameters sit inside the function.[1][3]
See also
Line chart · Apriori algorithm · Asymptotic analysis · Average treatment effect · Base rate · Bayesian inference · Bayesian model · Bayesian probability
References
- ^ a b c d e f g a. (p. 372, Nonlinear regression) b. (pp. 372–373, Mathematical aspects) c. (p. 373, Mathematical aspects) d. (p. 373, Domains and limitations) e. (p. 373, Domains and limitations) f. (p. 372, Nonlinear regression) g. (pp. 372–373, History and Mathematical aspects) Dodge, Yadolah (2008). The Concise Encyclopedia of Statistics. Springer. https://doi.org/10.1007/978-0-387-32833-1
- ^ a b c d e f g a. (§4.1.4.2, Definition of a nonlinear regression model) b. (§4.1.4.2, Examples of nonlinear models) c. (§4.1.4.2, Definition of a nonlinear regression model) d. (§4.1.4.2, Advantages of nonlinear least squares) e. (§4.1.4.2, Disadvantages of nonlinear least squares) f. (§4.1.4.2, least squares for a nonlinear mean) g. (§4.1.4.2, starting values, outliers, and approximate intervals) NIST/SEMATECH (2002). NIST/SEMATECH e-Handbook of Statistical Methods, §4.1.4.2: Nonlinear Least Squares Regression. National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd142.htm
- ^ a b c d a. (§4.1.4.1, Definition of a linear least squares model) b. (§4.1.4.1, the straight line as the statistically linear case) c. (§4.1.4.1, linear in the parameters) d. (§4.1.4.1, Why least squares) NIST/SEMATECH (2002). NIST/SEMATECH e-Handbook of Statistical Methods, §4.1.4.1: Linear Least Squares Regression. National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/pmd/section1/pmd141.htm
Cite this page
StatWiki (2026). "Nonlinear regression." StatWiki. Last updated 2 December 2026. https://www.statwiki.io/articles/nonlinear-regression.html
@misc{statwiki_nonlinear_regression,
author = {{StatWiki}},
title = {{Nonlinear regression}},
year = {2026},
url = {https://www.statwiki.io/articles/nonlinear-regression.html},
urldate = {2026-12-02},
note = {StatWiki, last updated 2 December 2026}
}