How is the auto-correlation of vectors defined?











up vote
2
down vote

favorite












Suppose $v$ is an $n$-ary vector with entries from the set ${0,1}$ (i.e. a vector of ones and zeros).



A paper I am reading defines the "auto-correlation sequences" $$v*v$$ where $*$ denotes the correlation operator.



1) What is an auto-correlation sequence of a vector?



2) What is the correlation operator? (I'm assuming it can be applied to two distinct vectors too)





My first guess was that to auto-correlate a vector you try all the possible rotational permutations of the vector and measure the cosine of the angle between each permuted vector with the original. However, Mathematica's CorrelationFunction on ${1,0}$ with $lag=0$ returns 1 and with $lag=1$ returns $-frac{1}{2}$, which shoots down my theory since I would expect orthogonal vectors to have $0$ correlation. So what is Mathematica doing here?










share|cite|improve this question


























    up vote
    2
    down vote

    favorite












    Suppose $v$ is an $n$-ary vector with entries from the set ${0,1}$ (i.e. a vector of ones and zeros).



    A paper I am reading defines the "auto-correlation sequences" $$v*v$$ where $*$ denotes the correlation operator.



    1) What is an auto-correlation sequence of a vector?



    2) What is the correlation operator? (I'm assuming it can be applied to two distinct vectors too)





    My first guess was that to auto-correlate a vector you try all the possible rotational permutations of the vector and measure the cosine of the angle between each permuted vector with the original. However, Mathematica's CorrelationFunction on ${1,0}$ with $lag=0$ returns 1 and with $lag=1$ returns $-frac{1}{2}$, which shoots down my theory since I would expect orthogonal vectors to have $0$ correlation. So what is Mathematica doing here?










    share|cite|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Suppose $v$ is an $n$-ary vector with entries from the set ${0,1}$ (i.e. a vector of ones and zeros).



      A paper I am reading defines the "auto-correlation sequences" $$v*v$$ where $*$ denotes the correlation operator.



      1) What is an auto-correlation sequence of a vector?



      2) What is the correlation operator? (I'm assuming it can be applied to two distinct vectors too)





      My first guess was that to auto-correlate a vector you try all the possible rotational permutations of the vector and measure the cosine of the angle between each permuted vector with the original. However, Mathematica's CorrelationFunction on ${1,0}$ with $lag=0$ returns 1 and with $lag=1$ returns $-frac{1}{2}$, which shoots down my theory since I would expect orthogonal vectors to have $0$ correlation. So what is Mathematica doing here?










      share|cite|improve this question













      Suppose $v$ is an $n$-ary vector with entries from the set ${0,1}$ (i.e. a vector of ones and zeros).



      A paper I am reading defines the "auto-correlation sequences" $$v*v$$ where $*$ denotes the correlation operator.



      1) What is an auto-correlation sequence of a vector?



      2) What is the correlation operator? (I'm assuming it can be applied to two distinct vectors too)





      My first guess was that to auto-correlate a vector you try all the possible rotational permutations of the vector and measure the cosine of the angle between each permuted vector with the original. However, Mathematica's CorrelationFunction on ${1,0}$ with $lag=0$ returns 1 and with $lag=1$ returns $-frac{1}{2}$, which shoots down my theory since I would expect orthogonal vectors to have $0$ correlation. So what is Mathematica doing here?







      linear-algebra statistics correlation






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 15 at 16:10









      Craig

      621314




      621314






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          The sample correlation of vectors $(X_1, dots, X_n)$ and
          $(Y_1, dots, Y_n)$ is



          $$rho_{(X,Y)} = frac{frac{1}{n-1}sum_{i=1}^n (X_i - bar X)(Y_i - bar Y) }{S_XS_Y},$$
          where $bar X, bar Y$ are the respective sample means and $S_XS_Y$ are the respective sample standard deviations.



          Roughly speaking, the sample autocorrelation of lag $ell$ of a vector $(X_1, dots X_n)$ is the sample correlation of the
          vector $(X_1, dots, X_{n-ell})$ and and the lagged vector
          $(X_ell, X_{ell + 1}, dots, X_n).$



          Various refinements are used in specific applications.
          Perhaps the one you are looking for is of the following
          form:



          $$rho_ell = frac{sum_{i=1}^{n-ell} (X_1 - bar X)(X_ell - bar X) }{(n-1)S_X^2},$$
          Notice that $bar X$ and $S_X^2$ are based on the
          entire sequence. Also, when $ell=0,$ we have $rho_ell = 1.$
          See Wikipedia
          at the last bullet under Estimation.



          As I recall, this is used in the R function acf:



          set.seed(1115)
          x = round(rnorm(10,200,15))-20*(1:10); x
          [1] 176 169 127 99 96 92 45 70 10 12
          acf(x)
          acf(x, plot=F)

          Autocorrelations of series ‘x’, by lag

          0 1 2 3 4 5 6 7 8 9
          1.000 0.625 0.299 0.138 -0.060 -0.177 -0.304 -0.363 -0.434 -0.223


          enter image description here






          share|cite|improve this answer























          • Thanks! Very clear and concise.
            – Craig
            Nov 16 at 14:43











          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',
          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%2f2999886%2fhow-is-the-auto-correlation-of-vectors-defined%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








          up vote
          3
          down vote



          accepted










          The sample correlation of vectors $(X_1, dots, X_n)$ and
          $(Y_1, dots, Y_n)$ is



          $$rho_{(X,Y)} = frac{frac{1}{n-1}sum_{i=1}^n (X_i - bar X)(Y_i - bar Y) }{S_XS_Y},$$
          where $bar X, bar Y$ are the respective sample means and $S_XS_Y$ are the respective sample standard deviations.



          Roughly speaking, the sample autocorrelation of lag $ell$ of a vector $(X_1, dots X_n)$ is the sample correlation of the
          vector $(X_1, dots, X_{n-ell})$ and and the lagged vector
          $(X_ell, X_{ell + 1}, dots, X_n).$



          Various refinements are used in specific applications.
          Perhaps the one you are looking for is of the following
          form:



          $$rho_ell = frac{sum_{i=1}^{n-ell} (X_1 - bar X)(X_ell - bar X) }{(n-1)S_X^2},$$
          Notice that $bar X$ and $S_X^2$ are based on the
          entire sequence. Also, when $ell=0,$ we have $rho_ell = 1.$
          See Wikipedia
          at the last bullet under Estimation.



          As I recall, this is used in the R function acf:



          set.seed(1115)
          x = round(rnorm(10,200,15))-20*(1:10); x
          [1] 176 169 127 99 96 92 45 70 10 12
          acf(x)
          acf(x, plot=F)

          Autocorrelations of series ‘x’, by lag

          0 1 2 3 4 5 6 7 8 9
          1.000 0.625 0.299 0.138 -0.060 -0.177 -0.304 -0.363 -0.434 -0.223


          enter image description here






          share|cite|improve this answer























          • Thanks! Very clear and concise.
            – Craig
            Nov 16 at 14:43















          up vote
          3
          down vote



          accepted










          The sample correlation of vectors $(X_1, dots, X_n)$ and
          $(Y_1, dots, Y_n)$ is



          $$rho_{(X,Y)} = frac{frac{1}{n-1}sum_{i=1}^n (X_i - bar X)(Y_i - bar Y) }{S_XS_Y},$$
          where $bar X, bar Y$ are the respective sample means and $S_XS_Y$ are the respective sample standard deviations.



          Roughly speaking, the sample autocorrelation of lag $ell$ of a vector $(X_1, dots X_n)$ is the sample correlation of the
          vector $(X_1, dots, X_{n-ell})$ and and the lagged vector
          $(X_ell, X_{ell + 1}, dots, X_n).$



          Various refinements are used in specific applications.
          Perhaps the one you are looking for is of the following
          form:



          $$rho_ell = frac{sum_{i=1}^{n-ell} (X_1 - bar X)(X_ell - bar X) }{(n-1)S_X^2},$$
          Notice that $bar X$ and $S_X^2$ are based on the
          entire sequence. Also, when $ell=0,$ we have $rho_ell = 1.$
          See Wikipedia
          at the last bullet under Estimation.



          As I recall, this is used in the R function acf:



          set.seed(1115)
          x = round(rnorm(10,200,15))-20*(1:10); x
          [1] 176 169 127 99 96 92 45 70 10 12
          acf(x)
          acf(x, plot=F)

          Autocorrelations of series ‘x’, by lag

          0 1 2 3 4 5 6 7 8 9
          1.000 0.625 0.299 0.138 -0.060 -0.177 -0.304 -0.363 -0.434 -0.223


          enter image description here






          share|cite|improve this answer























          • Thanks! Very clear and concise.
            – Craig
            Nov 16 at 14:43













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          The sample correlation of vectors $(X_1, dots, X_n)$ and
          $(Y_1, dots, Y_n)$ is



          $$rho_{(X,Y)} = frac{frac{1}{n-1}sum_{i=1}^n (X_i - bar X)(Y_i - bar Y) }{S_XS_Y},$$
          where $bar X, bar Y$ are the respective sample means and $S_XS_Y$ are the respective sample standard deviations.



          Roughly speaking, the sample autocorrelation of lag $ell$ of a vector $(X_1, dots X_n)$ is the sample correlation of the
          vector $(X_1, dots, X_{n-ell})$ and and the lagged vector
          $(X_ell, X_{ell + 1}, dots, X_n).$



          Various refinements are used in specific applications.
          Perhaps the one you are looking for is of the following
          form:



          $$rho_ell = frac{sum_{i=1}^{n-ell} (X_1 - bar X)(X_ell - bar X) }{(n-1)S_X^2},$$
          Notice that $bar X$ and $S_X^2$ are based on the
          entire sequence. Also, when $ell=0,$ we have $rho_ell = 1.$
          See Wikipedia
          at the last bullet under Estimation.



          As I recall, this is used in the R function acf:



          set.seed(1115)
          x = round(rnorm(10,200,15))-20*(1:10); x
          [1] 176 169 127 99 96 92 45 70 10 12
          acf(x)
          acf(x, plot=F)

          Autocorrelations of series ‘x’, by lag

          0 1 2 3 4 5 6 7 8 9
          1.000 0.625 0.299 0.138 -0.060 -0.177 -0.304 -0.363 -0.434 -0.223


          enter image description here






          share|cite|improve this answer














          The sample correlation of vectors $(X_1, dots, X_n)$ and
          $(Y_1, dots, Y_n)$ is



          $$rho_{(X,Y)} = frac{frac{1}{n-1}sum_{i=1}^n (X_i - bar X)(Y_i - bar Y) }{S_XS_Y},$$
          where $bar X, bar Y$ are the respective sample means and $S_XS_Y$ are the respective sample standard deviations.



          Roughly speaking, the sample autocorrelation of lag $ell$ of a vector $(X_1, dots X_n)$ is the sample correlation of the
          vector $(X_1, dots, X_{n-ell})$ and and the lagged vector
          $(X_ell, X_{ell + 1}, dots, X_n).$



          Various refinements are used in specific applications.
          Perhaps the one you are looking for is of the following
          form:



          $$rho_ell = frac{sum_{i=1}^{n-ell} (X_1 - bar X)(X_ell - bar X) }{(n-1)S_X^2},$$
          Notice that $bar X$ and $S_X^2$ are based on the
          entire sequence. Also, when $ell=0,$ we have $rho_ell = 1.$
          See Wikipedia
          at the last bullet under Estimation.



          As I recall, this is used in the R function acf:



          set.seed(1115)
          x = round(rnorm(10,200,15))-20*(1:10); x
          [1] 176 169 127 99 96 92 45 70 10 12
          acf(x)
          acf(x, plot=F)

          Autocorrelations of series ‘x’, by lag

          0 1 2 3 4 5 6 7 8 9
          1.000 0.625 0.299 0.138 -0.060 -0.177 -0.304 -0.363 -0.434 -0.223


          enter image description here







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Nov 16 at 6:14

























          answered Nov 16 at 5:51









          BruceET

          34.8k71440




          34.8k71440












          • Thanks! Very clear and concise.
            – Craig
            Nov 16 at 14:43


















          • Thanks! Very clear and concise.
            – Craig
            Nov 16 at 14:43
















          Thanks! Very clear and concise.
          – Craig
          Nov 16 at 14:43




          Thanks! Very clear and concise.
          – Craig
          Nov 16 at 14:43


















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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.


          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%2f2999886%2fhow-is-the-auto-correlation-of-vectors-defined%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

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents