Correlation is the cosine of an angle
One die roll, six outcomes, each giving a point (X, Y). Drag the points: the covariance is the average signed area of the rectangles; with the means removed, X and Y are two vectors, and the correlation is the cosine of the angle between them.
- outcome ω (probability 1/6 each)
- mean (EX, EY)
- best line
- product > 0
- product < 0
Scatter: each outcome ω is a point (X(ω), Y(ω))
Vectors: X and Y with their means removed
- X − EX
- Y − EY
- projection
- sum (X+Y) − E(X+Y)
- EX
- −0.17
- EY
- 0.17
- σX
- 2.05
- σY
- 1.18
- Cov(X,Y)
- 1.99
- ρ = cos θ
- 0.82
- θ
- 34.9°
- Var(X+Y)
- 9.58
Arrow keys move
What did you observe?Play first, then answer. Read the explanation only after you have thought it through.
- 1.Press “On a line”. What are ρ and the angle θ? Now drag point 6 down, off the line. How does ρ change? Can any drag push ρ outside [−1, 1]?
- 2.Press “Uncorrelated, yet related”. Here Y is completely determined by X, yet Cov is 0. How do the positive and negative areas on the left cancel?
- 3.Press “One outlier” and note ρ; then drag point 6 to (0, 0). What does ρ become? Why can one point matter so much?
The six points of “On a line” lie on , so : the two vectors point the same way, and . Dragging point 6 from to lowers to about , an angle of about . Since is the cosine of the angle between two vectors, the Cauchy–Schwarz inequality keeps it inside whatever you drag; it reaches only when all six points lie on one line that is neither horizontal nor vertical. The points of “Uncorrelated, yet related” are symmetric about , with : the rectangles of and , one blue and one red, have equal area and cancel in pairs, so . Covariance measures only linear dependence; does not mean independent. With the outlier at , ; at , , because the other five points have almost no linear relation. That one point lies far from the mean, its rectangle is larger than the other five together, and the covariance is the average of these areas, so a single point decides the sign and size of .
Related concept: Mean & variance
Discussion
Found a mistake, have a question or a suggestion? You can also write to 620026600@qq.com
No comments yet. Share your understanding, ask a question, or point out an error on this page.
Log in to join the discussion