Geometric interpretation of least-squares regression
Announcements
HW 01 due Thursday, January 30 at 11:59pm
Released after class.
Make sure you are a member of the course GitHub organization
- If you can see the number of people in the org, then you are a member!
Topics
- Geometric interpretation of least-squares regression
Recap: Regression in matrix from
The simple linear regression model can be represented using vectors and matrices as
: Vector of responses : Design matrix (columns for predictors + intercept) : Vector of model coefficients : Vector of error terms centered at with variance
Recap: Derive
We used matrix calculus to derive the estimator
. . .
Now let’s consider how to derive the least-squares estimator using a geometric interpretation of regression
Geometry of least-squares regression
Let
be the column space of : the set all possible linear combinations (span) of the columns ofThe vector of responses
is not in .Goal: Find another vector
that is in and is as close as possible to . is a projection of onto .
Geometry of least-squares regression
For any
in , the vector is the difference between and .- We want to find
such that is as close as possible to , i.e, we want to minimize the difference
- We want to find
This distance is minimized when
is orthogonal to
Geometry of least-squares regression
Note: If
, an matrix, is orthogonal to an vector , thenTherefore, we have
, and thus
Solve for
Hat matrix
Recall the hat matrix
. , so is a projection of ontoProperties of
, a projection matrix is symmetric ( ) is idempotent ( )If
in , thenIf
is orthogonal to , then