# Variance of Signum Function of Two Random Variables

Let $X$ and $Y$ be two random variables with means $\mu_X$ and $\mu_Y$ respectively, as well as variances $\sigma_X$ and $\sigma_Y$ (all of which exist). I am interested in computing the following variance:

$$Var[sgn(X-Y)]$$

where, of course, sgn denotes the Signum Function.

I am stuck because the closed form of $sgn(X-Y)$ is of the form $(X-Y)/|X-Y|$, at least for $X \ne Y$, and I don't see any straightforward ways of calculating the variance of this quantity. Does anyone know how to go about this?

Edit: We may assume $Cov(X, Y)$ exists.

• What do you know about the covariance? And you'll need more from the distributions than just a mean and variance.
– Paul
Feb 11, 2016 at 14:09
• It may be easier to write $V[sgn(X-Y)]=E[(sgn(X-Y))^2] - E[sgn(X-Y)]^2$ Feb 11, 2016 at 14:15
• @Paul I edited the question. Feb 11, 2016 at 16:41
• @Augustin You're right, please see my comment for the first answer. Feb 11, 2016 at 16:42

We have that \begin{align} \operatorname E\mathrm{sgn}(X-Y) & =-1\cdot\Pr(X<Y)+0\cdot\Pr(X<Y)+1\cdot\Pr(X>Y) \\ & =\Pr(X>Y)-\Pr(X<Y) \end{align} and \begin{align} \operatorname E\mathrm{sgn}^2(X-Y) & =(-1)^2\cdot\Pr(X<Y)+0^2\cdot\Pr(X<Y)+1^2\cdot\Pr(X>Y) \\ & =\Pr(X>Y)+\Pr(X<Y) \end{align} using the law of the unconscious statistician. Hence, \begin{align} \operatorname{Var}\mathrm{sgn}(X-Y) &=\Pr(X>Y)+\Pr(X<Y)-[\Pr(X>Y)-\Pr(X<Y)]^2. \end{align}
• This does not directly answer my question, since I didn't say I know the distributions of X and Y, or their joint distribution (which I don't). I know they are continuous, hence $P(X \lt Y) = P(X \le Y)$, so it is easy to see that $E(sgn^2(X-Y)) = 1$, but I don't see an obvious way of computing $E(sgn(X-Y))$. But thank you for your answer. Feb 11, 2016 at 16:39
• Without further information about $X$ and $Y$ (i.i.d. for example), we can't go further than $P(X>Y)-P(X<Y)$. Feb 11, 2016 at 16:48