Center pairs and sum their products
Each xi is paired with yi from the same observation. Separate sorting must not change the pairs.[1]
Same-sign deviations give positive products and opposite signs negative ones. Contributions may cancel partly or completely. The n−1 denominator is the unbiased sample-estimation convention:for iid pairs with finite second moments, its expectation is the population covariance. Normality is unnecessary.[1][2]
A second computational identity
Expand and useΣxi=nx̄ andΣyi=nȳ to obtain the same centered sum.[1]
This identity is a useful independent check for small exact data. For large nearly equal numbers, the raw subtraction can lose precision; stable centering matters more than a short expression. Do not round means before forming products. Missing observations need an explicit paired-data policy rather than silently shifted lists.[1]
Units, conventions and limits
Centering removes translation constants; scalings multiply covariance.[2]
Covariance carries the product of both variable units. Correlation divides by their standard deviations and is dimensionless when both spreads are positive. A descriptive convention dividing by n gives a different quantity and is not universally wrong; state which one you use. Zero covariance does not generally imply independence, and positive covariance does not prove causality.[2]
Two worked examples
Paired data without premature rounding
- Given
- x=(1,2,3), y=(2,4,8).
- Find
- Find sample covariance with n−1.
Compute the means exactly.
Multiply centered pairs and sum.
Result: sxᵧ=3 in the data’s product units.
Check: The raw-sum check gives[34−(6·14)/3]/2=3.
Opposing deviations
- Given
- x=(1,2,3), y=(3,2,1).
- Find
- Compute the negative sign.
Both means are 2.
Divide by n−1=2.
Result: Sample covariance is−1.
Check: The paired deviations oppose each other; the two lists have not been sorted independently.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Five exercises with solutions
Calculate · Foundation
Find sxᵧ for x=(0,1,2), y=(1,3,5).
Show hint
The means are 1 and 3.
Learning goal: Compute a centered-product sum.
Rearrange · Application
DeriveΣ(xi−x̄)(yi−ȳ)=Σxiyi−nx̄ȳ.
Show hint
Expand and sum each term.
Learning goal: Connect two exactly equivalent computational forms.
Show solution and calculation
The two middle sums each give−nx̄ȳ, and the constant term gives+nx̄ȳ, leaving the identity.
Interpret · Application
Convert x from meters to centimeters while leaving y unchanged. What happens to sxᵧ?
Show hint
Every numerical x-deviation is multiplied by 100.
Learning goal: Explain scale dependence without inventing stronger association.
Show solution and calculation
The covariance number becomes 100 times larger, with the corresponding unit change; dependence has not become stronger.
Error analysis · Application
May y=(3,2,1) be sorted to(1,2,3) while x stays unchanged?
Show hint
That changes observation pairs.
Learning goal: Preserve pairing as part of the data.
Show solution and calculation
No.
Correct covariance−1 becomes an artificial+1.
Reordering complete pairs together is valid; separate sorting changes the data.
Transfer · Challenge
Let X be equally likely−1,0,1 and Y=X2. Does zero covariance prove independence?
Show hint
Compute E(X), E(XY) and inspect the deterministic relation.
Learning goal: Distinguish zero linear covariance and independence.
Show solution and calculation
E(X)=E(X3)=0 gives covariance 0.
Yet X determines Y; for instance, X=0 forces Y=0.
The variables are not independent.
Check your understanding with the formula’s reference test.
7 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Useful next steps
With two identical variables, covariance becomes the Sample Variance.
For dimensionless normalization when both spreads are positive, see Pearson Correlation Coefficient.
Covariance and variance determine a fitted-line slope in Linear Regression (Line of Best Fit).
Sources for this explanation
Quanta · Updated November 8, 2026
- HTW Dresden Statistik: Zwei metrische Merkmale
- Jeremy Orloff and Jonathan Bloom, MIT 18.05 Reading 7b: Covariance and Correlation
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Added paired covariance with n−1, units, a computational identity and independence limitations in DE/EN.
Cite this reference page
Quanta. Sample Covariance. Updated November 8, 2026. https://quanta-study.de/en/formula-sheet/kovarianz-stichprobe
When citing a specific scientific statement, also cite the specialist source linked to that statement.