An Intuitive Explanation of the OLS Estimator for both Traditional and Matrix Algebra
The Ordinary Least Squares estimator, is the first thing one learns in econometrics. It has two forms, one in standard algebra and one in matrix algebra, but it's important to remember the two are equivalent:
I think most students will find it extremely easy to get lost in notation and miss the link to be made with real world data. The following exercise is a helpful way I found to make sure one continues to make the link between traditional 'simple' notation, Matrix Algebra notation, and the underlying data and arithmetic that goes into the ordinary linear regression estimator.
Deriving the Algebraic Notation for the Simple Bivariate Model
The familiar simple bivariate model is expressed as an independent observation as a function of an intercept, a regression coefficient, and an error term (respectively):
Where we wish to minimize the sum of squared errors (SSE):
To do so we isolate the error of the regression to make it a function of the other terms:
Then substitute:
For our purposes, we'll ignore the derivation of the intercept and take it as a given that it is and just solve for the slope coefficient. To minimize the errors, we need to take the partial derivative with respect to
Move the summation operator through since the the derivative of a sum is equal to the sum of the derivatives:
Take the derivative (using the chain rule), then setting it equal to 0 for the first order condition to find the min/max:
Then multiply by to simplify:
Substitute the solution for the intercept, , that we took as a given above:
Then rearrange and distribute the summation operator to solve for :
Which is algebraically equivalent to:
$$ \frac{\hat{cov}(x,y)}{var(x …