Correlation cannot be more extreme than +1/-1, proof using Cauchy-Schwarz inequality

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:

r=(ΔxΔy)Δx2Δy2

where Δx and Δy are the differences of xi and x¯, that is: Δxi=xix¯, and similarly for Δyi.

For the ease of notation, let’s proceed with the understanding that x stands for the differences, ie Δx (and similarly for y):

r=(xy)x2y2

Now, we conjecture that

r=(xy)x2y21

Let’s multiply the equation by the denominator of the LHS:

(xy)x2y2

The Cauchy Schwarz inequality states that

|x,y|||x||||y||

In words, the inner product x,y (in its positive variant, ie >0) is smaller or equal to the product of the vector norms.

Stated differently:

xyx2y2

Which is what we wanted to proof in the first place.

Here’s a quite nice intuition on the Cauchy Schwarz inequality.