Covariance measures joint variation around the means

← Back to Blog & Articles

Covariance records whether two variables tend to lie above or below their own means together. Its value depends on the units and scale of both variables.

Worked example

If larger study times tend to accompany larger practice scores, their centered products tend to be positive. If one variable tends to be above its mean when the other is below its mean, the centered products tend to be negative. Averaging those products, with the chosen population or sample convention, produces a covariance estimate.

What to check

Check which convention a library uses. The usual sample covariance divides by n minus one, while a population calculation divides by n. Correlation rescales covariance by the variables’ standard deviations and needs nonzero variances. A strong covariance or correlation alone does not establish a causal effect. Shared causes, selection, and the way data were collected can also produce the observed relationship.

Continue with the book

Explore the full treatment, worked examples, and exercises in Mathematics for AI and Machine Learning.


Companion article for Mathematics for AI and Machine Learning, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top