Does mean centering reduce covariance?












9












$begingroup$


Assuming I have two non-independent random variables and I want to reduce covariance between them as much as possible without loosing too much "signal", does mean centering help? I read somewhere that mean centering reduces correlation by a significant factor, so I'm thinking it should do the same for covariance.










share|cite|improve this question











$endgroup$

















    9












    $begingroup$


    Assuming I have two non-independent random variables and I want to reduce covariance between them as much as possible without loosing too much "signal", does mean centering help? I read somewhere that mean centering reduces correlation by a significant factor, so I'm thinking it should do the same for covariance.










    share|cite|improve this question











    $endgroup$















      9












      9








      9


      2



      $begingroup$


      Assuming I have two non-independent random variables and I want to reduce covariance between them as much as possible without loosing too much "signal", does mean centering help? I read somewhere that mean centering reduces correlation by a significant factor, so I'm thinking it should do the same for covariance.










      share|cite|improve this question











      $endgroup$




      Assuming I have two non-independent random variables and I want to reduce covariance between them as much as possible without loosing too much "signal", does mean centering help? I read somewhere that mean centering reduces correlation by a significant factor, so I'm thinking it should do the same for covariance.







      correlation covariance random-vector






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited 7 hours ago









      opa

      1031




      1031










      asked 20 hours ago









      lvdplvdp

      567




      567






















          3 Answers
          3






          active

          oldest

          votes


















          23












          $begingroup$

          If $X$ and $Y$ are random variables and $a$ and $b$ are constants, then
          $$
          begin{aligned}
          operatorname{Cov}(X + a, Y + b)
          &= E[(X + a - E[X + a])(Y + b - E[Y + b])] \
          &= E[(X + a - E[X] - E[a])(Y + b - E[Y] - E[b])] \
          &= E[(X + a - E[X] - a)(Y + b - E[Y] - b)] \
          &= E[(X - E[X])(Y - E[Y])] \
          &= operatorname{Cov}(X, Y).
          end{aligned}
          $$

          Centering is the special case $a = -E[X]$ and $b = -E[Y]$, so centering does not affect covariance.





          Also, since correlation is defined as
          $$
          operatorname{Corr}(X, Y)
          = frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
          $$

          we can see that
          $$
          begin{aligned}
          operatorname{Corr}(X + a, Y + b)
          &= frac{operatorname{Cov}(X + a, Y + b)}{sqrt{operatorname{Var}(X + a) operatorname{Var}(Y + b)}} \
          &= frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
          end{aligned}
          $$

          so in particular, correlation isn't affected by centering either.





          That was the population version of the story. The sample version is the same: If we use
          $$
          widehat{operatorname{Cov}}(X, Y)
          = frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright)
          $$

          as our estimate of covariance between $X$ and $Y$ from a paired sample $(X_1,Y_1), ldots, (X_n,Y_n)$, then
          $$
          begin{aligned}
          widehat{operatorname{Cov}}(X + a, Y + b)
          &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n (X_j + a)right)left(Y_i + b - frac{1}{n}sum_{j=1}^n (Y_j + b)right) \
          &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n X_j - frac{n}{n} aright)left(Y_i + b - frac{1}{n}sum_{j=1}^n Y_j - frac{n}{n} bright) \
          &= frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright) \
          &= widehat{operatorname{Cov}}(X, Y)
          end{aligned}
          $$

          for any $a$ and $b$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
            $endgroup$
            – lvdp
            18 hours ago








          • 2




            $begingroup$
            @lvdp That should probably be a separate question.
            $endgroup$
            – Acccumulation
            7 hours ago










          • $begingroup$
            A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
            $endgroup$
            – Nick Cox
            7 hours ago



















          3












          $begingroup$

          The definition of the covariance of $X$ and $Y$ is $E[(X-E[X])(Y-E[Y])]$. The expression $X-E[X]$ in that formula is the centered version of $X$. So we already center $X$ when we take the covariance, and centering is an idempotent operator; once a variable is centered, applying the centering process further times doesn't change it. If the formula didn't take the centered versions of the variables, then there would all sort of weird effects, such as the covariance between temperature and another variable being different depending on whether we measure temperature in Celsius or Kelvin.






          share|cite|improve this answer









          $endgroup$





















            2












            $begingroup$

            "somewhere" tends to be a rather unreliable source...



            Covariance/correlation are defined with explicit centering. If you don't center the data, then you are not computing covariance/correlation. (Precisely: Pearson correlation)



            The main difference is whether you center based on a theoretical model (e.g., the expected value is supposed to be exactly 0) or based on the data (arithmetic mean). It is easy to see that the arithmetic mean will yield smaller Covariance than any different center.



            However, smaller covariance does not imply smaller correlation, or the opposite. Assume that we have data X=(1,2) and Y=(2,1). It is easy to see that with arithmetic mean centering this will yield perfectly negative correlation, while if we know the generating process produces 0 on average, the data is actually positively correlated.
            So in this example, we are centering - but with the theoretical expected value of 0.



            This can arise easily. Consider we have a sensor array, 11x11, with the cells numbered -5 to +5. Rather than taking the arithmetic mean, it does make sense to use the "physical" mean of our sensor array here when looking for the correlation of sensor events (if we enumerated the cells 0 to 10, we'd use 5 as fixed mean, and we would get the exact same results, so that indexing choice disappears from the analysis - nice).






            share|cite|improve this answer









            $endgroup$













            • $begingroup$
              Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
              $endgroup$
              – lvdp
              10 hours ago











            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: "65"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f391838%2fdoes-mean-centering-reduce-covariance%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            23












            $begingroup$

            If $X$ and $Y$ are random variables and $a$ and $b$ are constants, then
            $$
            begin{aligned}
            operatorname{Cov}(X + a, Y + b)
            &= E[(X + a - E[X + a])(Y + b - E[Y + b])] \
            &= E[(X + a - E[X] - E[a])(Y + b - E[Y] - E[b])] \
            &= E[(X + a - E[X] - a)(Y + b - E[Y] - b)] \
            &= E[(X - E[X])(Y - E[Y])] \
            &= operatorname{Cov}(X, Y).
            end{aligned}
            $$

            Centering is the special case $a = -E[X]$ and $b = -E[Y]$, so centering does not affect covariance.





            Also, since correlation is defined as
            $$
            operatorname{Corr}(X, Y)
            = frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            $$

            we can see that
            $$
            begin{aligned}
            operatorname{Corr}(X + a, Y + b)
            &= frac{operatorname{Cov}(X + a, Y + b)}{sqrt{operatorname{Var}(X + a) operatorname{Var}(Y + b)}} \
            &= frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            end{aligned}
            $$

            so in particular, correlation isn't affected by centering either.





            That was the population version of the story. The sample version is the same: If we use
            $$
            widehat{operatorname{Cov}}(X, Y)
            = frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright)
            $$

            as our estimate of covariance between $X$ and $Y$ from a paired sample $(X_1,Y_1), ldots, (X_n,Y_n)$, then
            $$
            begin{aligned}
            widehat{operatorname{Cov}}(X + a, Y + b)
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n (X_j + a)right)left(Y_i + b - frac{1}{n}sum_{j=1}^n (Y_j + b)right) \
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n X_j - frac{n}{n} aright)left(Y_i + b - frac{1}{n}sum_{j=1}^n Y_j - frac{n}{n} bright) \
            &= frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright) \
            &= widehat{operatorname{Cov}}(X, Y)
            end{aligned}
            $$

            for any $a$ and $b$.






            share|cite|improve this answer











            $endgroup$













            • $begingroup$
              thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
              $endgroup$
              – lvdp
              18 hours ago








            • 2




              $begingroup$
              @lvdp That should probably be a separate question.
              $endgroup$
              – Acccumulation
              7 hours ago










            • $begingroup$
              A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
              $endgroup$
              – Nick Cox
              7 hours ago
















            23












            $begingroup$

            If $X$ and $Y$ are random variables and $a$ and $b$ are constants, then
            $$
            begin{aligned}
            operatorname{Cov}(X + a, Y + b)
            &= E[(X + a - E[X + a])(Y + b - E[Y + b])] \
            &= E[(X + a - E[X] - E[a])(Y + b - E[Y] - E[b])] \
            &= E[(X + a - E[X] - a)(Y + b - E[Y] - b)] \
            &= E[(X - E[X])(Y - E[Y])] \
            &= operatorname{Cov}(X, Y).
            end{aligned}
            $$

            Centering is the special case $a = -E[X]$ and $b = -E[Y]$, so centering does not affect covariance.





            Also, since correlation is defined as
            $$
            operatorname{Corr}(X, Y)
            = frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            $$

            we can see that
            $$
            begin{aligned}
            operatorname{Corr}(X + a, Y + b)
            &= frac{operatorname{Cov}(X + a, Y + b)}{sqrt{operatorname{Var}(X + a) operatorname{Var}(Y + b)}} \
            &= frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            end{aligned}
            $$

            so in particular, correlation isn't affected by centering either.





            That was the population version of the story. The sample version is the same: If we use
            $$
            widehat{operatorname{Cov}}(X, Y)
            = frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright)
            $$

            as our estimate of covariance between $X$ and $Y$ from a paired sample $(X_1,Y_1), ldots, (X_n,Y_n)$, then
            $$
            begin{aligned}
            widehat{operatorname{Cov}}(X + a, Y + b)
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n (X_j + a)right)left(Y_i + b - frac{1}{n}sum_{j=1}^n (Y_j + b)right) \
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n X_j - frac{n}{n} aright)left(Y_i + b - frac{1}{n}sum_{j=1}^n Y_j - frac{n}{n} bright) \
            &= frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright) \
            &= widehat{operatorname{Cov}}(X, Y)
            end{aligned}
            $$

            for any $a$ and $b$.






            share|cite|improve this answer











            $endgroup$













            • $begingroup$
              thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
              $endgroup$
              – lvdp
              18 hours ago








            • 2




              $begingroup$
              @lvdp That should probably be a separate question.
              $endgroup$
              – Acccumulation
              7 hours ago










            • $begingroup$
              A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
              $endgroup$
              – Nick Cox
              7 hours ago














            23












            23








            23





            $begingroup$

            If $X$ and $Y$ are random variables and $a$ and $b$ are constants, then
            $$
            begin{aligned}
            operatorname{Cov}(X + a, Y + b)
            &= E[(X + a - E[X + a])(Y + b - E[Y + b])] \
            &= E[(X + a - E[X] - E[a])(Y + b - E[Y] - E[b])] \
            &= E[(X + a - E[X] - a)(Y + b - E[Y] - b)] \
            &= E[(X - E[X])(Y - E[Y])] \
            &= operatorname{Cov}(X, Y).
            end{aligned}
            $$

            Centering is the special case $a = -E[X]$ and $b = -E[Y]$, so centering does not affect covariance.





            Also, since correlation is defined as
            $$
            operatorname{Corr}(X, Y)
            = frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            $$

            we can see that
            $$
            begin{aligned}
            operatorname{Corr}(X + a, Y + b)
            &= frac{operatorname{Cov}(X + a, Y + b)}{sqrt{operatorname{Var}(X + a) operatorname{Var}(Y + b)}} \
            &= frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            end{aligned}
            $$

            so in particular, correlation isn't affected by centering either.





            That was the population version of the story. The sample version is the same: If we use
            $$
            widehat{operatorname{Cov}}(X, Y)
            = frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright)
            $$

            as our estimate of covariance between $X$ and $Y$ from a paired sample $(X_1,Y_1), ldots, (X_n,Y_n)$, then
            $$
            begin{aligned}
            widehat{operatorname{Cov}}(X + a, Y + b)
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n (X_j + a)right)left(Y_i + b - frac{1}{n}sum_{j=1}^n (Y_j + b)right) \
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n X_j - frac{n}{n} aright)left(Y_i + b - frac{1}{n}sum_{j=1}^n Y_j - frac{n}{n} bright) \
            &= frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright) \
            &= widehat{operatorname{Cov}}(X, Y)
            end{aligned}
            $$

            for any $a$ and $b$.






            share|cite|improve this answer











            $endgroup$



            If $X$ and $Y$ are random variables and $a$ and $b$ are constants, then
            $$
            begin{aligned}
            operatorname{Cov}(X + a, Y + b)
            &= E[(X + a - E[X + a])(Y + b - E[Y + b])] \
            &= E[(X + a - E[X] - E[a])(Y + b - E[Y] - E[b])] \
            &= E[(X + a - E[X] - a)(Y + b - E[Y] - b)] \
            &= E[(X - E[X])(Y - E[Y])] \
            &= operatorname{Cov}(X, Y).
            end{aligned}
            $$

            Centering is the special case $a = -E[X]$ and $b = -E[Y]$, so centering does not affect covariance.





            Also, since correlation is defined as
            $$
            operatorname{Corr}(X, Y)
            = frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            $$

            we can see that
            $$
            begin{aligned}
            operatorname{Corr}(X + a, Y + b)
            &= frac{operatorname{Cov}(X + a, Y + b)}{sqrt{operatorname{Var}(X + a) operatorname{Var}(Y + b)}} \
            &= frac{operatorname{Cov}(X, Y)}{sqrt{operatorname{Var}(X) operatorname{Var}(Y)}},
            end{aligned}
            $$

            so in particular, correlation isn't affected by centering either.





            That was the population version of the story. The sample version is the same: If we use
            $$
            widehat{operatorname{Cov}}(X, Y)
            = frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright)
            $$

            as our estimate of covariance between $X$ and $Y$ from a paired sample $(X_1,Y_1), ldots, (X_n,Y_n)$, then
            $$
            begin{aligned}
            widehat{operatorname{Cov}}(X + a, Y + b)
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n (X_j + a)right)left(Y_i + b - frac{1}{n}sum_{j=1}^n (Y_j + b)right) \
            &= frac{1}{n} sum_{i=1}^n left(X_i + a - frac{1}{n}sum_{j=1}^n X_j - frac{n}{n} aright)left(Y_i + b - frac{1}{n}sum_{j=1}^n Y_j - frac{n}{n} bright) \
            &= frac{1}{n} sum_{i=1}^n left(X_i - frac{1}{n}sum_{j=1}^n X_jright)left(Y_i - frac{1}{n}sum_{j=1}^n Y_jright) \
            &= widehat{operatorname{Cov}}(X, Y)
            end{aligned}
            $$

            for any $a$ and $b$.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited 7 hours ago

























            answered 20 hours ago









            Artem MavrinArtem Mavrin

            53148




            53148












            • $begingroup$
              thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
              $endgroup$
              – lvdp
              18 hours ago








            • 2




              $begingroup$
              @lvdp That should probably be a separate question.
              $endgroup$
              – Acccumulation
              7 hours ago










            • $begingroup$
              A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
              $endgroup$
              – Nick Cox
              7 hours ago


















            • $begingroup$
              thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
              $endgroup$
              – lvdp
              18 hours ago








            • 2




              $begingroup$
              @lvdp That should probably be a separate question.
              $endgroup$
              – Acccumulation
              7 hours ago










            • $begingroup$
              A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
              $endgroup$
              – Nick Cox
              7 hours ago
















            $begingroup$
            thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
            $endgroup$
            – lvdp
            18 hours ago






            $begingroup$
            thanks for the detailed answer. Does it mean that for sample covariance the sample size doesn't have any impact either? i.e. reducing the sample size does not reduce the sample covariance?
            $endgroup$
            – lvdp
            18 hours ago






            2




            2




            $begingroup$
            @lvdp That should probably be a separate question.
            $endgroup$
            – Acccumulation
            7 hours ago




            $begingroup$
            @lvdp That should probably be a separate question.
            $endgroup$
            – Acccumulation
            7 hours ago












            $begingroup$
            A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
            $endgroup$
            – Nick Cox
            7 hours ago




            $begingroup$
            A reduced sample size can only come with a different sample. A different sample could show different covariance, therefore. But as sample covariance is defined as an average, sample size is scaled for in principle.
            $endgroup$
            – Nick Cox
            7 hours ago













            3












            $begingroup$

            The definition of the covariance of $X$ and $Y$ is $E[(X-E[X])(Y-E[Y])]$. The expression $X-E[X]$ in that formula is the centered version of $X$. So we already center $X$ when we take the covariance, and centering is an idempotent operator; once a variable is centered, applying the centering process further times doesn't change it. If the formula didn't take the centered versions of the variables, then there would all sort of weird effects, such as the covariance between temperature and another variable being different depending on whether we measure temperature in Celsius or Kelvin.






            share|cite|improve this answer









            $endgroup$


















              3












              $begingroup$

              The definition of the covariance of $X$ and $Y$ is $E[(X-E[X])(Y-E[Y])]$. The expression $X-E[X]$ in that formula is the centered version of $X$. So we already center $X$ when we take the covariance, and centering is an idempotent operator; once a variable is centered, applying the centering process further times doesn't change it. If the formula didn't take the centered versions of the variables, then there would all sort of weird effects, such as the covariance between temperature and another variable being different depending on whether we measure temperature in Celsius or Kelvin.






              share|cite|improve this answer









              $endgroup$
















                3












                3








                3





                $begingroup$

                The definition of the covariance of $X$ and $Y$ is $E[(X-E[X])(Y-E[Y])]$. The expression $X-E[X]$ in that formula is the centered version of $X$. So we already center $X$ when we take the covariance, and centering is an idempotent operator; once a variable is centered, applying the centering process further times doesn't change it. If the formula didn't take the centered versions of the variables, then there would all sort of weird effects, such as the covariance between temperature and another variable being different depending on whether we measure temperature in Celsius or Kelvin.






                share|cite|improve this answer









                $endgroup$



                The definition of the covariance of $X$ and $Y$ is $E[(X-E[X])(Y-E[Y])]$. The expression $X-E[X]$ in that formula is the centered version of $X$. So we already center $X$ when we take the covariance, and centering is an idempotent operator; once a variable is centered, applying the centering process further times doesn't change it. If the formula didn't take the centered versions of the variables, then there would all sort of weird effects, such as the covariance between temperature and another variable being different depending on whether we measure temperature in Celsius or Kelvin.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered 7 hours ago









                AcccumulationAcccumulation

                1,60626




                1,60626























                    2












                    $begingroup$

                    "somewhere" tends to be a rather unreliable source...



                    Covariance/correlation are defined with explicit centering. If you don't center the data, then you are not computing covariance/correlation. (Precisely: Pearson correlation)



                    The main difference is whether you center based on a theoretical model (e.g., the expected value is supposed to be exactly 0) or based on the data (arithmetic mean). It is easy to see that the arithmetic mean will yield smaller Covariance than any different center.



                    However, smaller covariance does not imply smaller correlation, or the opposite. Assume that we have data X=(1,2) and Y=(2,1). It is easy to see that with arithmetic mean centering this will yield perfectly negative correlation, while if we know the generating process produces 0 on average, the data is actually positively correlated.
                    So in this example, we are centering - but with the theoretical expected value of 0.



                    This can arise easily. Consider we have a sensor array, 11x11, with the cells numbered -5 to +5. Rather than taking the arithmetic mean, it does make sense to use the "physical" mean of our sensor array here when looking for the correlation of sensor events (if we enumerated the cells 0 to 10, we'd use 5 as fixed mean, and we would get the exact same results, so that indexing choice disappears from the analysis - nice).






                    share|cite|improve this answer









                    $endgroup$













                    • $begingroup$
                      Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
                      $endgroup$
                      – lvdp
                      10 hours ago
















                    2












                    $begingroup$

                    "somewhere" tends to be a rather unreliable source...



                    Covariance/correlation are defined with explicit centering. If you don't center the data, then you are not computing covariance/correlation. (Precisely: Pearson correlation)



                    The main difference is whether you center based on a theoretical model (e.g., the expected value is supposed to be exactly 0) or based on the data (arithmetic mean). It is easy to see that the arithmetic mean will yield smaller Covariance than any different center.



                    However, smaller covariance does not imply smaller correlation, or the opposite. Assume that we have data X=(1,2) and Y=(2,1). It is easy to see that with arithmetic mean centering this will yield perfectly negative correlation, while if we know the generating process produces 0 on average, the data is actually positively correlated.
                    So in this example, we are centering - but with the theoretical expected value of 0.



                    This can arise easily. Consider we have a sensor array, 11x11, with the cells numbered -5 to +5. Rather than taking the arithmetic mean, it does make sense to use the "physical" mean of our sensor array here when looking for the correlation of sensor events (if we enumerated the cells 0 to 10, we'd use 5 as fixed mean, and we would get the exact same results, so that indexing choice disappears from the analysis - nice).






                    share|cite|improve this answer









                    $endgroup$













                    • $begingroup$
                      Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
                      $endgroup$
                      – lvdp
                      10 hours ago














                    2












                    2








                    2





                    $begingroup$

                    "somewhere" tends to be a rather unreliable source...



                    Covariance/correlation are defined with explicit centering. If you don't center the data, then you are not computing covariance/correlation. (Precisely: Pearson correlation)



                    The main difference is whether you center based on a theoretical model (e.g., the expected value is supposed to be exactly 0) or based on the data (arithmetic mean). It is easy to see that the arithmetic mean will yield smaller Covariance than any different center.



                    However, smaller covariance does not imply smaller correlation, or the opposite. Assume that we have data X=(1,2) and Y=(2,1). It is easy to see that with arithmetic mean centering this will yield perfectly negative correlation, while if we know the generating process produces 0 on average, the data is actually positively correlated.
                    So in this example, we are centering - but with the theoretical expected value of 0.



                    This can arise easily. Consider we have a sensor array, 11x11, with the cells numbered -5 to +5. Rather than taking the arithmetic mean, it does make sense to use the "physical" mean of our sensor array here when looking for the correlation of sensor events (if we enumerated the cells 0 to 10, we'd use 5 as fixed mean, and we would get the exact same results, so that indexing choice disappears from the analysis - nice).






                    share|cite|improve this answer









                    $endgroup$



                    "somewhere" tends to be a rather unreliable source...



                    Covariance/correlation are defined with explicit centering. If you don't center the data, then you are not computing covariance/correlation. (Precisely: Pearson correlation)



                    The main difference is whether you center based on a theoretical model (e.g., the expected value is supposed to be exactly 0) or based on the data (arithmetic mean). It is easy to see that the arithmetic mean will yield smaller Covariance than any different center.



                    However, smaller covariance does not imply smaller correlation, or the opposite. Assume that we have data X=(1,2) and Y=(2,1). It is easy to see that with arithmetic mean centering this will yield perfectly negative correlation, while if we know the generating process produces 0 on average, the data is actually positively correlated.
                    So in this example, we are centering - but with the theoretical expected value of 0.



                    This can arise easily. Consider we have a sensor array, 11x11, with the cells numbered -5 to +5. Rather than taking the arithmetic mean, it does make sense to use the "physical" mean of our sensor array here when looking for the correlation of sensor events (if we enumerated the cells 0 to 10, we'd use 5 as fixed mean, and we would get the exact same results, so that indexing choice disappears from the analysis - nice).







                    share|cite|improve this answer












                    share|cite|improve this answer



                    share|cite|improve this answer










                    answered 14 hours ago









                    Anony-MousseAnony-Mousse

                    30k54178




                    30k54178












                    • $begingroup$
                      Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
                      $endgroup$
                      – lvdp
                      10 hours ago


















                    • $begingroup$
                      Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
                      $endgroup$
                      – lvdp
                      10 hours ago
















                    $begingroup$
                    Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
                    $endgroup$
                    – lvdp
                    10 hours ago




                    $begingroup$
                    Thanks @Anony-Mousse, will the sample covariance depend on the sample size? I.e. smaller sample size will yield smaller covariance ( before centering).
                    $endgroup$
                    – lvdp
                    10 hours ago


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Cross Validated!


                    • 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%2fstats.stackexchange.com%2fquestions%2f391838%2fdoes-mean-centering-reduce-covariance%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

                    Callistus I

                    Tabula Rosettana

                    How to label and detect the document text images