Finding a distribution with a given correlation












1












$begingroup$


Below is a problem that I made up and my attempt at a solution to it. I am hoping that somebody here can help me finish it. I believe there is a unique
answer to the problem.

Thanks,

Bob



Problem:

Let $X$ and $Y$ be uniformly distributed independent variables on the interval $(-1,1)$. Let $K$ be
a real number. Let $Z = Y + KX$ such that the correlation of $X$ and $Z$ is $frac{1}{2}$. Find $K$.

Answer:

If we select $K = 0$ then we get a correlation of $0$. If we select $K$ to be a very large number
then the correlation will be close to $1$.
begin{align*}
rho &= frac{1}{2} \
u_x &= 0 \
u_y &= 0 \
u_z &= u_y + K(u_y) = 0 + K(0) = 0 \
sigma_x^2 &= frac{(1 - -1)^2}{12} = frac{4}{12} \
sigma_x^2 &= frac{1}{3} \
sigma_x &= frac{1}{sqrt{3}} \
sigma_y &= frac{1}{sqrt{3}} \
sigma^2_z &= sigma^2_y + K^2 sigma_x^2 + K(0) \
sigma^2_z &= frac{1}{3} + K^2 left( frac{1}{3} right) \
rho &= frac{sigma_x sigma_z}{sigma_{xz}} \
sigma_{xz} &= frac{sigma_x sigma_z}{rho} =
frac{ left( frac{1}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) }{frac{1}{2} }\
sigma_{xz} &= left( frac{2}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) \
sigma_{xz} &= left( frac{2}{3 sqrt{3}} right) left( K^2 + 1 right) \
end{align*}










share|cite|improve this question









