2
$\begingroup$

how come Matlab give me the result corr(u,v)=-1 u=[1 0]' and v=[0 1]' (i.e., two orthogonal column vectors, basis of the Euclidean plane ...)

Suddenly this makes no sense to me ... their scalar product = 0 ... they should be perfectly UNcorrelated?

i know it works out to -1 with the correlation formula $dot((x-mean(x)),(y-mean(y))/(norm(x)*norm(y))$ but could someone enlighten me ? (it's very frustrating ... i seem to miss something (and I have been working with such things for a while...)

To summarize: why (logical understanding point of view) are they negatively perfectly correlated (-1) whereas I would expect them to be perfectly UNCORRELATED (0) ?

$\endgroup$

1 Answer 1

2
$\begingroup$

We have two data points: (u[0], v[0]) and (u[1], v[1]). In terms of $x$ and $y$ axis, when $x=0$ then $y=1$. When $x=1$, $y$ went down and became $y=0$. So when $x$ increases, $y$ decreases. I wouldn't interpret the data points as vectors. Even if you were to interpret them as vectors, clearly the two vectors are orthogonal so there is perfect anti-correlation. No correlation means if $x$ is increasing $y$ stays the same

$\endgroup$
12
  • $\begingroup$ oh thanks yes of course it makes perfectly sense ... i wonder why I made this terrible confusion... any idea why? $\endgroup$
    – SheppLogan
    Commented Mar 17, 2018 at 17:37
  • $\begingroup$ Well it can be hard to see the relation when there are only two data points $\endgroup$
    – Andreas G.
    Commented Mar 17, 2018 at 17:39
  • $\begingroup$ yes that's true but what about orthogonality? How would you define "relation" or whatever we can call it, between correlation and orthogonal vectors such as U and V here $\endgroup$
    – SheppLogan
    Commented Mar 17, 2018 at 17:40
  • $\begingroup$ also the fact that there is a dot product in the definition of CORRELATION is misleading because as they are orthogonal... $\endgroup$
    – SheppLogan
    Commented Mar 17, 2018 at 17:43
  • $\begingroup$ Note that your two data points are not $u$ and $v$. $u$ contains all Xs and $v$ contains all Ys. Your data points are $(u[0], v[0])$ and $(u[1], v[1])$(which happen to be the same as $u$ and $v$). Nevertheless, you need to first subtract the mean from each direction and then visualize the vectors. You get something like $(0.5, -0.5)$ and $(-0.5, 0.5)$ which you can see they point in different directions. I will update my answer to add an intuitive explanation $\endgroup$
    – Andreas G.
    Commented Mar 17, 2018 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.