Correlation-based distance dissimilarity measure is not a metric Show by an example that the correlation-based distance
$d(X,X^\prime)=1-\rho(X,X^\prime)=1-\frac{\sum_{j=1}^p (X_j-\bar{X})((X_j^\prime-\bar{X}^\prime)}{\sqrt(\sum_{j=1}^p (X_j-\bar{X})^2\sum_{j=1}^p (X_j^\prime-\bar{X}^\prime)^2)}$ where $X, X^\prime ∈ R^p$,
is not strictly speaking a metric.
My understanding: We need to show that distance $d$ violates the triangle inequality, but how can I show this using example. I am kinda confused! Thank you so much for your suggestions!
 A: A metric $d$ is a function $M\times M\rightarrow\mathbb R_{\ge 0}$ that satisfies four conditions.

*

*For any $x\in M$, $d(x, x)=0$.


*For any unequal $x,y\in M$, $d(x, y)>0$.


*For any $x,y\in M$, $d(x, y)=d(y,x)$.


*For any $x,y,z\in M$, $d(x, y) + d(y,z) \ge d(x,z)$. This is the triangle inequality, and it means that it is no shorter to leave work, go to the store, and then go home than it is to go straight home from work.
Let $M=\mathbb R^p$, and define a function $d: M\times M\rightarrow \mathbb R_{\ge 0}$ by $d(X, Y) = 1 - \rho(X, Y)$ for any two elements $X, Y\in M$.

*

*$\rho(X, X) = 1$, so $1-\rho(X,X)=0$. We are good here.


*Let $p=2$, let $X=\left(1, 2\right)$, and let $Y=\left(2, 4\right)=2X$. Thus, $X$ and $Y$ are distinct. Then $d(X, Y) = 1-\rho(X, Y) = 1-\rho(X,2X)$. However, because of the construction of $Y$ as $2X$, $\rho(X, Y)=\rho(X, 2X) = \rho(X, X)$. Consequently, $d(X, Y) = 1-\rho(X, Y) = 1-\rho(X,2X) = 1-1=0$, yet the inputs to the metric function are distinct. Overall, $d$ cannot be a metric. Further, the square root of this $d$ will have this same issue of giving an output of zero despite getting distinct inputs, so $\sqrt{1 - \rho(X, Y)}$ is not a metric, either.
