gnls
Generalized nonlinear least squares (GNLS) is a statistical modeling framework used to fit nonlinear relationships when the observed errors exhibit non-constant variance or correlation. It extends traditional nonlinear least squares by allowing a specified variance–covariance structure for the residuals, rather than assuming independent, homoscedastic errors. This makes GNLS well suited for data where variance changes with the level of the fitted values or with other covariates, and for data where observations are correlated, such as repeated measures or time series.
In a GNLS model, the mean response is modeled by a nonlinear function of parameters, often written
GNLS is commonly used in fields with complex error patterns, including ecology, pharmacokinetics, and environmental science,