Least-Squares by Left Inverse
- Called design matrix in statistics.
- Tall matrix (Typically has more number of data than the number of features)
- Full column rank meaning columns form the linearly independent set. If
is , the rank is . - If it's not full column rank meaning
is a reduced rank matrix, also meaning the columns in a matrix forms linearly dependent set, it's called multicollineariy in statistics.
- If it's not full column rank meaning
itself is not invertible. - But tall matrix can have one-sided, left inverse if it has linearly independet set of columns.
- We are given this data.
- A vector of coefficient parameters.
- We are not given this data. We don't know.
- Dependent variable
- A vector
- We are given this data.
The goal is to remove
If
Instead, we first try to make it square by left-multiply
We wanna remove
Because
This equation has a weird looking, but we know why we have this, because we wanted to first square it, and take the inverse, and get identity matrix to leave the left side only
In linear algebra,
We got numbers of
Instead, we find
Normal Equation
Left-multiply the both sides of the equation by
That is normal equation. It's used in the following least-squares by reduced row echelon form (RREF) and least-squares by QR decomposition.
Least-Squares by Reduced Row Echelon From (RREF)
First, convert it to normal equation.
Apply reduced row echelon form (RREF) to compute matrix inverse to the given data. It's about making augmented matrix by concatenating matrix at the left and identity matrix at the right, apply RREF, and get augmented matrix of identity matrix at the left concatenated by matrix inverse at the right, as below
When we apply that to the augmented matrix concatenated by left and right side of normal equation,
Least-Squares by QR Decomposition
The key part is, before applying QR decomposition to
Replace
Apply LIVE EVIL rule to apply transpose to inner matrices.
Left-multiply both sides of the equation by
Because, letting