Re: Correlation of X with XY ?

From: Charles Knapp (nowhere_at_nomailspam.com)
Date: 09/27/04

  • Next message: Charles Knapp: "Re: Correlation of X with XY ?"
    Date: Sun, 26 Sep 2004 23:34:41 -0400
    
    

    "Ray Koopman" <koopman@sfu.ca> wrote in message
    news:1096241534.783487.155680@h37g2000oda.googlegroups.com...
    > Charles Knapp wrote:
    > > "Ray Koopman" <koopman@sfu.ca> wrote in message
    > > news:1096227018.840862.156010@h37g2000oda.googlegroups.com...
    > >> Charles Knapp wrote:
    > >>> But I have a computer program which uses the built in (BASIC)
    > >>> random number generator which is a "rectangular" distribution with
    > >>> Mean=.5 and std. Deviation = .2889 (the range is (0<x<1).
    > >>> This gives a correlation between X and XY of about .6 .... clearly
    > >>> not ZERO.
    > >>> Is this because XY is "nonlinear" meaning that the corellation
    > >>> with X will depend critically on the "mean" and the "variance"
    > >>> whatever X and Y that you happen to use?
    > >>
    > >> Corr[x,xy] = Cov[x,xy]/(SD[x] SD[y]).
    > >
    > > There seems to be something wrong with this, shouldn't it read:
    > >
    > > Corr[x,xy] = Cov[x,xy]/(SD[x]SD[xy]) ????
    > >
    > > this is not identical to your equation above ????
    > >
    > >>
    > >> Cov[x,xy] = E[x^2 y] - E[x] E[xy].
    > >>
    > >> If x and y are independent then
    > >>
    > >> E[x^2 y] = E[x^2] E[y] and E[xy] = E[x] E[y].
    > >>
    > >> Substituting gives
    > >>
    > >> Cov[x,xy] = E[x^2] E[y] - E[x]^2 E[y]
    > >> = Var[x] E[y],
    > >
    > > There seems to be something wrong with this too
    > > because:
    > >
    > > E[x^2] =/= E[x]^2 ????
    > >
    > > i.e. Var[x] =/= (Mean[x])^2 ????
    > >
    > >>
    > >> and Corr[x,xy] = SD[x] E[y] / SD[y].
    > >
    > > Therefore, I don't think this is correct ????
    > > But I think you know how to produce the correct answer
    > > if you correct your mistakes.
    > >
    > > Can you give me the corrected expression for:
    > >
    > > Corr[x,xy] = ????????????????
    >
    > You're right, SD[y] in the denominator should be SD[xy],
    > which complicates matters. However, the numerator is correct.
    >
    > Corr[x,xy] = Cov[x,xy]/(SD[x] SD[xy]).
    >
    > Cov[x,xy] = E[x^2 y] - E[x] E[xy].
    >
    > Var[xy] = E[x^2 y^2] - E[xy]^2.
    >
    > If x and y are independent then
    >
    > E[x^2 y] = E[x^2] E[y], E[xy] = E[x] E[y],
    >
    > and E[x^2 y^2] = E[x^2] E[y^2].
    >
    > Substituting gives
    >
    > Cov[x,xy] = E[x^2] E[y] - E[x](E[x] E[y])
    >
    > = (E[x^2] - E[x]^2) E[y]
    >
    > = Var[x] E[y],

         OK, the above eqn looks correct

    >
    > Var[xy] = E[x^2] E[y^2] - (E[x] E[y])^2

       Ok, the above eqn. is correct

    >
    > = (Var[x] + E[x]^2)(Var[y] + E[y]^2) - E[x]^2 E[y]^2

    No, this eqn is not correct. It is not equal to the line above it.

    >
    > = Var[x] Var[y] + Var[x] E[y]^2 + E[x]^2 Var[y],
    >
    > SD[x] E[y]
    > and Corr[x,xy] = ----------------------------------------------------.
    > Sqrt(Var[x] Var[y] + Var[x] E[y]^2 + E[x]^2 Var[y])

    Boy..... we're sure a long way apart..... I get:

                                          E{X^2}*E{Y}-E{X}*E{X}*E{Y}
    Corr(x,xy) = ------------------- -------------------------------------
                                 sqrt( Var{X}*( E{X^2}*E{Y^2}-E{X}^2*E{Y}^2 ) )

    ?????????????


  • Next message: Charles Knapp: "Re: Correlation of X with XY ?"

    Relevant Pages

    • Re: Correlation of X with XY ?
      ... > Charles Knapp wrote: ... However, the numerator is correct. ... > Substituting gives ... this eqn is not correct. ...
      (sci.stat.math)
    • Re: Correlation of X with XY ?
      ... Charles Knapp wrote: ... >> Substituting gives ... which complicates matters. ... However, the numerator is correct. ...
      (sci.stat.math)