Nonlinear OLS (Nonlinear Least Squares)
Nonlinear Ordinary Least Squares · Also known as: nonlinear least squares, NLS, NLLS, nonlinear regression
Nonlinear Ordinary Least Squares (NLS) estimates regression models in which the conditional mean function is nonlinear in the parameters. Like standard OLS it minimises the sum of squared residuals, but because no closed-form solution exists the estimator is found by iterative numerical optimisation. Under standard regularity conditions NLS is consistent and asymptotically normal.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use Nonlinear OLS when economic theory or data structure implies a regression function that is intrinsically nonlinear in its parameters — for example an exponential growth curve, a logistic saturation model, a CES production function, or a Box-Cox transformation. NLS is appropriate when the sample is moderately large (the asymptotic theory requires n to be reasonably large relative to the number of parameters) and when the functional form can be specified before estimation. Do not use NLS when the nonlinearity can be linearised by a simple transformation (e.g., taking logs of a Cobb-Douglas function), because OLS on the transformed model is simpler and avoids convergence issues. Also avoid NLS when starting values are completely unknown, when the likelihood surface is highly non-convex, or when the outcome is binary or count-valued (use nonlinear models such as logit or Poisson instead).
Strengths & limitations
- Handles genuinely intrinsic nonlinearity in parameters that cannot be removed by variable transformation.
- Consistent and asymptotically normal under mild regularity conditions, with well-understood inference.
- Allows economic theory to dictate a specific functional form (e.g., CES, logistic growth) rather than imposing an arbitrary linearisation.
- Sandwich (robust) standard errors straightforwardly accommodate heteroscedasticity.
- Widely implemented in R (nls), Stata (nl), Python (scipy.optimize), and EViews.
- No closed-form solution: convergence depends on starting values and the algorithm; local minima are a genuine risk.
- Asymptotic standard errors can be unreliable in small samples; bootstrap inference is preferred when n is small.
- Misspecification of the functional form produces biased and inconsistent estimates with no obvious diagnostic to detect it.
- Computationally more demanding than linear regression, and convergence may fail for complex or flat objective surfaces.
Frequently asked
What is the difference between nonlinear OLS and standard OLS?
Standard OLS requires that the regression function be linear in the parameters, enabling a closed-form solution. Nonlinear OLS (NLS) minimises the same sum-of-squared-residuals criterion but for functions that are nonlinear in the parameters, requiring iterative numerical optimisation. The asymptotic properties (consistency, normality) are similar under regularity conditions.
How do I choose starting values?
Informed starting values dramatically improve convergence. Use parameter estimates from a related linearised model, values from prior literature, or a grid search over a plausible parameter range. Always re-run the optimisation from several different starting points to check that the solution is stable.
When should I use nonlinear WLS instead of NLS?
When residual diagnostics (e.g., a Breusch-Pagan test or a plot of squared residuals against fitted values) suggest heteroscedasticity, nonlinear WLS — which weights observations by the inverse of their error variance — is more efficient than NLS, though both are consistent. Alternatively, use NLS with heteroscedasticity-robust sandwich standard errors.
Can I compare NLS models with AIC or BIC?
Yes. Assuming normally distributed errors, the NLS objective is proportional to the log-likelihood, so AIC = n*log(RSS/n) + 2k and BIC = n*log(RSS/n) + k*log(n) (where k is the number of parameters) can be used to compare models estimated on the same data and outcome.
What if NLS fails to converge?
Try alternative starting values, re-parameterise the model to reduce collinearity among parameters, switch from Gauss-Newton to Levenberg-Marquardt (which is more robust to ill-conditioning), or simplify the functional form. Persistent non-convergence often signals model misspecification.
Sources
- Gallant, A. R. (1987). Nonlinear Statistical Models. John Wiley & Sons. ISBN: 978-0471802600
- Wooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data (2nd ed.). MIT Press. ISBN: 978-0262232586
How to cite this page
ScholarGate. (2026, June 3). Nonlinear Ordinary Least Squares. ScholarGate. https://scholargate.app/en/econometrics/nonlinear-ols
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Generalized Least SquaresStatistics↔ compare
- Maximum Likelihood EstimationStatistics↔ compare
- Nonlinear ARDLEconometrics↔ compare
- Nonlinear GLSEconometrics↔ compare
- OLS RegressionEconometrics↔ compare