Hacker News new | ask | show | jobs
by credit_guy 3001 days ago
In case anyone's wondering, here's a simple example of 3 variables so that the first is positively correlated with the second, the second positively correlated with the third, but the first and the third have a negative correlation: simply take 3 independent standard normal variables, X, Y, Z, and define our 3 variables to be u=X+Y, v=Y+Z, w=Z-X. Then correl(u,v)=0.5, correl(v,w)=0.5 and correl(u,w)=-0.5.