Foundations — Explained variance and choosing components
Before we can talk about "explained variance," we must earn every symbol the parent note throws at you. We go from a picture of raw data all the way to the eigenvalue ratio — never using a symbol before it has a plain meaning and a picture.
[!definition] Symbol 1 — A data point and a data cloud
A data point is one measured thing described by several numbers. Measure a person's height and weight and you get two numbers: that pair is one point in a 2D plane.
Stack many such points and you get a data cloud: a scatter of dots. The parent topic is entirely about the shape of this cloud.

[!definition] Symbol 2 — , , and the matrix
- = the number of data points (how many dots).
- = the number of measurements per point (the number of axes / dimensions).
We line the points up into a grid of numbers called : one row per point, one column per measurement. So is an grid (" tall, wide").
Why the topic needs it: everything else — averages, spread, covariance — is computed by sweeping over these rows and columns.
[!definition] Symbol 3 — The mean and "centering"
The mean of column , written (say "x-bar-j"), is the average of that one measurement across all points:
Here the symbol is just shorthand for "add up as counts from 1 to ." It is a compact "add all of these" instruction, nothing more.
Centering means subtracting each column's mean from that column, so every measurement now describes how far from average a point is. From now on, whenever we write in a variance or covariance formula, we assume has already been centered — every column mean is .

[!definition] Symbol 4 — Variance
Variance measures how spread out one measurement is. For centered data (mean already zero) it is the average of the squared distances from the middle:
- We square so that being below average (a negative gap) counts the same as being above (a positive gap) — squares are never negative.
- Big variance = the dots are smeared far along that axis. Zero variance = every point has the same value there (a flat, dead direction).
[!definition] Symbol 5 — Total variance and the trace
Total variance is the sum of the variances of every measurement — one number describing the whole cloud's total spread:
There is a name for "add up the diagonal of a square grid": the trace. For any matrix ,
i.e. sum the entries running top-left to bottom-right. We meet trace here because — as we will see in Symbol 7 — the diagonal of the covariance matrix holds exactly the per-axis variances, so total variance = trace of the covariance matrix. Think of total variance as the full pie of spread that we will later slice into pieces.
[!definition] Symbol 6 — Vectors and projection
A vector is an arrow pointing in some direction. When we make its length exactly 1 we call it a unit vector, written with the property (more on the below — it just means "the arrow dotted with itself gives length-squared = 1").
Projection answers: "If I shine a light straight down onto the line pointing along , where does each dot land?" Each landing position is a single number: how far along that point sits. Collecting all these numbers for every point is written .

The transpose simply means "flip the grid over its diagonal" — rows become columns. We need it so that quantities like read as "multiply the shadow-list by itself," which is exactly how you get a sum of squares — i.e. a variance.
[!definition] Symbol 7 — The covariance matrix
The covariance matrix is the grid built from the centered data:
Let us open up one entry to see what it means. The matrix product has, in row and column , the dot product of column of with column . So:
Read that entry aloud: "average, over all points, of measurement times measurement ." Because is centered, this is exactly the covariance of measurements and — how they vary together. (If were not centered, this sum would be a raw cross-product, not a covariance — which is why centering was mandatory.)
- Diagonal (): — the per-axis variances. So , confirming Symbol 5.
- Off-diagonal (): how two measurements move together (do height and weight rise as a pair?).
Why the topic needs it: the whole PCA story lives inside . The stretch directions of the cloud and the amount of stretch are hidden in this one grid — and eigenvalues pull them out.
[!definition] Symbol 8 — Eigenvectors and eigenvalues
For the matrix , an eigenvector is a special direction that does not rotate — it only stretches it. The stretch factor is its eigenvalue, written ("lambda-i"). See Eigenvalues and Eigenvectors.
Read this aloud: "applying to the special arrow gives back the same arrow, just scaled by ."

[!formula] Symbol 8b — WHY the eigenvalue is the variance along
We claimed equals the variance of the data projected onto . Let us earn it, one step at a time.
Step 1 — write the variance of the shadows. The projected data is the list (Symbol 6). Its variance, since it is already centered, is the average of its squared entries, which the transpose packs neatly as:
What this looks like: take the shadow positions in the s03 figure, square them, average them.
Step 2 — regroup the transpose. A rule of transposes: . Applying it to :
Step 3 — spot the covariance matrix. But is exactly (Symbol 7). Pulling the inside:
Step 4 — use the eigenvector property. Since :
using from the orthonormal box. Done: . The eigenvalue is the variance along its direction — no metaphor, an equation.
Symbol 9 — Assembling the explained-variance ratio
Now every symbol in the parent formula is earned:
It is literally "how big is my slice compared to the whole pie." Adding the first slices gives the cumulative explained variance — the fraction of the cloud's spread you keep if you drop everything past component . That is the number you threshold at 95% when doing Dimensionality Reduction.
The same eigenvalues also appear (as squared singular values) inside Singular Value Decomposition (SVD), and the "which columns matter" question links to Feature Selection vs. Feature Extraction. The visual ranking of is drawn in a Scree Plot.
Prerequisite map
Read top to bottom: raw dots become a matrix, centering fixes the middle, variance measures spread, projection and covariance package the shape, eigenvalues slice the spread, and the ratio decides how many components to keep.
[!recall]- Quick checks as you build
Cloze yourself before moving on.
The average of squared gaps from the middle is called
The grid of numbers with one row per point and one column per measurement is
Subtracting each column's mean so the cloud sits on the origin is called
Shining a light onto a direction and recording where each dot lands is called
A direction that only stretches, never rotates, is an
The stretch factor of an eigenvector equals the
Adding up the diagonal entries of a square matrix is called the
The sum of all eigenvalues equals the
Equipment checklist
Test your readiness — cover the right side and answer.