Model dependenceLesson 27 of 76 · 7 min

Correlation does not tell the whole story

Recognise dependence that a near-zero linear correlation can conceal.

Pearson correlation measures how strongly two quantities vary along a straight-line relationship. It ranges from -1 to 1: +1 is a perfect increasing line, -1 a perfect decreasing line, and zero means this linear summary finds no association. Zero need not mean independence.

Generate a symmetric input X and set Y to its absolute value, written |X|: remove the sign, so |-2|=2. Knowing X determines Y, yet positive and negative linear contributions cancel and correlation can be near zero. The V-shaped plot reveals what the coefficient misses.

This is also a reminder that an observed correlation does not identify a causal mechanism. In a simulation the relationship is known because the generator defines it. In measured data, shared causes, selection and direction need separate reasoning. Use a dependency model that reflects the mechanism relevant to the question.

Zero correlation can hide a complete relationship
-2-101200.571.11.72.3Y = |X|X
-2-101200.571.11.72.3Y = |X|X
Y=∣X∣Y=|X|
Reference illustration. Exact relationship in the authored model: Y is determined by |X|. A near-zero linear correlation cannot summarise this V-shaped dependence.

Can one variable determine another while their Pearson correlation is near zero?

Write a prediction (optional)

Seeded teaching simulation

Select Run Python below with the code unchanged.

Tools
About Python ↗

The code is editable. Press Ctrl+Enter or ⌘+Enter to run Python from the editor.

Published example output

This result comes from the original Python. Your runs appear above. Build environment ↗

Pearson correlation: 0.0273
Maximum mismatch with |X|: 0.0
Plot generated from the published Python during the build. Refer to its labelled axes and the text output.
Open full-size figure ↗

Read the first result

The coefficient hides the V-shaped relationship. A single correlation number is not a complete joint distribution.

Try an edit

Replace y = np.abs(x) with y = x + rng.normal(0, .1, len(x)). On the plot-label line, replace plt.ylabel("Y = |X|") with plt.ylabel("Y"). Select Run Python again. Maximum mismatch with |X| checks the original rule. A nonzero mismatch is expected after changing it. Compare both scatterplots and Pearson correlation. Why does a straight-line summary now pick up the relationship?

Back to the Python editor

Scope. The example defines exact nonlinear dependence. It does not provide a general method for discovering causal structure from observations.

Try a fresh case

A measured correlation is zero. Which conclusion is justified without additional assumptions?

Choose an answer
Need a hint?
Hint 1

Think about the shape in the plot.

Hint 2

Ask what information the coefficient discards.

Your notes