Visual walkthrough — Correlation analysis and multicollinearity
This page rebuilds the central idea of the parent topic from absolute zero, in pictures. We start with two columns of numbers and end with the reason a model's coefficients go haywire when features march in step. Every step shows you what we do, why we do it, and what it looks like.
We will use only these plain ideas, each built before it is used:
- a feature = one column of numbers (one measurement per sample);
- the mean = the balance point of a column;
- and later, a vector = an arrow whose length and direction we can see.
Throughout, is the number of samples (rows) and, once we have more than two features, is the number of features (columns), indexed . So means "the -th feature column," and , are that column's numbers.
Step 1 — Two columns of numbers, and their balance points
WHAT. Put two features side by side. Feature and feature each have samples: and . First we mark the mean of each — the number where the column would balance like a seesaw:
Here (the tall Greek "S") just means "add up all of these," and is how many samples we have.
WHY. Everything about relationship is about movement away from the usual value. A number by itself ("") tells us nothing until we know whether is above or below normal. The mean is our "normal."
PICTURE. Look at the two number lines below. The orange dots are the values; the teal dots are the values. The dashed vertical line on each is the mean. Notice which dots sit to the right of the balance line (above average) and which sit to the left (below average).

Step 2 — The product of deviations: agreement vs. disagreement
WHAT. For each sample , multiply the two deviations together:
WHY. We want a single number per sample that says "did and agree here?" Multiplication of two signs does exactly that — think of the sign rule you already know:
| product | meaning | ||
|---|---|---|---|
| (high) | (high) | agree (both above) | |
| (low) | (low) | agree (both below) | |
| (high) | (low) | disagree | |
| (low) | (high) | disagree |
So a positive product means the two features moved the same way at that sample; a negative product means they moved opposite ways. If either is exactly average, the product is — that sample casts no vote.
PICTURE. Each sample is a point on an – grid. The two mean lines split the grid into four quadrants. Green shading = agreement quadrants (product positive); red shading = disagreement quadrants (product negative). A point far into a corner (big and big ) votes loudly; a point near the crossing votes softly.

Step 3 — Average the votes: covariance
WHAT. Add all the per-sample votes and divide by the count. That average is the covariance:
WHY. One sample can be a fluke. Averaging over all samples gives the typical co-movement: is the crowd mostly voting "agree" (positive), "disagree" (negative), or split (near zero)? This is the covariance between two features.
PICTURE. We collapse all the green/red votes into a single tilted cloud. A cloud that leans up-to-the-right has positive covariance (agreement wins). A cloud leaning up-to-the-left has negative covariance. A round, tilt-free cloud averages to zero.

Step 4 — Normalise the units away: the correlation coefficient
WHAT. Divide covariance by how much each feature spreads on its own. The spread of a feature is its standard deviation — the typical distance of its values from their mean. We define one for and one for : Each is "root-mean-square deviation": square every deviation (so signs cannot cancel), average them, take the square root to return to the original units. With both spreads in hand, the Pearson correlation coefficient is:
WHY this specific division? Covariance has units of . The spread carries the -units and carries the -units. Dividing by cancels both units exactly, leaving a pure number. And that pure number is trapped inside — no matter the data — by the Cauchy–Schwarz inequality. So doubling units, changing dollars to cents, none of it moves .
PICTURE. The same cloud, but now we rescale each axis by its own (turning each feature into "how many spreads away from average"). In these fair units, is simply how flat the cloud has been squashed onto a line: a perfectly thin line means ; a round blob means .

Step 5 — Every case of , corner to corner
WHAT. We now walk through all the values can take, so you never meet a cloud you cannot read.
WHY. A tool you only understand at one value () is a trap. The judge of a good picture is: can you name the value for any cloud shown to you? Here is the whole range.
PICTURE. Five clouds, left to right: , , , , . Read the slope and tightness of each.

- — perfect up line. is exactly with . Redundant feature.
- — leans up, some scatter. Partial overlap of information.
- — no linear tilt. Careful: this only means no straight-line relationship; a perfect U-shape (parabola) also gives while being fully dependent. is blind to curves.
- — leans down. Opposite movers.
- — perfect down line. Still redundant: from the parent's example gives exactly .
Step 6 — Now the danger: two features that are (almost) the same arrow
WHAT. Treat each feature-column as a vector — an arrow in a space with one axis per sample (so with samples the arrow lives in -dimensional space; we draw a flattened 2D cartoon of it). Two features with near are two arrows pointing nearly the same way (or exactly opposite). This is the situation the parent calls multicollinearity.
WHY. A model must split "credit" between the two features: how much of the target does each explain? If the arrows point in genuinely different directions, the split is clean. If the arrows nearly coincide, the model cannot tell them apart — it can shovel a giant positive coefficient onto one and a giant negative onto the other, and their near-identical arrows almost cancel, leaving the prediction unchanged. Many wildly different coefficient pairs give nearly the same fit.
PICTURE. Two near-parallel arrows and . The target arrow is decomposed onto them. Watch the tiny sliver of angle between and : as it shrinks, the coefficients needed to reach blow up.

Step 7 — From two arrows to many: the leftover piece of a feature
WHAT. With more than two features we cannot draw the picture, but the idea extends cleanly. Ask of feature (one of the feature columns): how much of it is genuinely new, versus rebuildable from the other features? Line up all the other feature-arrows and find the best combination of them that approximates — that is exactly "regress on the others." What is left over is the part of perpendicular to all of them: its unique direction.
WHY. In Step 6 with two features, the "leftover" was just the sliver of angle between and . With many features the same sliver becomes the perpendicular distance from to the flat space spanned by the others. The smaller that leftover, the more is a near-copy of the pack — and the more the model's credit-splitting wobbles, exactly as before.
PICTURE. Feature-arrow split into two pieces: a shadow lying in the plane of the other features (the rebuildable part) and a short perpendicular stub sticking out (the unique part). As the stub shrinks, instability grows.

Step 8 — Putting a number on the instability: VIF and the condition number
WHAT. Two matching numbers measure how bad the near-parallel situation is.
The Variance Inflation Factor for feature :
WHY does the formula look like this? From Step 7, is the fraction of that is unique — the length² of the perpendicular stub relative to the whole arrow. The regression coefficient for is determined only by that stub, because the shadow part is shared with the other features and carries no information they don't already have. A short stub means a small effective "lever," and the variance of an estimated coefficient scales with . Writing the stub fraction as gives directly So VIF is literally "one over the fraction of that is unique." When the stub vanishes (), the lever length and : the variance explodes — the numeric face of the knife-edge in Step 6.
Now the design matrix : stack your samples as rows and your features as columns, so is the whole data table as one matrix. Its singular values and are the lengths of the longest and shortest directions the data cloud stretches (found by the SVD — think "the axes of the ellipse that hugs the cloud"). The condition number is their ratio: A pancake-flat cloud (features nearly parallel) has a tiny , so the ratio explodes.
WHY does a big mean unstable coefficients? Fitting a linear model means solving — undoing to recover the coefficients. The condition number is precisely how much undoing magnifies errors: if , then a wobble in the data can swing by up to . Geometrically, the tiny direction is the near-parallel sliver from Step 6 seen for the whole feature set at once: the model must divide by that sliver, and dividing by something tiny blows the answer up. So VIF and are two views of one fact — small angle short stub high high VIF thin cloud tiny high . (See Condition Number for the full error-amplification bound.)
PICTURE. A dial: as climbs from toward , the VIF curve rockets upward — flat and safe until about , then a cliff. The thresholds and are marked; alongside it, a thin vs. round data cloud shows the matching .

Recall
VIF meaning of 6.67 ::: The standard error of that coefficient is inflated by compared to an uncorrelated feature. gives what VIF? ::: . Why does a thin data cloud give a huge condition number? ::: (the cloud's thinnest direction) becomes tiny, so blows up. What happens to VIF and for a constant (zero-variance) feature? ::: Both blow up / become undefined — makes ; drop the column first.
Step 9 — What to actually do about it
WHAT. Once VIF or flags trouble, you have three routes:
- Drop the redundant feature — Feature Selection (keep one of from the parent's example).
- Combine them into new uncorrelated directions — Principal Component Analysis (PCA) rotates the axes to line up with and , so the new features are orthogonal by construction.
- Shrink the coefficients so they cannot explode — Ridge Regression (penalises large coefficients, stabilising the near-singular inverse) or Lasso Regression (which can zero features out entirely). This trades a little bias for a lot less variance — the Variance-Bias Tradeoff.
WHY. The instability came from near-parallel arrows. You either remove an arrow, rotate to a perpendicular set, or forbid the giant opposing coefficients. Each attacks the exact mechanism of Step 6. These fixes rest on the Linear Regression Assumptions holding otherwise.
PICTURE. Two mini-panels: (left) PCA rotating the tilted cloud onto clean perpendicular axes; (right) Ridge pulling a runaway coefficient pair back toward the origin.

The one-picture summary
Everything on this page is one chain: deviations → signed product → averaged covariance → unit-free → arrow angle → leftover stub → VIF/ → fix. This final figure compresses that whole journey into a single flow.

Recall Feynman retelling — say it back in plain words
We started with two columns of numbers and marked each column's usual value, its mean. For every sample we asked two yes/no-ish questions — "is above usual? is above usual?" — and multiplied the answers so that agreement scores positive and disagreement scores negative. Averaging those scores over all samples gave covariance: the crowd's verdict on whether the two features move together. But covariance is polluted by units, so we divided by each feature's own spread; the units cancelled and out popped , a pure number trapped between and that reads off as "how flat the cloud has been squashed onto a line" — and, equivalently, as the cosine of the angle between the two feature-arrows. (If a feature never changes, its spread is zero and is undefined — a constant column has to be thrown out first.) Then we noticed the villain: when hugs , the two feature-columns are nearly the same arrow. A model trying to split credit between two near-identical arrows can throw a giant positive coefficient on one and a giant negative on the other — they almost cancel, the fit barely changes, so the coefficients wobble wildly with any data nudge. To handle more than two features we asked how much of each of the features is genuinely new — the perpendicular stub left after the others rebuild it — and called the rebuilt fraction . We then measured the wobble two ways: VIF , which is one over the unique fraction of a feature, and the condition number , which is how pancake-flat the whole data cloud is — and they tell the same story twice, because solving for the coefficients means dividing by that thinnest direction. Finally we fixed it by dropping a redundant arrow, rotating to perpendicular axes with PCA, or forbidding the giant coefficients with Ridge and Lasso. One idea, start to finish: correlation is agreement-scoring made unit-free, and multicollinearity is what happens when two features are secretly the same arrow.