- Introduced by
- Extension of Gauss-Newton nonlinear least squares with Aitken-type weighting
- Year
- 1960s–1980s (formalized in applied econometrics)
- Type
- Nonlinear regression estimator
- Family
- Econometrics / time series
What does it do?
Nonlinear Weighted Least Squares (NWLS) fits a user-specified nonlinear mean function by minimising a weighted sum of squared residuals, where each observation's weight reflects its assumed precision.
It is used when the relationship between response and predictors is nonlinear and the error variance differs across observations. The weights are assumed to be known or estimated from a variance model, and the nonlinear mean function is taken to be correctly specified.
The intuition behind the method
In ordinary nonlinear regression, every observation pulls the fitted curve with equal force. When some observations are measured more precisely than others, or when the error spread grows with the predicted value, this equal weighting wastes information from precise points and gives noisy points too much influence. NWLS gives observations with smaller error variance larger weights, so the fitted curve is pulled more strongly toward the more reliable data. Standard errors are then computed from the weighted fit, which is only as accurate as the assumed weight structure.
History
NWLS sits within the broader development of applied nonlinear regression and the weighted least-squares framework. Bates and Watts (1988) give a book-length treatment of nonlinear regression analysis and its applications. Greene (2018) covers weighted and generalised least squares within its econometric framework.
When to use it
Choose NWLS when the mean function is genuinely nonlinear in its parameters (for example exponential decay, Michaelis-Menten saturation, or logistic dose-response) and there is a substantive reason to expect the error variance to vary across observations, such as variance proportional to the mean or to a covariate. It suits cross-sectional or pooled data with a known nonlinear form, as in pharmacokinetics, dose-response studies, and production-function estimation. Do not use NWLS when the mean function is linear in its parameters, where OLS or WLS is simpler and avoids iterative fitting. Be cautious when the variance structure cannot be plausibly specified: point estimates remain consistent if the mean function is correct, but efficiency is no longer guaranteed and model-based standard errors become unreliable, so heteroscedasticity-robust (sandwich) standard errors are a safer route to valid inference. Also be cautious with very small samples, where both the iterative fit and the estimated weights are unreliable. The method rests on four assumptions: (1) the nonlinear mean function f(x_i, β) is correctly specified, so that E[y_i | x_i] = f(x_i, β); (2) errors are uncorrelated across observations, with Var(ε_i) = σ²/w_i; (3) the weights are known or are estimated from a variance model; (4) the parameters are identified and the iterative optimiser converges to the minimum of S(β) that is the intended estimate.
Limitations and considerations
- Requires two modelling decisions, a nonlinear mean function and a weight (variance) function, so misspecification can arise from either.
- Iterative Gauss-Newton optimisation can converge to a local minimum or fail to converge; the result depends on starting values and on model identifiability.
- The efficiency gain over unweighted NLS depends on how well the weights capture the true variance pattern; poor weights can make results less precise than unweighted fitting.
- Standard errors rely on large-sample approximations and may be unreliable in small samples.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Fits nonlinear mean functions directly, so the response does not need to be transformed, which avoids distorting the error structure a transformation may introduce.
- When the assumed weight structure is close to the true variance pattern, weighting gives more precise estimates than unweighted nonlinear least squares.
- Lets the analyst encode prior knowledge about the variance function, such as a proportional error model in assay data.
- Point estimates remain consistent when the mean function is correctly specified, even if the weight function is misspecified; the weights mainly determine efficiency.
- Available in standard nonlinear regression software with a weights argument; the exact syntax varies by package and should be checked before use.
Applications
- Pharmacokinetic and dose-response modelling where drug concentration follows an exponential decay and measurement error grows with concentration.
- Agricultural yield-fertiliser relationships described by Michaelis-Menten or other saturation curves with variance proportional to the mean.
- Economic production functions (e.g. CES or translog) with heteroscedastic cross-sectional data.
- Environmental exposure-response models where variance scales with predicted exposure level.
- Epidemiological nonlinear risk models estimated on grouped data with group-size-based weights.
- Calibration curve fitting in analytical chemistry where replicate variance is proportional to signal intensity.
How it works
How it works
The response y_i is modelled as a nonlinear function f(x_i, β) plus an error whose variance is inversely proportional to a known or estimated weight w_i. This allows the model to capture a curved mean relationship and unequal precision across observations at the same time.
Formula
y_i = f(x_i, \beta) + \varepsilon_i, \quad \mathrm{Var}(\varepsilon_i) = \sigma^2 / w_iThe weights are collected into a diagonal matrix W. Common choices are 1/variance_i when the variances are known; 1/x_i² when the error standard deviation is proportional to x_i (so the variance is proportional to x_i²); 1/x_i when the variance itself is proportional to x_i; or 1/f(x_i, β̂)² when the error standard deviation is taken to be proportional to the fitted mean, with the variance model estimated from a pilot unweighted NLS fit.
Formula
W = \mathrm{diag}(w_1, w_2, \ldots, w_n)NWLS minimises the weighted residual sum of squares S(β), so observations with larger w_i have more influence on the estimates than observations with smaller w_i.
Formula
S(\beta) = \sum_{i=1}^{n} w_i \left[ y_i - f(x_i, \beta) \right]^2Because f is nonlinear in β, there is no closed-form solution. The Gauss-Newton algorithm iterates: at each step it linearises f around the current estimate using the Jacobian J, then takes a weighted least-squares step toward the minimum. Convergence depends on the starting values and on how well the model is identified.
Formula
\hat{\beta}^{(k+1)} = \hat{\beta}^{(k)} + (J^\top W J)^{-1} J^\top W r^{(k)}After convergence, the covariance matrix of β̂ is approximated from the final Jacobian and weight matrix, with σ̂² estimated from the weighted residuals. Standard errors, t-statistics, and Wald confidence intervals are then approximate and rely on large-sample theory.
Formula
\mathrm{Var}(\hat{\beta}) \approx \hat{\sigma}^2 (J^\top W J)^{-1}Common pitfalls
- Using ad-hoc weights, such as 1/y_i, without checking them against the observed residual pattern; misspecified weights can reduce efficiency.
- Ignoring convergence warnings; Gauss-Newton steps can oscillate when starting values are poor or the model has too many parameters for the data.
- Treating asymptotic confidence intervals as exact in small samples.
- Forgetting to check the weighted residuals for remaining heteroscedasticity or systematic patterns after fitting.
- When weights are estimated from a first-stage fit, reporting standard errors that ignore the first-stage uncertainty, which tends to understate the true variability.
- Confusing NWLS with nonlinear GLS; NWLS assumes a diagonal weight matrix, while correlated errors require a full GLS approach.
Frequently asked questions
How is NWLS different from nonlinear GLS?
NWLS assumes errors are uncorrelated but have unequal variances, captured by a diagonal weight matrix. Nonlinear GLS also allows off-diagonal covariance, such as autocorrelated errors in time series, and therefore requires an explicit structure for the full error covariance matrix.
What if I do not know the true weights?
A common two-step approach is to fit an unweighted NLS model first, regress the squared residuals on candidate variance predictors to estimate a variance function, and refit using reciprocals of the fitted variances as weights. The standard errors from the second stage treat the estimated weights as known, so they do not fully reflect the uncertainty introduced by estimating them.
How do I choose starting values?
Good starting values matter because the optimiser can fail or stop at a poor solution. Use subject knowledge, such as rough values for the plateau and half-saturation constant in a Michaelis-Menten model, or search over plausible parameter ranges. A linearising transformation can also provide OLS-based initial guesses before the NWLS fit.
Can NWLS be used with panel data?
Yes, if the nonlinear mean function applies within each cross-sectional unit and you can specify weights capturing the error variance at the unit or observation level. When the data show both heteroscedasticity and serial correlation, a nonlinear feasible GLS approach that models both features is more appropriate.
Is NWLS the same as iteratively reweighted least squares (IRLS)?
No. IRLS is a general fitting algorithm, widely used for generalised linear models, in which each iteration solves a weighted least-squares problem with weights updated from the current fit. Each Gauss-Newton step in NWLS is also a weighted least-squares step, so the two share computational structure. However, NWLS uses weights defined by a variance model around a nonlinear mean function, rather than weights derived from a GLM likelihood.
Related methods
Sources
Greene, W. H. (2018). Econometric Analysis (8th ed.). Pearson Education.
ISBN: 978-0134461366Bates, D. M., & Watts, D. G. (1988). Nonlinear Regression Analysis and Its Applications. John Wiley & Sons.
ISBN: 978-0471816430