Covariance in this visualization
The sample covariance of paired data measures how two quantities vary together: the products of each pair’s deviations from the means, added and divided by , . Each term is the product of a point’s two deviations from the means, drawn here as the rectangle between the point and the centre . Points up and to the right of the centre, or down and to the left, give positive rectangles; the other two quarters give negative ones. Both axes use the same unit and the same scale, so the areas are true areas, and the square at the centre has area equal to the absolute value of the covariance. It extends to the right for positive covariance and to the left for negative covariance.
What its size means
Covariance carries units: those of times those of . Adding a constant to all the values changes nothing, but measuring in a unit ten times smaller multiplies the covariance by ten. Its sign says whether the points lean along a rising or a falling line; its size alone does not say how strong the tendency is. Dividing by the two standard deviations removes the units and gives the correlation coefficient . Paired with itself, makes squares instead of rectangles, and its covariance is its variance. The divisor is the one used for the sample variance; dividing by instead gives the covariance of the data themselves.
Why it decides the spread of a sum
For each point, , where and are its deviations. Averaged the same way, this gives exactly. When and move together, their deviations add up and the sum spreads more than the two spreads added; when they move apart, the deviations partly cancel and the sum can vary less than either part. This is why combining quantities that move in opposite directions steadies a total. With “Sum x + y” on, each point is carried along a line of constant onto the diagonal through the centre, so the spread of those marks is the spread of the sums.
Things to notice
- A covariance of 0 does not mean the quantities are unrelated: points on a parabola can balance exactly. It only measures a straight-line tendency.
- One point far from the centre on both axes can supply most of the covariance by itself.
- Overlapping rectangles each count in full; the shading does not darken where they overlap.
Controls
- Click an empty spot to add a point; select one and press Delete to remove it, or the arrow keys to move it.