Linear least squares (LLS) is the least squares approximation of linear functions to data. It is a set of formulations for solving statistical problems involved in linear regression, including variants for ordinary (unweighted), weighted, and generalized (correlated) residuals. Numerical methods for linear least squares include inverting the matrix of the normal equations and orthogonal decomposition methods.
Basic formulation Consider the linear equation
where A∈ℝm×n and b∈ℝm are given and x∈ℝn is a variable to be computed. When m>n, it is generally the case that (1) has no solution. For example, there is no value of x that satisfies [100111]x=[110], because the first two rows require that x=(1,1), but then the third row is not satisfied. Thus, for m>n, the goal of solving (1) exactly is typically replaced by finding the value of x that minimizes some error. There are many ways that the error can be defined, but one of the most common is to define it as ‖Ax−b‖2. This produces a minimization problem, called a least squares problem
The solution to the least squares problem (1) is computed by solving the normal equation
where A⊤ denotes the transpose of A. Continuing the example, above, with A=[100111]andb=[110], we find A⊤A=[101011][100111]=[2112] and A⊤b=[101011][110]=[11]. Solving the normal equation gives x=(1/3,1/3).
Formulations The three main linear least squares formulations are:
Ordinary least squares (OLS) is the most common estimator. OLS estimates are commonly used to analyze both experimental and observational data. The OLS method minimizes the sum of squared residuals, and leads to a closed-form expression for the estimated value of the unknown parameter vector β: 𝜷̂=(𝐗𝖳𝐗)−1𝐗𝖳𝐲, where 𝐲 is a vector whose ith element is the ith observation of the dependent variable, and 𝐗 is the Design matrix whose ij element is the ith observation of the jth independent variable. The estimator is unbiased and consistent if the errors have finite variance and are uncorrelated with the regressors: E[𝐱iεi]=0, where 𝐱i is the transpose of row i of the matrix 𝐗. It is also efficient under the assumption that the errors have finite variance and are homoscedastic, meaning that E[εi2|xi] does not depend on i. The condition that the errors are uncorrelated with the regressors will generally be satisfied in an experiment, but in the case of observational data, it is difficult to exclude the possibility of an omitted covariate z that is related to both the observed covariates and the response variable. The existence of such a covariate will generally lead to a correlation between the regressors and the response variable, and hence to an inconsistent estimator of β. The condition of homoscedasticity can fail with either experimental or observational data. If the goal is either inference or predictive modeling, the performance of OLS estimates can be poor if multicollinearity is present, unless the sample size is large. Weighted least squares (WLS) are used when heteroscedasticity is present in the error terms of the model. Generalized least squares (GLS) is an extension of the OLS method, that allows efficient estimation of β when either heteroscedasticity, or correlations, or both are present among the error terms of the model, as long as the form of heteroscedasticity and correlation is known independently of the data. To handle heteroscedasticity when the error terms are uncorrelated with each other, GLS minimizes a weighted analogue to the sum of squared residuals from OLS regression, where the weight for the ith case is inversely proportional to var(εi). This special case of GLS is called "weighted least squares". The GLS solution to an estimation problem is 𝜷̂=(𝐗𝖳𝜴−1𝐗)−1𝐗𝖳𝜴−1𝐲, where Ω is the covariance matrix of the errors. GLS can be viewed as applying a linear transformation to the data so that the assumptions of OLS are met for the transformed data. For GLS to be applied, the covariance structure of the errors must be known up to a multiplicative constant.
Alternative formulations Other formulations include:
… excerpt ends here. Continue reading the full article.


