Non-trivial intersections of row spaces in Matlab












0












$begingroup$


Let $W_p$ and $W_f$ be two subspaces (past and future data in matrix form: rows as basis vectors). Let x be a vector that lies in intersection of these two subspaces. Then $∃$ two coefficient vectors $a,b$ such that



$x = a^T W_p = b^T W_f$



I want to find a, b and x, avoiding trivial intersections (i.e. vectors $a$ and $b$ such that $a^T W_p=0 =b^T W_f$)



I was thinking of proceeding in this way:



$
a^T W_p-b^T W_f = 0\
[a^T -b^T] W =0 \
$



with $W =begin{bmatrix}W_p\W_fend{bmatrix}$. Is it possible to compute $a$ and $b$ based on that? maybe with QR factorization of $W$ to find the null space?










share|cite|improve this question











$endgroup$

















    0












    $begingroup$


    Let $W_p$ and $W_f$ be two subspaces (past and future data in matrix form: rows as basis vectors). Let x be a vector that lies in intersection of these two subspaces. Then $∃$ two coefficient vectors $a,b$ such that



    $x = a^T W_p = b^T W_f$



    I want to find a, b and x, avoiding trivial intersections (i.e. vectors $a$ and $b$ such that $a^T W_p=0 =b^T W_f$)



    I was thinking of proceeding in this way:



    $
    a^T W_p-b^T W_f = 0\
    [a^T -b^T] W =0 \
    $



    with $W =begin{bmatrix}W_p\W_fend{bmatrix}$. Is it possible to compute $a$ and $b$ based on that? maybe with QR factorization of $W$ to find the null space?










    share|cite|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      Let $W_p$ and $W_f$ be two subspaces (past and future data in matrix form: rows as basis vectors). Let x be a vector that lies in intersection of these two subspaces. Then $∃$ two coefficient vectors $a,b$ such that



      $x = a^T W_p = b^T W_f$



      I want to find a, b and x, avoiding trivial intersections (i.e. vectors $a$ and $b$ such that $a^T W_p=0 =b^T W_f$)



      I was thinking of proceeding in this way:



      $
      a^T W_p-b^T W_f = 0\
      [a^T -b^T] W =0 \
      $



      with $W =begin{bmatrix}W_p\W_fend{bmatrix}$. Is it possible to compute $a$ and $b$ based on that? maybe with QR factorization of $W$ to find the null space?










      share|cite|improve this question











      $endgroup$




      Let $W_p$ and $W_f$ be two subspaces (past and future data in matrix form: rows as basis vectors). Let x be a vector that lies in intersection of these two subspaces. Then $∃$ two coefficient vectors $a,b$ such that



      $x = a^T W_p = b^T W_f$



      I want to find a, b and x, avoiding trivial intersections (i.e. vectors $a$ and $b$ such that $a^T W_p=0 =b^T W_f$)



      I was thinking of proceeding in this way:



      $
      a^T W_p-b^T W_f = 0\
      [a^T -b^T] W =0 \
      $



      with $W =begin{bmatrix}W_p\W_fend{bmatrix}$. Is it possible to compute $a$ and $b$ based on that? maybe with QR factorization of $W$ to find the null space?







      linear-algebra matrices vector-spaces intersection-theory






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 21 '18 at 9:51







      Betelgeuse

















      asked Dec 20 '18 at 10:43









      BetelgeuseBetelgeuse

      1417




      1417






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Taking the transpose on both sides, your equation reads
          $$
          W^T pmatrix{a\ -b} = 0
          $$

          With this in mind, the easiest approach is probably to use the nullspace function in matlab. In particular:



          W = [Wp; Wf];
          N = null(W');


          If all you need is a non-trivial solution, take the first column of $N$ (that is, N(:,1)) and split it into the vectors a and -b.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
            $endgroup$
            – Betelgeuse
            Dec 21 '18 at 9:48










          • $begingroup$
            If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
            $endgroup$
            – Omnomnomnom
            Dec 21 '18 at 17:23










          • $begingroup$
            Yes, I was wondering how to proceed if you don't have an $x$
            $endgroup$
            – Betelgeuse
            Jan 3 at 13:24










          • $begingroup$
            If you don't have an $x$, then what makes a pair $a,b$ "correct"?
            $endgroup$
            – Omnomnomnom
            Jan 3 at 13:56












          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%2f3047400%2fnon-trivial-intersections-of-row-spaces-in-matlab%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









          0












          $begingroup$

          Taking the transpose on both sides, your equation reads
          $$
          W^T pmatrix{a\ -b} = 0
          $$

          With this in mind, the easiest approach is probably to use the nullspace function in matlab. In particular:



          W = [Wp; Wf];
          N = null(W');


          If all you need is a non-trivial solution, take the first column of $N$ (that is, N(:,1)) and split it into the vectors a and -b.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
            $endgroup$
            – Betelgeuse
            Dec 21 '18 at 9:48










          • $begingroup$
            If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
            $endgroup$
            – Omnomnomnom
            Dec 21 '18 at 17:23










          • $begingroup$
            Yes, I was wondering how to proceed if you don't have an $x$
            $endgroup$
            – Betelgeuse
            Jan 3 at 13:24










          • $begingroup$
            If you don't have an $x$, then what makes a pair $a,b$ "correct"?
            $endgroup$
            – Omnomnomnom
            Jan 3 at 13:56
















          0












          $begingroup$

          Taking the transpose on both sides, your equation reads
          $$
          W^T pmatrix{a\ -b} = 0
          $$

          With this in mind, the easiest approach is probably to use the nullspace function in matlab. In particular:



          W = [Wp; Wf];
          N = null(W');


          If all you need is a non-trivial solution, take the first column of $N$ (that is, N(:,1)) and split it into the vectors a and -b.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
            $endgroup$
            – Betelgeuse
            Dec 21 '18 at 9:48










          • $begingroup$
            If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
            $endgroup$
            – Omnomnomnom
            Dec 21 '18 at 17:23










          • $begingroup$
            Yes, I was wondering how to proceed if you don't have an $x$
            $endgroup$
            – Betelgeuse
            Jan 3 at 13:24










          • $begingroup$
            If you don't have an $x$, then what makes a pair $a,b$ "correct"?
            $endgroup$
            – Omnomnomnom
            Jan 3 at 13:56














          0












          0








          0





          $begingroup$

          Taking the transpose on both sides, your equation reads
          $$
          W^T pmatrix{a\ -b} = 0
          $$

          With this in mind, the easiest approach is probably to use the nullspace function in matlab. In particular:



          W = [Wp; Wf];
          N = null(W');


          If all you need is a non-trivial solution, take the first column of $N$ (that is, N(:,1)) and split it into the vectors a and -b.






          share|cite|improve this answer









          $endgroup$



          Taking the transpose on both sides, your equation reads
          $$
          W^T pmatrix{a\ -b} = 0
          $$

          With this in mind, the easiest approach is probably to use the nullspace function in matlab. In particular:



          W = [Wp; Wf];
          N = null(W');


          If all you need is a non-trivial solution, take the first column of $N$ (that is, N(:,1)) and split it into the vectors a and -b.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 20 '18 at 20:43









          OmnomnomnomOmnomnomnom

          129k794188




          129k794188












          • $begingroup$
            This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
            $endgroup$
            – Betelgeuse
            Dec 21 '18 at 9:48










          • $begingroup$
            If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
            $endgroup$
            – Omnomnomnom
            Dec 21 '18 at 17:23










          • $begingroup$
            Yes, I was wondering how to proceed if you don't have an $x$
            $endgroup$
            – Betelgeuse
            Jan 3 at 13:24










          • $begingroup$
            If you don't have an $x$, then what makes a pair $a,b$ "correct"?
            $endgroup$
            – Omnomnomnom
            Jan 3 at 13:56


















          • $begingroup$
            This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
            $endgroup$
            – Betelgeuse
            Dec 21 '18 at 9:48










          • $begingroup$
            If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
            $endgroup$
            – Omnomnomnom
            Dec 21 '18 at 17:23










          • $begingroup$
            Yes, I was wondering how to proceed if you don't have an $x$
            $endgroup$
            – Betelgeuse
            Jan 3 at 13:24










          • $begingroup$
            If you don't have an $x$, then what makes a pair $a,b$ "correct"?
            $endgroup$
            – Omnomnomnom
            Jan 3 at 13:56
















          $begingroup$
          This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
          $endgroup$
          – Betelgeuse
          Dec 21 '18 at 9:48




          $begingroup$
          This procedure is correct in principle, but it does not give me the correct sequence of $a,b$ and $x$ unfortunately (I have already the sequence of $x$ so to check the results).
          $endgroup$
          – Betelgeuse
          Dec 21 '18 at 9:48












          $begingroup$
          If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
          $endgroup$
          – Omnomnomnom
          Dec 21 '18 at 17:23




          $begingroup$
          If you already have an $x$, then you're really solving the system $$ W_p^T a = x\ W_f^T b = x\ $$ which is to say $$ pmatrix{W_p^T&0\0&W_f^T} pmatrix{a\b} = pmatrix{x\x} $$
          $endgroup$
          – Omnomnomnom
          Dec 21 '18 at 17:23












          $begingroup$
          Yes, I was wondering how to proceed if you don't have an $x$
          $endgroup$
          – Betelgeuse
          Jan 3 at 13:24




          $begingroup$
          Yes, I was wondering how to proceed if you don't have an $x$
          $endgroup$
          – Betelgeuse
          Jan 3 at 13:24












          $begingroup$
          If you don't have an $x$, then what makes a pair $a,b$ "correct"?
          $endgroup$
          – Omnomnomnom
          Jan 3 at 13:56




          $begingroup$
          If you don't have an $x$, then what makes a pair $a,b$ "correct"?
          $endgroup$
          – Omnomnomnom
          Jan 3 at 13:56


















          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%2f3047400%2fnon-trivial-intersections-of-row-spaces-in-matlab%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

          Plaza Victoria

          Puebla de Zaragoza

          Musa