PSet 25: Matrices and Linear Regression
(videos: up to and including Linear Regression)
Invert this matrix using Gauss-Jordan elimination:
( 6 2 0 1 0 4 2 0 1 ) \begin{pmatrix}
6&2&0\\
1&0&4\\
2&0&1\\
\end{pmatrix} ⎝ ⎛ 6 1 2 2 0 0 0 4 1 ⎠ ⎞
Given the following data, perform linear regression. Give me the weight vector w w w . Feel free to use tools to multiply and invert matrices, but show each step.
Recall the weight vector w w w equation:
w = ( X T X ) − 1 X T y \textbf{w}=(X^TX)^{-1}X^T\textbf{y} w = ( X T X ) − 1 X T y
Here is the input X X X and their values y y y :
X = ( 1 5 1 10 1 15 1 20 ) , y = ( 12.06 18.472 26.378 34.724 ) X = \begin{pmatrix}
1 & 5\\
1&10\\
1&15\\
1&20\\
\end{pmatrix}, \textbf{y}=\begin{pmatrix}
12.06\\
18.472\\
26.378\\
34.724\\
\end{pmatrix} X = ⎝ ⎛ 1 1 1 1 5 10 15 20 ⎠ ⎞ , y = ⎝ ⎛ 12.06 18.472 26.378 34.724 ⎠ ⎞