$endgroup$

















    1












    $begingroup$


    Below is a problem that I made up and my attempt at a solution to it. I am hoping that somebody here can help me finish it. I believe there is a unique
    answer to the problem.

    Thanks,

    Bob



    Problem:

    Let $X$ and $Y$ be uniformly distributed independent variables on the interval $(-1,1)$. Let $K$ be
    a real number. Let $Z = Y + KX$ such that the correlation of $X$ and $Z$ is $frac{1}{2}$. Find $K$.

    Answer:

    If we select $K = 0$ then we get a correlation of $0$. If we select $K$ to be a very large number
    then the correlation will be close to $1$.
    begin{align*}
    rho &= frac{1}{2} \
    u_x &= 0 \
    u_y &= 0 \
    u_z &= u_y + K(u_y) = 0 + K(0) = 0 \
    sigma_x^2 &= frac{(1 - -1)^2}{12} = frac{4}{12} \
    sigma_x^2 &= frac{1}{3} \
    sigma_x &= frac{1}{sqrt{3}} \
    sigma_y &= frac{1}{sqrt{3}} \
    sigma^2_z &= sigma^2_y + K^2 sigma_x^2 + K(0) \
    sigma^2_z &= frac{1}{3} + K^2 left( frac{1}{3} right) \
    rho &= frac{sigma_x sigma_z}{sigma_{xz}} \
    sigma_{xz} &= frac{sigma_x sigma_z}{rho} =
    frac{ left( frac{1}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) }{frac{1}{2} }\
    sigma_{xz} &= left( frac{2}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) \
    sigma_{xz} &= left( frac{2}{3 sqrt{3}} right) left( K^2 + 1 right) \
    end{align*}










    share|cite|improve this question









    $endgroup$















      1












      1








      1





      $begingroup$


      Below is a problem that I made up and my attempt at a solution to it. I am hoping that somebody here can help me finish it. I believe there is a unique
      answer to the problem.

      Thanks,

      Bob



      Problem:

      Let $X$ and $Y$ be uniformly distributed independent variables on the interval $(-1,1)$. Let $K$ be
      a real number. Let $Z = Y + KX$ such that the correlation of $X$ and $Z$ is $frac{1}{2}$. Find $K$.

      Answer:

      If we select $K = 0$ then we get a correlation of $0$. If we select $K$ to be a very large number
      then the correlation will be close to $1$.
      begin{align*}
      rho &= frac{1}{2} \
      u_x &= 0 \
      u_y &= 0 \
      u_z &= u_y + K(u_y) = 0 + K(0) = 0 \
      sigma_x^2 &= frac{(1 - -1)^2}{12} = frac{4}{12} \
      sigma_x^2 &= frac{1}{3} \
      sigma_x &= frac{1}{sqrt{3}} \
      sigma_y &= frac{1}{sqrt{3}} \
      sigma^2_z &= sigma^2_y + K^2 sigma_x^2 + K(0) \
      sigma^2_z &= frac{1}{3} + K^2 left( frac{1}{3} right) \
      rho &= frac{sigma_x sigma_z}{sigma_{xz}} \
      sigma_{xz} &= frac{sigma_x sigma_z}{rho} =
      frac{ left( frac{1}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) }{frac{1}{2} }\
      sigma_{xz} &= left( frac{2}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) \
      sigma_{xz} &= left( frac{2}{3 sqrt{3}} right) left( K^2 + 1 right) \
      end{align*}










      share|cite|improve this question









      $endgroup$




      Below is a problem that I made up and my attempt at a solution to it. I am hoping that somebody here can help me finish it. I believe there is a unique
      answer to the problem.

      Thanks,

      Bob



      Problem:

      Let $X$ and $Y$ be uniformly distributed independent variables on the interval $(-1,1)$. Let $K$ be
      a real number. Let $Z = Y + KX$ such that the correlation of $X$ and $Z$ is $frac{1}{2}$. Find $K$.

      Answer:

      If we select $K = 0$ then we get a correlation of $0$. If we select $K$ to be a very large number
      then the correlation will be close to $1$.
      begin{align*}
      rho &= frac{1}{2} \
      u_x &= 0 \
      u_y &= 0 \
      u_z &= u_y + K(u_y) = 0 + K(0) = 0 \
      sigma_x^2 &= frac{(1 - -1)^2}{12} = frac{4}{12} \
      sigma_x^2 &= frac{1}{3} \
      sigma_x &= frac{1}{sqrt{3}} \
      sigma_y &= frac{1}{sqrt{3}} \
      sigma^2_z &= sigma^2_y + K^2 sigma_x^2 + K(0) \
      sigma^2_z &= frac{1}{3} + K^2 left( frac{1}{3} right) \
      rho &= frac{sigma_x sigma_z}{sigma_{xz}} \
      sigma_{xz} &= frac{sigma_x sigma_z}{rho} =
      frac{ left( frac{1}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) }{frac{1}{2} }\
      sigma_{xz} &= left( frac{2}{sqrt{3}} right) left( frac{1}{3} + K^2 left( frac{1}{3} right) right) \
      sigma_{xz} &= left( frac{2}{3 sqrt{3}} right) left( K^2 + 1 right) \
      end{align*}







      probability statistics






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 13 '18 at 23:20









      BobBob

      902514




      902514






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          As you show, Pearson's $r$ should be a function of $k$. We will find that function and solve for
          $r(k) = frac{1}{2}$.



          $r(A,B)$ may be calculated from the covariance $cov(A,B)$ and the standard deviations $sigma_A$ and $sigma_B$ as $frac{cov(A,B)} { sigma_A sigma_B}$.



          The covariance itself may be calculated as $E(AB) - E(A)E(B)$.



          With $A$ and $B$ independent and each symmetric around $0$, the second term is $0$.



          So with $Z = KX + Y$, we have $cov(X,Z) = E[X(kX+Y)] = E(KX^2) + E(XY)$.



          Again, with $X$ and $Y$ independent and each symmetric around $0$, the second term is $0$.



          $$ cov (X,Z) = E(KX^2) = KE(X^2) $$



          The second moment $E(X^2)$ of a continuous uniform distribution $(a^2 + ab + b^2)/3$ where $a$ and $b$
          are the bounds of the distribution. In this case, $(-1)^2 + (-1)*1 + 1^2 = 1 -1 + 1 = 1$.



          $$ cov(X,Z) = K frac{1}{3} = frac{K}{3}$$





          The variance $V(X)$ of a uniform distribution is $(b-a)^2/12$.
          begin{align*}
          V(X) &= frac{[1-(-1)]^2}{ 12 } = frac{2^2}{12} = frac{1}{3} \
          V(Z) &= V(KX+Y) = K^2*V(X)*V(Y) = K^2V(X) + V(X) = (K^2+1)V(X) \
          V(Z) &= frac{(K^2+1)}{3} \
          V(X)V(Z) &= frac{K^2+1}{9} \
          sigma(X)sigma(Z) &= sqrt{ frac{K^2+1}{9} } = frac{ sqrt{K^2+1} }{ 3 }\
          r(X,Z) &= frac{ frac{K}{3}}{ frac{sqrt{K^2+1}}{3}} = frac{K}{ sqrt{K^2+1)} } \
          end{align*}





          So for $r = frac{1}{2}$, $frac{K}{sqrt{K^2+1}} = frac{1}{2}$.



          $$ 2K = sqrt{K^2+1} $$



          We will square both sides, which will give two solutions for $K$, only one of which will be relevant.



          begin{align*}
          4K^2 &= K^2 + 1 \
          3K^2 - 1 &= 0 \
          end{align*}



          using $a^2 - b^2 = (a+b)(a-b)$, we see $(sqrt{3}K +1)(sqrt{3}K - 1) = 0$.



          $$ sqrt{3}K = 1 text{ OR } -1$$



          Since we can see in the original problem K must be positive to yield a positive correlation,
          $sqrt{3}K = 1$.



          $$ k = frac{1} {sqrt{3}} $$






          share|cite|improve this answer











          $endgroup$













            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%2f3038725%2ffinding-a-distribution-with-a-given-correlation%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$

            As you show, Pearson's $r$ should be a function of $k$. We will find that function and solve for
            $r(k) = frac{1}{2}$.



            $r(A,B)$ may be calculated from the covariance $cov(A,B)$ and the standard deviations $sigma_A$ and $sigma_B$ as $frac{cov(A,B)} { sigma_A sigma_B}$.



            The covariance itself may be calculated as $E(AB) - E(A)E(B)$.



            With $A$ and $B$ independent and each symmetric around $0$, the second term is $0$.



            So with $Z = KX + Y$, we have $cov(X,Z) = E[X(kX+Y)] = E(KX^2) + E(XY)$.



            Again, with $X$ and $Y$ independent and each symmetric around $0$, the second term is $0$.



            $$ cov (X,Z) = E(KX^2) = KE(X^2) $$



            The second moment $E(X^2)$ of a continuous uniform distribution $(a^2 + ab + b^2)/3$ where $a$ and $b$
            are the bounds of the distribution. In this case, $(-1)^2 + (-1)*1 + 1^2 = 1 -1 + 1 = 1$.



            $$ cov(X,Z) = K frac{1}{3} = frac{K}{3}$$





            The variance $V(X)$ of a uniform distribution is $(b-a)^2/12$.
            begin{align*}
            V(X) &= frac{[1-(-1)]^2}{ 12 } = frac{2^2}{12} = frac{1}{3} \
            V(Z) &= V(KX+Y) = K^2*V(X)*V(Y) = K^2V(X) + V(X) = (K^2+1)V(X) \
            V(Z) &= frac{(K^2+1)}{3} \
            V(X)V(Z) &= frac{K^2+1}{9} \
            sigma(X)sigma(Z) &= sqrt{ frac{K^2+1}{9} } = frac{ sqrt{K^2+1} }{ 3 }\
            r(X,Z) &= frac{ frac{K}{3}}{ frac{sqrt{K^2+1}}{3}} = frac{K}{ sqrt{K^2+1)} } \
            end{align*}





            So for $r = frac{1}{2}$, $frac{K}{sqrt{K^2+1}} = frac{1}{2}$.



            $$ 2K = sqrt{K^2+1} $$



            We will square both sides, which will give two solutions for $K$, only one of which will be relevant.



            begin{align*}
            4K^2 &= K^2 + 1 \
            3K^2 - 1 &= 0 \
            end{align*}



            using $a^2 - b^2 = (a+b)(a-b)$, we see $(sqrt{3}K +1)(sqrt{3}K - 1) = 0$.



            $$ sqrt{3}K = 1 text{ OR } -1$$



            Since we can see in the original problem K must be positive to yield a positive correlation,
            $sqrt{3}K = 1$.



            $$ k = frac{1} {sqrt{3}} $$






            share|cite|improve this answer











            $endgroup$


















              0












              $begingroup$

              As you show, Pearson's $r$ should be a function of $k$. We will find that function and solve for
              $r(k) = frac{1}{2}$.



              $r(A,B)$ may be calculated from the covariance $cov(A,B)$ and the standard deviations $sigma_A$ and $sigma_B$ as $frac{cov(A,B)} { sigma_A sigma_B}$.



              The covariance itself may be calculated as $E(AB) - E(A)E(B)$.



              With $A$ and $B$ independent and each symmetric around $0$, the second term is $0$.



              So with $Z = KX + Y$, we have $cov(X,Z) = E[X(kX+Y)] = E(KX^2) + E(XY)$.



              Again, with $X$ and $Y$ independent and each symmetric around $0$, the second term is $0$.



              $$ cov (X,Z) = E(KX^2) = KE(X^2) $$



              The second moment $E(X^2)$ of a continuous uniform distribution $(a^2 + ab + b^2)/3$ where $a$ and $b$
              are the bounds of the distribution. In this case, $(-1)^2 + (-1)*1 + 1^2 = 1 -1 + 1 = 1$.



              $$ cov(X,Z) = K frac{1}{3} = frac{K}{3}$$





              The variance $V(X)$ of a uniform distribution is $(b-a)^2/12$.
              begin{align*}
              V(X) &= frac{[1-(-1)]^2}{ 12 } = frac{2^2}{12} = frac{1}{3} \
              V(Z) &= V(KX+Y) = K^2*V(X)*V(Y) = K^2V(X) + V(X) = (K^2+1)V(X) \
              V(Z) &= frac{(K^2+1)}{3} \
              V(X)V(Z) &= frac{K^2+1}{9} \
              sigma(X)sigma(Z) &= sqrt{ frac{K^2+1}{9} } = frac{ sqrt{K^2+1} }{ 3 }\
              r(X,Z) &= frac{ frac{K}{3}}{ frac{sqrt{K^2+1}}{3}} = frac{K}{ sqrt{K^2+1)} } \
              end{align*}





              So for $r = frac{1}{2}$, $frac{K}{sqrt{K^2+1}} = frac{1}{2}$.



              $$ 2K = sqrt{K^2+1} $$



              We will square both sides, which will give two solutions for $K$, only one of which will be relevant.



              begin{align*}
              4K^2 &= K^2 + 1 \
              3K^2 - 1 &= 0 \
              end{align*}



              using $a^2 - b^2 = (a+b)(a-b)$, we see $(sqrt{3}K +1)(sqrt{3}K - 1) = 0$.



              $$ sqrt{3}K = 1 text{ OR } -1$$



              Since we can see in the original problem K must be positive to yield a positive correlation,
              $sqrt{3}K = 1$.



              $$ k = frac{1} {sqrt{3}} $$






              share|cite|improve this answer











              $endgroup$
















                0












                0








                0





                $begingroup$

                As you show, Pearson's $r$ should be a function of $k$. We will find that function and solve for
                $r(k) = frac{1}{2}$.



                $r(A,B)$ may be calculated from the covariance $cov(A,B)$ and the standard deviations $sigma_A$ and $sigma_B$ as $frac{cov(A,B)} { sigma_A sigma_B}$.



                The covariance itself may be calculated as $E(AB) - E(A)E(B)$.



                With $A$ and $B$ independent and each symmetric around $0$, the second term is $0$.



                So with $Z = KX + Y$, we have $cov(X,Z) = E[X(kX+Y)] = E(KX^2) + E(XY)$.



                Again, with $X$ and $Y$ independent and each symmetric around $0$, the second term is $0$.



                $$ cov (X,Z) = E(KX^2) = KE(X^2) $$



                The second moment $E(X^2)$ of a continuous uniform distribution $(a^2 + ab + b^2)/3$ where $a$ and $b$
                are the bounds of the distribution. In this case, $(-1)^2 + (-1)*1 + 1^2 = 1 -1 + 1 = 1$.



                $$ cov(X,Z) = K frac{1}{3} = frac{K}{3}$$





                The variance $V(X)$ of a uniform distribution is $(b-a)^2/12$.
                begin{align*}
                V(X) &= frac{[1-(-1)]^2}{ 12 } = frac{2^2}{12} = frac{1}{3} \
                V(Z) &= V(KX+Y) = K^2*V(X)*V(Y) = K^2V(X) + V(X) = (K^2+1)V(X) \
                V(Z) &= frac{(K^2+1)}{3} \
                V(X)V(Z) &= frac{K^2+1}{9} \
                sigma(X)sigma(Z) &= sqrt{ frac{K^2+1}{9} } = frac{ sqrt{K^2+1} }{ 3 }\
                r(X,Z) &= frac{ frac{K}{3}}{ frac{sqrt{K^2+1}}{3}} = frac{K}{ sqrt{K^2+1)} } \
                end{align*}





                So for $r = frac{1}{2}$, $frac{K}{sqrt{K^2+1}} = frac{1}{2}$.



                $$ 2K = sqrt{K^2+1} $$



                We will square both sides, which will give two solutions for $K$, only one of which will be relevant.



                begin{align*}
                4K^2 &= K^2 + 1 \
                3K^2 - 1 &= 0 \
                end{align*}



                using $a^2 - b^2 = (a+b)(a-b)$, we see $(sqrt{3}K +1)(sqrt{3}K - 1) = 0$.



                $$ sqrt{3}K = 1 text{ OR } -1$$



                Since we can see in the original problem K must be positive to yield a positive correlation,
                $sqrt{3}K = 1$.



                $$ k = frac{1} {sqrt{3}} $$






                share|cite|improve this answer











                $endgroup$



                As you show, Pearson's $r$ should be a function of $k$. We will find that function and solve for
                $r(k) = frac{1}{2}$.



                $r(A,B)$ may be calculated from the covariance $cov(A,B)$ and the standard deviations $sigma_A$ and $sigma_B$ as $frac{cov(A,B)} { sigma_A sigma_B}$.



                The covariance itself may be calculated as $E(AB) - E(A)E(B)$.



                With $A$ and $B$ independent and each symmetric around $0$, the second term is $0$.



                So with $Z = KX + Y$, we have $cov(X,Z) = E[X(kX+Y)] = E(KX^2) + E(XY)$.



                Again, with $X$ and $Y$ independent and each symmetric around $0$, the second term is $0$.



                $$ cov (X,Z) = E(KX^2) = KE(X^2) $$



                The second moment $E(X^2)$ of a continuous uniform distribution $(a^2 + ab + b^2)/3$ where $a$ and $b$
                are the bounds of the distribution. In this case, $(-1)^2 + (-1)*1 + 1^2 = 1 -1 + 1 = 1$.



                $$ cov(X,Z) = K frac{1}{3} = frac{K}{3}$$





                The variance $V(X)$ of a uniform distribution is $(b-a)^2/12$.
                begin{align*}
                V(X) &= frac{[1-(-1)]^2}{ 12 } = frac{2^2}{12} = frac{1}{3} \
                V(Z) &= V(KX+Y) = K^2*V(X)*V(Y) = K^2V(X) + V(X) = (K^2+1)V(X) \
                V(Z) &= frac{(K^2+1)}{3} \
                V(X)V(Z) &= frac{K^2+1}{9} \
                sigma(X)sigma(Z) &= sqrt{ frac{K^2+1}{9} } = frac{ sqrt{K^2+1} }{ 3 }\
                r(X,Z) &= frac{ frac{K}{3}}{ frac{sqrt{K^2+1}}{3}} = frac{K}{ sqrt{K^2+1)} } \
                end{align*}





                So for $r = frac{1}{2}$, $frac{K}{sqrt{K^2+1}} = frac{1}{2}$.



                $$ 2K = sqrt{K^2+1} $$



                We will square both sides, which will give two solutions for $K$, only one of which will be relevant.



                begin{align*}
                4K^2 &= K^2 + 1 \
                3K^2 - 1 &= 0 \
                end{align*}



                using $a^2 - b^2 = (a+b)(a-b)$, we see $(sqrt{3}K +1)(sqrt{3}K - 1) = 0$.



                $$ sqrt{3}K = 1 text{ OR } -1$$



                Since we can see in the original problem K must be positive to yield a positive correlation,
                $sqrt{3}K = 1$.



                $$ k = frac{1} {sqrt{3}} $$







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited Dec 19 '18 at 2:52

























                answered Dec 18 '18 at 23:21









                Dvd AvinsDvd Avins

                1161




                1161






























                    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%2f3038725%2ffinding-a-distribution-with-a-given-correlation%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

                    Bressuire

                    Cabo Verde

                    Gyllenstierna