Load packages
library(tidyverse)
The correlation coefficient cannot exceed an absolute value of 1
This is well-known. But why is that the case? How can we proof it? This post gives one explanation using the Cauchy-Schwarz inequality.
Here’s one version of the definition of correlation:
where and are the differences of and , that is: , and similarly for .
For the ease of notation, let’s proceed with the understanding that stands for the differences, ie (and similarly for ):
Now, we conjecture that
Let’s multiply the equation by the denominator of the LHS:
The Cauchy Schwarz inequality states that
In words, the inner product (in its positive variant, ie ) is smaller or equal to the product of the vector norms.
Stated differently:
Which is what we wanted to proof in the first place.
Here’s a quite nice intuition on the Cauchy Schwarz inequality.