Ordinary least squares
Ordinary least squares (OLS) is a method for estimating the parameters of a linear regression model by minimizing the sum of the squared differences between observed and fitted values.
For a simple linear regression model:
the fitted value is:
and the residual is:
The OLS estimator chooses the coefficients that minimize the sum of squared residuals:
Objective function
The OLS objective function is commonly called the residual sum of squares (RSS) or sum of squared errors (SSE):
The estimated coefficients are therefore:
The use of squared residuals prevents positive and negative residuals from cancelling each other and places greater weight on larger deviations.
Simple linear regression
For simple linear regression, the OLS estimate of the slope coefficient is:
The intercept is:
where:
- = sample mean of the explanatory variable;
- = sample mean of the dependent variable.
The fitted regression equation is therefore:
Geometric interpretation
OLS selects the line that minimizes the squared vertical distance between the observed data points and their fitted values.
The residual for each observation is:
and the objective is:
This produces the line of best fit under the least-squares criterion.
Multiple linear regression
OLS can be extended to models containing multiple explanatory variables:
The fitted model is:
OLS estimates the coefficients by minimizing:
where is the vector of regression coefficients.
Matrix formulation
The multiple regression model can be written in matrix form as:
The OLS estimator is:
provided that is invertible.
The fitted values are:
and the residual vector is:
Normal equations
The OLS estimates satisfy the normal equations:
Equivalently:
These equations arise from setting the derivatives of the sum of squared residuals with respect to the regression coefficients equal to zero.
OLS in finance
OLS is widely used in financial analysis to estimate relationships between asset returns and market or factor returns.
A simplified market model is:
where:
- = return of asset ;
- = regression intercept;
- = sensitivity of the asset to market returns;
- = market return;
- = residual return.
OLS can be used to estimate:
The estimated beta is:
Factor models
OLS can also be used to estimate multifactor models.
A simplified factor model is:
where:
- = asset's excess return;
- = factor ;
- = estimated exposure to factor ;
- = intercept;
- = residual return.
OLS estimates the factor exposures by minimizing the squared residuals.
Statistical properties
Under the classical linear regression assumptions, OLS has important statistical properties.
The Gauss–Markov theorem states that, under its applicable assumptions, OLS is the best linear unbiased estimator (BLUE) of the regression coefficients.
In particular, the OLS estimator is:
- linear in the observed dependent variable;
- unbiased under the relevant assumptions;
- minimum variance among linear unbiased estimators.
These properties depend on the assumptions of the regression model.
Assumptions
Common assumptions associated with classical OLS inference include:
- linearity of the conditional mean;
- appropriate model specification;
- no perfect multicollinearity among explanatory variables;
- zero conditional mean of the error term;
- appropriate assumptions concerning the dependence structure of observations;
- homoskedasticity for conventional OLS standard errors;
- appropriate conditions for statistical inference.
The exact assumptions required depend on whether the objective is coefficient estimation, unbiasedness, efficiency, hypothesis testing, or prediction.
Heteroskedasticity
Heteroskedasticity occurs when the variance of the regression error differs across observations or levels of the explanatory variables.
It can be represented as:
OLS coefficient estimates can remain unbiased under appropriate exogeneity conditions, but conventional standard errors may be incorrect.
Heteroskedasticity-consistent standard errors can be used to obtain inference that is robust to certain forms of heteroskedasticity.
Multicollinearity
Multicollinearity occurs when explanatory variables in a multiple regression are highly linearly related.
Perfect multicollinearity prevents the standard OLS coefficient formula from being uniquely defined because:
is not invertible.
High but imperfect multicollinearity does not prevent estimation but can increase the standard errors of individual coefficient estimates and make their interpretation more difficult.
OLS and coefficient of determination
OLS regression is commonly evaluated using the coefficient of determination:
where:
is the total sum of squares.
For a regression containing an intercept, OLS minimizes RSS and decomposes the total variation into explained and residual components.
Limitations
OLS has several limitations:
- results can be sensitive to outliers;
- omitted variables can bias coefficient estimates;
- multicollinearity can make individual coefficients imprecise;
- heteroskedasticity can invalidate conventional standard errors;
- autocorrelation can affect inference in time-series applications;
- linear models may not adequately represent nonlinear relationships;
- statistical association does not establish causation.
In financial applications, OLS estimates can also be affected by structural changes, non-stationarity, changing volatility, and changing relationships between financial variables.