Pythagorean theorem in linear regression using matrix notation












1












$begingroup$


I am reading online scribe notes on linear regression and I am being quite confused (since did not do linear algebra for a while) on how Pythagorean theorem is being applied here:
enter image description here



First of all I am confused of what "cost" is and then how we get from



$$arg min_x ||A(x-x') - bb'||_2^2 $$ to



$$arg min_x ||A(x-x')||_2^2 - ||b'||_2^2 $$ ? E.g I need some intuition and mathematical explanation of what is happening here and how Pythagorean theorem is used in vector space.



Also why $$arg min_x ||Ax - b||_2 equiv arg min_x ||Ax - b||_2^2 $$?



Thank you!










share|cite|improve this question









$endgroup$

















    1












    $begingroup$


    I am reading online scribe notes on linear regression and I am being quite confused (since did not do linear algebra for a while) on how Pythagorean theorem is being applied here:
    enter image description here



    First of all I am confused of what "cost" is and then how we get from



    $$arg min_x ||A(x-x') - bb'||_2^2 $$ to



    $$arg min_x ||A(x-x')||_2^2 - ||b'||_2^2 $$ ? E.g I need some intuition and mathematical explanation of what is happening here and how Pythagorean theorem is used in vector space.



    Also why $$arg min_x ||Ax - b||_2 equiv arg min_x ||Ax - b||_2^2 $$?



    Thank you!










    share|cite|improve this question









    $endgroup$















      1












      1








      1





      $begingroup$


      I am reading online scribe notes on linear regression and I am being quite confused (since did not do linear algebra for a while) on how Pythagorean theorem is being applied here:
      enter image description here



      First of all I am confused of what "cost" is and then how we get from



      $$arg min_x ||A(x-x') - bb'||_2^2 $$ to



      $$arg min_x ||A(x-x')||_2^2 - ||b'||_2^2 $$ ? E.g I need some intuition and mathematical explanation of what is happening here and how Pythagorean theorem is used in vector space.



      Also why $$arg min_x ||Ax - b||_2 equiv arg min_x ||Ax - b||_2^2 $$?



      Thank you!










      share|cite|improve this question









      $endgroup$




      I am reading online scribe notes on linear regression and I am being quite confused (since did not do linear algebra for a while) on how Pythagorean theorem is being applied here:
      enter image description here



      First of all I am confused of what "cost" is and then how we get from



      $$arg min_x ||A(x-x') - bb'||_2^2 $$ to



      $$arg min_x ||A(x-x')||_2^2 - ||b'||_2^2 $$ ? E.g I need some intuition and mathematical explanation of what is happening here and how Pythagorean theorem is used in vector space.



      Also why $$arg min_x ||Ax - b||_2 equiv arg min_x ||Ax - b||_2^2 $$?



      Thank you!







      linear-algebra regression






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 7 '18 at 19:54









      YohanRothYohanRoth

      6261714




      6261714






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          The cost is $argmin_x ||Ax-b||_2^2$, and one aims at finding a minimizer $x$.



          The "Pythagorean theorem" refers to the fact that



          $$||x+y||_2^2 = ||x||_2^2 + ||y||_2^2$$ whenever $x perp y$.



          In general (Hilbert spaces over $Bbb{C}$), we have



          begin{align}
          ||Ax-b||_2^2 &= langle A(x-x') - b', A(x-x') - b' rangle \
          &= langle A(x-x'), A(x-x')rangle - 2mathop{{rm Re}}(langle A(x-x'), b'rangle) + langle b',b'rangle \
          &= ||A(x-x')||_2^2 + 0 + ||b'||_2^2 tag{$b' perp A(x-x')$} \
          &= ||A(x-x')||_2^2 + ||b'||_2^2
          end{align}



          To address that last problem, observe that for any strictly increasing function $f$, $x < y iff f(x) < f(y)$ by defintion, so $f(p(x))< f(p(y)) iff p(x) < p(y)$. Take $f(x) = x^2$ on $[0,infty)$ to finish the argument.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            I am not very clear on this math notation. What is x' or b'? What is Re? )
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:10










          • $begingroup$
            I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 7 '18 at 21:15










          • $begingroup$
            one more question . Why b = Ax' + b' must be orthogonal to col space of A?
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:28












          • $begingroup$
            @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 8 '18 at 9:11













          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3030307%2fpythagorean-theorem-in-linear-regression-using-matrix-notation%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1












          $begingroup$

          The cost is $argmin_x ||Ax-b||_2^2$, and one aims at finding a minimizer $x$.



          The "Pythagorean theorem" refers to the fact that



          $$||x+y||_2^2 = ||x||_2^2 + ||y||_2^2$$ whenever $x perp y$.



          In general (Hilbert spaces over $Bbb{C}$), we have



          begin{align}
          ||Ax-b||_2^2 &= langle A(x-x') - b', A(x-x') - b' rangle \
          &= langle A(x-x'), A(x-x')rangle - 2mathop{{rm Re}}(langle A(x-x'), b'rangle) + langle b',b'rangle \
          &= ||A(x-x')||_2^2 + 0 + ||b'||_2^2 tag{$b' perp A(x-x')$} \
          &= ||A(x-x')||_2^2 + ||b'||_2^2
          end{align}



          To address that last problem, observe that for any strictly increasing function $f$, $x < y iff f(x) < f(y)$ by defintion, so $f(p(x))< f(p(y)) iff p(x) < p(y)$. Take $f(x) = x^2$ on $[0,infty)$ to finish the argument.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            I am not very clear on this math notation. What is x' or b'? What is Re? )
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:10










          • $begingroup$
            I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 7 '18 at 21:15










          • $begingroup$
            one more question . Why b = Ax' + b' must be orthogonal to col space of A?
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:28












          • $begingroup$
            @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 8 '18 at 9:11


















          1












          $begingroup$

          The cost is $argmin_x ||Ax-b||_2^2$, and one aims at finding a minimizer $x$.



          The "Pythagorean theorem" refers to the fact that



          $$||x+y||_2^2 = ||x||_2^2 + ||y||_2^2$$ whenever $x perp y$.



          In general (Hilbert spaces over $Bbb{C}$), we have



          begin{align}
          ||Ax-b||_2^2 &= langle A(x-x') - b', A(x-x') - b' rangle \
          &= langle A(x-x'), A(x-x')rangle - 2mathop{{rm Re}}(langle A(x-x'), b'rangle) + langle b',b'rangle \
          &= ||A(x-x')||_2^2 + 0 + ||b'||_2^2 tag{$b' perp A(x-x')$} \
          &= ||A(x-x')||_2^2 + ||b'||_2^2
          end{align}



          To address that last problem, observe that for any strictly increasing function $f$, $x < y iff f(x) < f(y)$ by defintion, so $f(p(x))< f(p(y)) iff p(x) < p(y)$. Take $f(x) = x^2$ on $[0,infty)$ to finish the argument.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            I am not very clear on this math notation. What is x' or b'? What is Re? )
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:10










          • $begingroup$
            I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 7 '18 at 21:15










          • $begingroup$
            one more question . Why b = Ax' + b' must be orthogonal to col space of A?
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:28












          • $begingroup$
            @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 8 '18 at 9:11
















          1












          1








          1





          $begingroup$

          The cost is $argmin_x ||Ax-b||_2^2$, and one aims at finding a minimizer $x$.



          The "Pythagorean theorem" refers to the fact that



          $$||x+y||_2^2 = ||x||_2^2 + ||y||_2^2$$ whenever $x perp y$.



          In general (Hilbert spaces over $Bbb{C}$), we have



          begin{align}
          ||Ax-b||_2^2 &= langle A(x-x') - b', A(x-x') - b' rangle \
          &= langle A(x-x'), A(x-x')rangle - 2mathop{{rm Re}}(langle A(x-x'), b'rangle) + langle b',b'rangle \
          &= ||A(x-x')||_2^2 + 0 + ||b'||_2^2 tag{$b' perp A(x-x')$} \
          &= ||A(x-x')||_2^2 + ||b'||_2^2
          end{align}



          To address that last problem, observe that for any strictly increasing function $f$, $x < y iff f(x) < f(y)$ by defintion, so $f(p(x))< f(p(y)) iff p(x) < p(y)$. Take $f(x) = x^2$ on $[0,infty)$ to finish the argument.






          share|cite|improve this answer











          $endgroup$



          The cost is $argmin_x ||Ax-b||_2^2$, and one aims at finding a minimizer $x$.



          The "Pythagorean theorem" refers to the fact that



          $$||x+y||_2^2 = ||x||_2^2 + ||y||_2^2$$ whenever $x perp y$.



          In general (Hilbert spaces over $Bbb{C}$), we have



          begin{align}
          ||Ax-b||_2^2 &= langle A(x-x') - b', A(x-x') - b' rangle \
          &= langle A(x-x'), A(x-x')rangle - 2mathop{{rm Re}}(langle A(x-x'), b'rangle) + langle b',b'rangle \
          &= ||A(x-x')||_2^2 + 0 + ||b'||_2^2 tag{$b' perp A(x-x')$} \
          &= ||A(x-x')||_2^2 + ||b'||_2^2
          end{align}



          To address that last problem, observe that for any strictly increasing function $f$, $x < y iff f(x) < f(y)$ by defintion, so $f(p(x))< f(p(y)) iff p(x) < p(y)$. Take $f(x) = x^2$ on $[0,infty)$ to finish the argument.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Dec 8 '18 at 9:09

























          answered Dec 7 '18 at 20:21









          GNUSupporter 8964民主女神 地下教會GNUSupporter 8964民主女神 地下教會

          12.8k72445




          12.8k72445












          • $begingroup$
            I am not very clear on this math notation. What is x' or b'? What is Re? )
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:10










          • $begingroup$
            I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 7 '18 at 21:15










          • $begingroup$
            one more question . Why b = Ax' + b' must be orthogonal to col space of A?
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:28












          • $begingroup$
            @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 8 '18 at 9:11




















          • $begingroup$
            I am not very clear on this math notation. What is x' or b'? What is Re? )
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:10










          • $begingroup$
            I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 7 '18 at 21:15










          • $begingroup$
            one more question . Why b = Ax' + b' must be orthogonal to col space of A?
            $endgroup$
            – YohanRoth
            Dec 7 '18 at 21:28












          • $begingroup$
            @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
            $endgroup$
            – GNUSupporter 8964民主女神 地下教會
            Dec 8 '18 at 9:11


















          $begingroup$
          I am not very clear on this math notation. What is x' or b'? What is Re? )
          $endgroup$
          – YohanRoth
          Dec 7 '18 at 21:10




          $begingroup$
          I am not very clear on this math notation. What is x' or b'? What is Re? )
          $endgroup$
          – YohanRoth
          Dec 7 '18 at 21:10












          $begingroup$
          I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
          $endgroup$
          – GNUSupporter 8964民主女神 地下教會
          Dec 7 '18 at 21:15




          $begingroup$
          I use $x'$ and $b'$ as in your notes. $Re$ means real part, but that's irrelevant to this question since you're dealing with real-valued data. I put this so that it's also true in Hilbert spaces.
          $endgroup$
          – GNUSupporter 8964民主女神 地下教會
          Dec 7 '18 at 21:15












          $begingroup$
          one more question . Why b = Ax' + b' must be orthogonal to col space of A?
          $endgroup$
          – YohanRoth
          Dec 7 '18 at 21:28






          $begingroup$
          one more question . Why b = Ax' + b' must be orthogonal to col space of A?
          $endgroup$
          – YohanRoth
          Dec 7 '18 at 21:28














          $begingroup$
          @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
          $endgroup$
          – GNUSupporter 8964民主女神 地下教會
          Dec 8 '18 at 9:11






          $begingroup$
          @YohanRoth Sorry for late reply. I've made a typo. It should be $b'$ instead, as in the notes.
          $endgroup$
          – GNUSupporter 8964民主女神 地下教會
          Dec 8 '18 at 9:11




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3030307%2fpythagorean-theorem-in-linear-regression-using-matrix-notation%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Quarter-circle Tiles

          build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

          Mont Emei