Skip to content

Commit ce0b0d7

Browse files
committed
Add column space orthogonality justification
1 parent b70d251 commit ce0b0d7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

06_linear_transformations_and_projections/03-projecting-onto-column-space.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,6 +3225,17 @@
32253225
"\n",
32263226
"we need to find the $\\vec w$ that makes the error vector ${\\color{#d81a60} \\vec e} = {\\color{orange} \\vec y} - {\\color{#3d81f6} X} \\vec w$ orthogonal to $\\text{colsp}({\\color{#3d81f6} X})$. $\\text{colsp}({\\color{#3d81f6} X})$ is the set of all linear combinations of ${\\color{#3d81f6} X}$'s columns. So, if we can find an $\\color{#d81a60} \\vec e$ that is orthogonal to every column of ${\\color{#3d81f6} X}$, then it must be orthogonal to any of their linear combinations, too.\n",
32273227
"\n",
3228+
"To see why, take any vector in $\\text{colsp}({\\color{#3d81f6} X})$. It has the form $a_1 {\\color{#3d81f6} \\vec x^{(1)}} + a_2 {\\color{#3d81f6} \\vec x^{(2)}} + \\ldots + a_d {\\color{#3d81f6} \\vec x^{(d)}}$. Then\n",
3229+
"\n",
3230+
"$$\\begin{align*}\n",
3231+
"\\left(a_1 {\\color{#3d81f6} \\vec x^{(1)}} + a_2 {\\color{#3d81f6} \\vec x^{(2)}} + \\ldots + a_d {\\color{#3d81f6} \\vec x^{(d)}}\\right) \\cdot {\\color{#d81a60} \\vec e}\n",
3232+
"&= a_1 ({\\color{#3d81f6} \\vec x^{(1)}} \\cdot {\\color{#d81a60} \\vec e}) + a_2 ({\\color{#3d81f6} \\vec x^{(2)}} \\cdot {\\color{#d81a60} \\vec e}) + \\ldots + a_d ({\\color{#3d81f6} \\vec x^{(d)}} \\cdot {\\color{#d81a60} \\vec e}) \\\\\n",
3233+
"&= a_1(0) + a_2(0) + \\ldots + a_d(0) \\\\\n",
3234+
"&= 0\n",
3235+
"\\end{align*}$$\n",
3236+
"\n",
3237+
"So checking orthogonality against the columns of ${\\color{#3d81f6} X}$ is enough to guarantee orthogonality against everything in $\\text{colsp}({\\color{#3d81f6} X})$.\n",
3238+
"\n",
32283239
"So, we're looking for a ${\\color{#d81a60} \\vec e} = {\\color{orange} \\vec y} - {\\color{#3d81f6} X} \\vec w$ that satisfies\n",
32293240
"\n",
32303241
"$$\\begin{align*} {\\color{#3d81f6} \\vec x^{(1)}} \\cdot ({\\color{orange} \\vec y} - {\\color{#3d81f6} X} \\vec w) &= 0 \\\\ {\\color{#3d81f6} \\vec x^{(2)}} \\cdot ({\\color{orange} \\vec y} - {\\color{#3d81f6} X} \\vec w) &= 0 \\\\ &\\vdots \\\\ {\\color{#3d81f6} \\vec x^{(d)}} \\cdot ({\\color{orange} \\vec y} - {\\color{#3d81f6} X} \\vec w) &= 0 \\end{align*}$$\n",

0 commit comments

Comments
 (0)