1 year ago
#375885
Emmanuel Goldstein
Understanding analogy between correlation formulas in Matlab for correlation coefficient
I'm having a hard time understanding that these formulas for computing the correlation coefficient are identical (let x and y be column vectors):
cov(x,y)/(std(x)*std(y))
((zscore(x)')*zscore(y))/(length(x)-1)
((x-mean(x))'*(y-mean(y)))/sqrt(sum((x-mean(x)).^2)*sum((y-mean(y)).^2 ))
Why in (3) we don't divide by N-2 yet the result is correct?
matlab
correlation
0 Answers
Your Answer