Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Co-Variance and Signum Function

  1. Oct 30, 2011 #1
    I have a problem that turned up in my research. I'm a microelectronics engineer, s I hope this is not a textbook question for you physics specialists :-)

    Given a random variable X that produces real numbers x with a distribution p(x).

    The random variable Y is generated from X by the signum function; i.e., y=1 for x>=0 and y=-1 for x<0.

    How can I calculate the covariance of X and Y in general? And, if there is no general solution, does a solution exist if p(x) is a gaussian distribution with mean zero?

    Slainte!
    Hanspeter
     
  2. jcsd
  3. Oct 30, 2011 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    If we use E(X) to denote the expected value of X, you need to compute
    E(XY) - E(X)E(Y). The expectations would be computed as integrals. For example, to compute E(XY)

    [tex] E(XY) = \int_0^\infty x(1) p(x) dx + \int_{-\infty}^0 x(-1) p(x) dx [/tex]
    [tex] = \int_0^\infty x p(x)dx - \int_{-\infty}^0 x p(x) dx [/tex]
     
  4. Oct 31, 2011 #3
    Thanks a lot for the reply, this is indeed what I needed. If E(X)=0, then E(Y)=0 and the Covariance is simply the mean value of the positive half of p(x) minus the mean value of the negative half of p(x).

    To test my understanding, I did (MATLAB):

    c=randn(1,1000000);
    d=sign(c);
    cov(c,d)

    ans =

    1.0000 0.7981
    0.7981 1.0000

    mean(c.*(d>=0))-mean(c.*(d<0))

    ans =

    0.7981


    Now comes the mathematically more difficult part: to calculate p(x) in my system depending on the parameters of the system. But hat I know how to to, so thanks a lot for giving me such a good start.

    Hanspeter
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook