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.
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.
A saved draft is open. To run the published example, open Tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
Your result
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
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?
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?
Need a hint?
Hint 1
Think about the shape in the plot.
Hint 2
Ask what information the coefficient discards.