I was studying the concepts of covariance/correlation, and I had encountered something that I'm unsure about.
Is it possible to have three random variables, say $X$, $Y$ and $Z$, such that $\text{Corr}(X, Y ) > 0$ and $\text{Corr}(Y, Z) > 0$ but $\text{Corr}(X, Z) < 0$? After all, $\text{Corr}(X, Y) > 0$ would mean that, if $X$ is above/below its mean, then $Y$ tends to be above/below its mean too. Likewise $\text{Corr}(Y,Z)$ would mean that if $Y$ is above/below its mean, $Z$ tends to be above/below its mean too. But $\text{Corr}(X,Z) < 0$ would imply that, if $X$ is above/below its mean, then Z tends to be below/above its mean.
I would greatly appreciate it if people could please take the time to clarify this.
Yes it is possible: For example suppose the following three triplets are equally likely
then all three means are zero, and $\text{Corr}(X, Y ) > 0$ and $\text{Corr}(Y, Z) > 0$ but $\text{Corr}(X, Z) < 0$
There are many more examples