What is $\rho_{XY}$ when $X=0$ and $Y=0$? For all $X=Y$, $\rho_{XY}=1$ and this should be no exception. But using the following: $$\rho_{XY}=\frac{E(XY)-E(X)E(Y)}{\sqrt{Var(X)Var(Y)}}$$ yields a $\frac{0}{0}$ form. How do I take the limits or apply L'Hospital's rule to prove this equals 1?
2 Answers
The correlation is undefined. It should be an exception because the variance is zero.
To see why limits won't work, let $X$ be any random variable with a nonzero variance and (without any loss of generality) suppose it has a mean of zero. Then the sequences of bivariate random variables $(X/n, X/n)$ and $(X/n, -X/n)$ both converge in probability to $(0,0)$ as $n\to\infty$, but the correlations in the first sequence are all $1$ and those in the second sequence are all $-1$. Thus you cannot sneak up on a correlation for $(0,0)$ by taking limits--the limit of the correlations can be $1$, $-1$ (or indeed any value in between).
-
1$\begingroup$ The geometry should make this easy to see. Two variables identically zero collapse the data to a single point in the plane, which is consistent with any (every!) straight line through that point. If the slope of the line is indeterminate, the correlation is undefined. $\endgroup$– Nick CoxCommented Sep 4, 2013 at 14:06
-
$\begingroup$ @Nick It sounds like you might object to Peter Flom's answer, then, because when $Y$ has zero variance but $X$ does not, there geometrically is a line and it has zero slope, whereas he claims (correctly, I believe) that in such a case the correlation is still undefined. $\endgroup$– whuber ♦Commented Sep 4, 2013 at 16:26
-
$\begingroup$ I don't object to his argument. From the perspective I adopted there is also a contradiction. From the geometry $Y$ is perfectly predictable from $X$, but the converse isn't true, and for a correlation to be valid such a contradiction can't arise. $\endgroup$– Nick CoxCommented Sep 4, 2013 at 18:15
-
$\begingroup$ @Nick So we see that it's not purely a matter of the geometry of one point, is it? :-). Even prediction might not be the right way to be looking at this: after all, in the case where both variables have zero variance, each indeed is "perfectly predictable" from the other. That sounds like an argument that their correlation coefficient ought to be considered $1$! (Of course I'm just tweaking you a little bit--this is a truly minor issue and we have no disagreement--but sometimes an examination of such "edge" cases can provide deeper insight into the underlying concepts.) $\endgroup$– whuber ♦Commented Sep 4, 2013 at 18:21
-
1$\begingroup$ Very good point: predictability is not the only game. I was answering the original question, not claiming to provide a knock-down argument for all pathological cases. Arguments can collapse, or be refuted, for different reasons. For (constant, constant') no correlation is definable geometrically; For (constant, y) or (x, constant) no correlation can be defined consistently. I usually try to teach this as saying that you can't define a correlation if there isn't a linear relationship, but then the rest of the argument consists of a Pickwickian interpretation of "relationship". $\endgroup$– Nick CoxCommented Sep 4, 2013 at 18:30
$\frac{0}{0}$ seems correct to me. That is, it's meaningless. The correlation measures the linear relationship between two variables. But if either variable is a constant this is a meaningless idea. It isn't 0, it isn't 1, it's just ... not. So, $\frac{0}{0}$ seems right.