Regression Analysis for Financial Relationships › The Ordinary Least Squares Framework
Quantitative FinanceAll chapters Regression Analysis for Financial Relationships › The Ordinary Least Squares FrameworkOne section · Sections in this chapter2 / 12 ↓
Regression analysis models the relationship between a dependent variable and one or more explanatory variables. In finance, we often want to explain asset returns using factor returns, or forecast prices using economic indicators. The power of regression lies in its ability to decompose variation: separating what can be explained by observable factors from what remains unexplained. This decomposition forms the basis for understanding risk, measuring performance, and building predictive models.
The Simple Linear Model
Consider a linear relationship between a dependent variable and an independent variable . The core idea is straightforward: we believe that changes in produce predictable changes in , but this relationship is obscured by random noise. Our goal is to uncover the underlying systematic relationship despite this noise.
where:
- : observation of the dependent variable for observation
- : corresponding independent variable
- : intercept, representing the expected value of when
- : slope coefficient, representing the change in for a one-unit change in
- : error term capturing the variation in not explained by
The intercept anchors the regression line at a specific level. In financial contexts, when we regress stock returns on market returns, the intercept represents the return we would expect when the market return is exactly zero. This parameter captures the baseline performance that exists independently of market movements.
The slope coefficient is the heart of the regression. It tells us the marginal effect: for every one-unit increase in , we expect to change by units on average. In the context of finance, if in a stock-versus-market regression, then a 1% market move corresponds to an expected 1.3% move in the stock. This amplification (or dampening, if ) characterizes the stock's systematic risk profile.
The error term represents everything we cannot observe or measure that affects . This includes firm-specific news, measurement error, and the influence of countless unmeasured factors. We assume it has zero mean, constant variance, and is uncorrelated across observations; these are assumptions we'll scrutinize carefully later. These assumptions matter because they determine whether our statistical inference is valid and whether our confidence intervals are trustworthy.
The OLS Estimator
Having specified the model, we need a method to estimate the unknown parameters and . Ordinary least squares takes an intuitive approach: find the line that minimizes the total squared distance between observed values and the line's predictions. Why squared distances? Squaring serves two purposes: it treats positive and negative deviations symmetrically, and it penalizes large errors more heavily than small ones, making the estimator sensitive to outliers but also more efficient when errors are normally distributed.
Ordinary least squares finds the estimators by minimizing the sum of squared residuals :
where:
- : sum of squared residuals to be minimized
- : dependent and independent variable observations for item
- : intercept and slope coefficients to be estimated
- : number of observations
This objective function creates a surface in two-dimensional parameter space. The optimal parameter values correspond to the lowest point on this surface, where the total squared error reaches its minimum. Finding this minimum requires calculus: we take derivatives with respect to each parameter and set them equal to zero.
Taking partial derivatives with respect to and and setting them to zero yields the normal equations:
The first equation has an intuitive interpretation. It says that the sum of residuals must equal zero, meaning the regression line must pass through the center of mass of the data. Positive errors exactly balance negative errors. From the first equation, dividing by yields , which gives . This result confirms that the fitted line passes through the point , the sample means of both variables.
Substituting this into the second equation eliminates :
Rearranging terms to group and :
Using the algebraic identity to center the variables:
gives:
where:
- : estimated slope coefficient
- : estimated intercept
- : sample means of and
- : sample covariance between the independent and dependent variables
- : sample variance of the independent variable
The slope coefficient equals the covariance between and divided by the variance of . This formula reveals the essential logic of regression. The numerator, covariance, measures how and move together. The denominator, variance, normalizes this co-movement by the spread of . The ratio measures how much moves, on average, when moves by one unit. If has high variance, we have more information to estimate the relationship precisely, so we divide by a larger number. The intercept ensures the regression line passes through the point .
Matrix Formulation
For multiple regression with explanatory variables, the matrix formulation is essential. The scalar derivation becomes unwieldy with multiple variables, but matrix algebra provides an elegant and general solution. This formulation also reveals the geometric interpretation: OLS finds the projection of the dependent variable onto the space spanned by the explanatory variables.
We write:
where:
- : vector of observations
- : matrix of explanatory variables (including a column of ones for the intercept)
- : vector of coefficients
- : vector of errors
The design matrix stacks all observations of all explanatory variables. Each row represents one observation, and each column represents one variable. The first column typically consists of ones, which corresponds to the intercept term. This structure allows us to handle any number of explanatory variables using the same mathematical framework.
As we covered in Part I's treatment of linear algebra, the OLS solution minimizes the objective function . We expand the quadratic form and take the derivative:
The expansion follows from distributing the transpose operation and recognizing that produces a scalar. Since a scalar equals its own transpose, we have , allowing us to combine these terms.
Taking the derivative with respect to :
Setting the derivative to zero yields the normal equations:
These normal equations have a clear interpretation. The term captures the correlation between each explanatory variable and the dependent variable. The term is the Gram matrix of the regressors, encoding their variances and mutual correlations. The normal equations balance these two components.
Assuming is invertible:
where:
- : vector of estimated coefficients
- : design matrix of explanatory variables
- : vector of dependent variable observations
Intuitively, this generalizes the scalar slope formula . The term captures the covariation between regressors and the dependent variable, while normalizes by the variance-covariance structure of the regressors, effectively "dividing" by the variance while adjusting for correlations between explanatory variables. When regressors are correlated with each other, the matrix inverse accounts for this overlap, so each coefficient represents the unique contribution of its variable after controlling for all others.
This closed-form solution is the foundation for all OLS regression analysis. Its existence guarantees that we can always compute the optimal coefficients directly, without iterative optimization. The requirement that be invertible means no explanatory variable can be a perfect linear combination of others, a condition known as the absence of perfect multicollinearity.