Skip to main content
Albero Academy

Correlation & Covariance

Measuring how two variables move together.

Descriptive Statistics8 min

Covariance and correlation measure how two variables change together. Correlation is the standardised, interpretable version — a number from −1 to +1 that summarises the strength and direction of a linear relationship.

Correlation

correlation coefficient
import numpy as np
hours = [1, 2, 3, 4, 5]
scores = [52, 61, 68, 80, 88]
np.corrcoef(hours, scores)[0, 1] # ≈ 0.99 — strong positive

A correlation near +1 means the variables rise together; near −1, one rises as the other falls; near 0, no linear relationship. Covariance measures the same idea but in unstandardised units, so it's hard to interpret directly.

Key takeaways

  1. 01Covariance and correlation measure how two variables move together.
  2. 02Correlation is standardised: −1 (perfect negative) to +1 (perfect positive), 0 = no linear link.
  3. 03It captures only linear relationships — a curve can have ~0 correlation.
  4. 04Correlation does not imply causation; always plot the data too.

Finished this chapter?

Mark it complete to track your progress through Statistics.