Re: Correlation of X with XY ?

From: Ray Koopman (koopman_at_sfu.ca)
Date: 09/27/04


Date: 26 Sep 2004 22:43:28 -0700

Charles Knapp wrote:
> "Ray Koopman" <koopman@sfu.ca> wrote in message
> news:1096241534.783487.155680@h37g2000oda.googlegroups.com...
>>
>> 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 ) )
>
> ?????????????

Google is certainly doing some wonderful reformatting here!!

Your last expression is ok as far as it goes.
What you're objecting to are my simplifications.

Your numerator is E{X^2}*E{Y}-E{X}*E{X}*E{Y}.
Factor out E{Y} to get (E{X^2}-E{X}*E{X})*E{Y},
rewrite that as (E{X^2}-E{X}^2)*E{Y},
and recognize that E{X^2}-E{X}^2 = Var{X},
giving Var{X}*E{Y}.

Your denominator is sqrt( Var{X}*( E{X^2}*E{Y^2}-E{X}^2*E{Y}^2 ) ).
Take Var{X} outside the sqrt as SD{X}
and divide it into the numerator,
giving SD{X}*E{Y}.

That leaves E{X^2}*E{Y^2}-E{X}^2*E{Y}^2 inside the sqrt.
Substitute E{X^2} = Var{X}+E{X}^2, and similarly for Y,
to get (Var{X}+E{X}^2)*(Var{Y}+E{Y}^2)-E{X}^2*E{Y}^2.
Expanding and cancelling gives
Var{X}*Var{Y} + Var{X}*E{Y}^2 + E{X}^2*Var{Y},
which is what I had inside the sqrt.


Loading