1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to work out Covariance ?

  1. May 25, 2008 #1
    1. The problem statement, all variables and given/known data

    I have a joint pdf f_{XY}(x,y) = (2+x+y)/8

    and I have to find cov(x,y)
    2. Relevant equations
    Now I know the formula is cov(X,Y)=E((X-mu)(Y-v)) where E(X)=mu and E(Y)=v

    Well I found that formula on wikipedia, but it doesn't make sense to me because if E(X)=mu then doesn't E(X-mu) equal zero?

    Well thats my main problem, I dont know how to use the formula.

    3. The attempt at a solution

    I've worked out the distribution table to see if that would help

    . . . . y
    . . . -1___0___1
    . -1 0, 1/8, 1/4 (X=-1) =3/8
    x 0 1/8, 1/4, 3/8 (X=0) =3/4
    . .1 1/4, 3/8, 1/2 (X=1)=1/18
    (Y=-1) = 3/8 (Y=0)=3/4 (Y=1) = 1/1/8

    Sorry its not in LaTex I couldn't remember how to start the code.

    I've also worked out that the var(Y) = 1 if that is any help? I have an exam on this very soon and I really want to be able to get a hold of all the main concepts... thanks for any information
  2. jcsd
  3. May 25, 2008 #2
    [tex]cov(X,Y) = E[(X-\mu)(Y-\nu)] = E(X Y) - \mu \nu[/tex]

    You are right to say that [tex]E(X) = \mu, E(Y) = \nu[/tex] which is why the cross terms are gone, but...

    since the pdf is not separable the variables are correlated and [tex]E(XY) \neq E(X) E(Y)[/tex] and your expression is non-zero.

    You must evaluate the expectation values by integration. What is your domain? I ask that because it can't be over the whole space, because your pdf would be non-normalizable.
  4. May 25, 2008 #3
    The expectation value for a random variable, say for example [tex]X^3 Y^2[/tex], is given by

    [tex]E(X^3 Y^2) = \int dx dy f(x,y) x^3 y^2[/tex] if your distribution is already normalized else it's given by

    [tex]E(X^3 Y^2) = \frac{\int dx dy f(x,y) x^3 y^2}{\int dx dy f(x,y)}[/tex]
  5. May 26, 2008 #4
    The domain is -1 < x < 1 and -1 < y < 1
  6. May 26, 2008 #5


    User Avatar

    Out of curiosity, why would she need to normalize it? From what I understand normalizing would be done to find the correlation matrix.
    Last edited: May 26, 2008
  7. May 26, 2008 #6
    Well the expectation value/mean/average wouldn't be uniquely defined otherwise. It has nothing to do with the correlation matrix, it has to do with the fact that [itex]E(1) = \int f dA = P(\textup{entire domain}) = 1[/itex]. See, it's just one step from an axiom of probability theory.
  8. May 26, 2008 #7


    User Avatar

    Ah of course. I usually check that the pdf integrates to 1 over the domain (general case with classroom problems) and it slipped my mind that this may not be a case like that.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: How to work out Covariance ?