Skip to content
Part IA Easter Term

Correlation

Definition

The correlation coefficient (Pearson correlation) is the normalised covariance:

ρX,Y=Cov(X,Y)σXσY\rho_{X,Y} = \frac{\text{Cov}(X, Y)}{\sigma_X \sigma_Y}

where σX=Var(X)\sigma_X = \sqrt{\text{Var}(X)} and σY=Var(Y)\sigma_Y = \sqrt{\text{Var}(Y)}.

Properties

1. Unitless

Correlation has no units, making it comparable across different measurements.

2. Range

1ρX,Y1-1 \leq \rho_{X,Y} \leq 1

Proof (Cauchy-Schwarz): Consider E[(a(XE[X])+b(YE[Y]))2]0E[(a(X-E[X]) + b(Y-E[Y]))^2] \geq 0.

3. Interpretation

ρ\rhoRelationship
ρ=1\rho = 1Perfect positive linear relationship
ρ=1\rho = -1Perfect negative linear relationship
ρ=0\rho = 0No linear relationship
ρ>0\rho > 0Positive linear association
ρ<0\rho < 0Negative linear association

4. Linear Transformation Invariant

ρaX+b,cY+d=sign(ac)ρX,Y\rho_{aX+b, cY+d} = \text{sign}(ac) \cdot \rho_{X,Y}

Correlation doesn’t change if we scale or shift XX and YY.

Visual Interpretation

Correlation scatter plots

  • ρ1\rho \approx 1: points cluster along a line with positive slope
  • ρ1\rho \approx -1: points cluster along a line with negative slope
  • ρ0\rho \approx 0: no linear pattern

Proof of Range

By Cauchy-Schwarz for random variables:

E[UV]2E[U2]E[V2]E[UV]^2 \leq E[U^2] E[V^2]

Let U=XE[X]U = X - E[X] and V=YE[Y]V = Y - E[Y]:

Cov(X,Y)2Var(X)Var(Y)\text{Cov}(X, Y)^2 \leq \text{Var}(X) \cdot \text{Var}(Y)

ρ2=Cov(X,Y)2Var(X)Var(Y)1\rho^2 = \frac{\text{Cov}(X,Y)^2}{\text{Var}(X)\text{Var}(Y)} \leq 1

Thus ρ1|\rho| \leq 1.

When is ρ=±1\rho = \pm 1?

ρ=1\rho = 1 if and only if Y=aX+bY = aX + b for some a>0a > 0 (perfect positive linear).

ρ=1\rho = -1 if and only if Y=aX+bY = aX + b for some a<0a < 0 (perfect negative linear).

Independence vs Zero Correlation

  • Independent ρ=0\Rightarrow \rho = 0
  • ρ=0\rho = 0 does NOT \Rightarrow independent

Counterexample

Let XX be uniform on {1,0,1}\{-1, 0, 1\}, and Y=X2Y = X^2.

Cov(X,Y)=E[X3]E[X]E[X2]=00=0\text{Cov}(X, Y) = E[X^3] - E[X]E[X^2] = 0 - 0 = 0

ρ=0\rho = 0, but XX and YY are clearly dependent (knowing XX determines YY).

The issue: correlation measures linear dependence only. Y=X2Y = X^2 is a perfect nonlinear relationship.

Sample Correlation

From data (X1,Y1),,(Xn,Yn)(X_1, Y_1), \ldots, (X_n, Y_n):

r=(XiXˉ)(YiYˉ)(XiXˉ)2(YiYˉ)2r = \frac{\sum(X_i - \bar{X})(Y_i - \bar{Y})}{\sqrt{\sum(X_i - \bar{X})^2} \sqrt{\sum(Y_i - \bar{Y})^2}}

Example

From earlier: drawing cards, Cov(X,Y)=1272\text{Cov}(X, Y) = -\frac{1}{272}.

Var(X)=1434=316\text{Var}(X) = \frac{1}{4} \cdot \frac{3}{4} = \frac{3}{16}, same for Var(Y)\text{Var}(Y).

ρ=1/2723/163/16=1/2723/16=162723=151\rho = \frac{-1/272}{\sqrt{3/16} \cdot \sqrt{3/16}} = \frac{-1/272}{3/16} = -\frac{16}{272 \cdot 3} = -\frac{1}{51}

Small negative correlation.

Summary

PropertyValue
Definitionρ=Cov(X,Y)σXσY\rho = \frac{\text{Cov}(X,Y)}{\sigma_X \sigma_Y}
Range[1,1][-1, 1]
ρ=1\rho = 1Perfect positive linear
ρ=1\rho = -1Perfect negative linear
ρ=0\rho = 0No linear relationship
LimitationDoesn’t capture nonlinear dependence