Worked examples — Explained variance and choosing components
This page is the "no surprises" drill for Explained variance and choosing components. The parent note gave you the formulas; here we hit every kind of input the topic can throw at you — clean cases, weird cases, and the traps — and work each one to the last decimal.
Before we start, one promise: every symbol below is already earned in the parent note, but let us re-anchor the three we lean on constantly, in plain words.
The scenario matrix
Every explained-variance problem is really one of these cells. The rest of the page fills each one.
| # | Case class | What makes it special | Example that covers it |
|---|---|---|---|
| A | Clean drop-off | one dominant , obvious elbow | Ex 1 |
| B | Flat / uniform spectrum | all equal — no compression possible | Ex 2 |
| C | Zero eigenvalue | a degenerate (redundant) direction, | Ex 3 |
| D | Threshold hunt | "how many for 95%?" with an off-grid cutoff | Ex 4 |
| E | Scaling / units trap | raw vs standardised features change the answer | Ex 5 |
| F | Real-world word problem | sensor data, decision required | Ex 6 |
| G | Exam twist: partial info | only some given, must reason about bounds | Ex 7 |
| H | Limiting behaviour | , , and noise floor | Ex 8 |
[!example] Example 1 — Case A: clean drop-off, obvious elbow
Statement. Eigenvalues (already sorted): . Find every , the CEV curve, and the elbow.
Forecast: guess now — does one component already carry more than half? Where does the curve flatten?
- Total variance. . Why this step? The denominator is the whole spread; every fraction is measured against it.
- EVRs. , , , (each rounded to 4 decimals). Why this step? Turns raw variances into comparable fractions.
- CEV. . Why this step? Running total answers "keep first ?".
- Elbow. The jump from comp 2 to comp 3 collapses (). Keep : 92.3% retained, half the dimensions gone. Why this step? The elbow is where each extra component stops paying its way — the classic stopping rule.
The figure below shows exactly this: cyan bars are the four EVRs (notice bar 1 is more than half the height of the whole chart), and the amber curve is the CEV climbing to . The amber arrow marks the elbow — the point after which each new bar barely lifts the curve. That flattening is the visual cue to stop at .

Verify: EVRs sum to ; CEV is non-decreasing and ends at . Sanity: comp 1 alone > 50%, matching a clear dominant direction. ✓
[!example] Example 2 — Case B: flat spectrum, nothing to compress
Statement. (five equal variances). What does explained variance tell us?
Forecast: if all directions are equally spread, how many can you drop for free?
- Total. . Why this step? Baseline — the whole spread we measure fractions against.
- EVR each. for every component. Identical. Why this step? Equal EVRs are the fingerprint of a data cloud with no preferred direction.
- CEV. — a perfectly straight line. Why this step? A straight CEV line is the visual signature of "no free lunch."
- Reading it. To keep 90% you need with . You must keep all of them. PCA cannot help here. Why this step? It turns the abstract "flat spectrum" into the concrete verdict: no compression is possible at this threshold.
In the figure below the cyan bars are all the same height (each EVR ) and the amber CEV climbs as a perfectly straight ramp to — contrast this with Example 1's cliff-then-plateau. A straight ramp with no elbow means there is no natural place to stop early. The x-axis is component number; the left y-axis is EVR, the right y-axis (amber) is CEV.

Verify: ; CEV straight-line slope per step. This is the worst case for dimensionality reduction — the data is an isotropic ball. ✓
[!example] Example 3 — Case C: a zero eigenvalue (degenerate direction)
Statement. . Interpret the zero.
Forecast: what happened in the data for a variance to be exactly zero?
- Total. . Why this step? Baseline denominator; note the zero contributes nothing to it.
- EVRs. . Why this step? The third component captures no spread at all — the EVR of a dead direction is exactly zero.
- What a zero means. the data has no variation along that eigenvector — the points lie flat in a 2-D plane inside 3-D space (one feature is a linear combination of the others). Why this step? Zero variance = redundant direction = it can be dropped with zero information loss.
- CEV. . Keeping already gives 100%. Why this step? Once the CEV reaches exactly before the last component, every remaining component is provably disposable.
In the figure below the third cyan bar has height zero (the amber arrow points to the empty slot on the axis), and the CEV curve reaches already at then runs flat — the visual signature of a rank-deficient dataset. The x-axis is component number; the left y-axis is EVR, the right (amber) is CEV.

Verify: exactly, and adds nothing. A true rank-deficient dataset. This is the degenerate input every treatment must cover. ✓
[!example] Example 4 — Case D: threshold hunt with an off-grid cutoff
Statement. (total ). Smallest for ?
Forecast: the 95% line rarely lands on a component boundary — guess whether it's 5, 6, or 7.
- Target variance. . Why this step? Convert the fraction into an absolute cumulative-variance goal so we can just add.
- Cumulative sums. . Why this step? We walk components in importance order, accumulating.
- Cross the line. at ; at . First crossing is . Why this step? We take the smallest that meets or beats the target.
- Report CEV. (96.67%). Why this step? We report the actual retained fraction, not just the count, so the reader knows exactly how much information the chosen keeps.
In the figure below, the cyan curve is the CEV; the dashed amber line is the 95% target. Trace the curve left-to-right and watch where it first pokes above the dashed line — that is the amber dot at . Notice the point at sits just under the line: this is exactly why "round the CEV up to the next component" gives 6, not 5. The x-axis is the number of components kept, the y-axis is cumulative explained variance.

Verify: , . So is correct, not 5. ✓ (This mirrors the algorithm in the parent note.)
[!example] Example 5 — Case E: the scaling trap (units change the answer)
Statement. Two features: height variance (metres²) and weight variance (kg²), uncorrelated. Compute EVR on raw data, then after standardising (each feature scaled to variance 1).
Forecast: will PCA "think" weight is almost 100% of the information? Should it?
- Raw EVRs. Total . Carrying full precision, and . These two are exact fractions and add to exactly ; the short forms and are just those numbers rounded to 6 decimals. Why this step? Shows raw PCA is dominated by the feature with the biggest numerical variance — an artefact of units, not importance.
- The catch. Height carries real signal, but its tiny metric-scale variance makes it invisible. This is a units illusion, not a data fact. Why this step? Motivates standardisation.
- Standardise. Divide each feature by its std so both have variance : . Why this step? Puts features on equal footing (this is feature preprocessing before extraction).
- New EVRs. each — now neither dominates. Why this step? Confirms standardisation removed the unit illusion: the two features are now judged by structure, each contributing equally.
In the figure below two cyan bar-pairs sit side by side: on the left, "raw" — one bar fills almost the entire height and its partner is a sliver you can barely see (the height); on the right, "standardised" — two equal half-height bars. The amber arrow highlights how the sliver grows into an equal partner once units are removed. The x-axis groups the two scenarios; the y-axis is EVR.

Verify: raw fractions add exactly: . Standardised EVRs sum to with each . Lesson confirmed: scale before PCA unless units are already comparable. ✓
[!example] Example 6 — Case F: real-world word problem
Statement. A factory logs 12 vibration sensors. PCA gives . Management says "keep 90% of the signal, storage is expensive." How many sensors-worth of components do you keep, and what's the compression?
Forecast: 12 sensors → guess whether you land near 4 or near 8 components.
- Total. Sum . Why this step? Nice round total makes CEV read directly as a percentage.
- Cumulative. Why this step? Walk down until we pass 90.
- Cross 90%. at ; at . Keep . Why this step? Smallest meeting the target.
- Business answer. Store 4 components instead of 12 → of the storage, retaining of the signal. Why this step? This translates the maths into the decision management actually asked for — a storage/retention trade-off, not a bare number.
In the figure below the cyan CEV curve climbs steeply over the first four sensors then flattens into a long tail; the dashed amber line is the 90% target and the amber dot marks the first crossing at . The steepness-then-tail shape is why 4 of 12 sensors suffice. The x-axis is the number of components kept; the y-axis is cumulative explained variance.

Verify: , . Compression storage saved. Units: fractions dimensionless, storage ratio consistent. ✓
[!example] Example 7 — Case G: exam twist, only partial info
Statement. You are told only that , the total variance is , and . The rest are unknown but sorted descending. Give tight bounds on .
Forecast: with one component eating 60%, how big can the second be? How small?
- Lower bound on . The remaining eigenvalues sum to , are sorted, so is the largest of nine numbers summing to : it is at least the average . Why this step? A max is never below the mean of its group.
- Upper bound on . It cannot exceed (descending order), and cannot exceed the whole remainder . So . Why this step? Order + total cap the second value.
- Translate to CEV. , so , i.e. . Why this step? Bounds on become bounds on the retained fraction — we answer the question even without full data.
In the figure below the amber band shows the whole range can occupy: the lower edge at (when the remaining nine are as equal as possible) and the upper edge at (when swallows the entire remainder and the rest are zero — the Case-C degenerate extreme). The single cyan dot at is the one thing we know for sure. The x-axis is ; the y-axis is cumulative explained variance.

Verify: lower ; upper (attained only if and the rest are 0 — the Case C degenerate extreme). Both endpoints are realisable, so the bounds are tight. ✓
[!example] Example 8 — Case H: limiting behaviour (, , noise floor)
Statement. Using (total ), evaluate the endpoints and , then describe what happens as more and more tiny "noise" eigenvalues are appended.
Forecast: what is CEV when you keep zero components? When you keep all?
- . Empty sum , so . Why this step? Keeping nothing retains nothing — the curve must start at 0.
- . . Why this step? Keeping everything retains everything — the curve must end at 1.
- Appending noise. Add many tiny eigenvalues, say copies of (total extra ). New total . Now . Why this step? Noise inflates the denominator, so the same three real components now "explain" slightly less. This is the noise floor: in real high-dimensional data the CEV curve approaches only slowly through a long flat tail.
- Limit. As you append noise eigenvalues each , as , but for realistic small totals it stays near . Why this step? It pins down the asymptotic behaviour — showing that "explains almost everything" can silently erode as junk dimensions pile up, which is exactly the trap the parent note warns about.
Read the figure below left-to-right: the leftmost point is (amber arrow, "keep nothing"), the curve jumps steeply over the three real components, then crawls almost flat across the 30 tiny noise eigenvalues — the shaded band near the top is that noise floor. The amber arrow at marks where the real signal ends at ; every point to its right is noise dragging the total slowly toward . The x-axis is components kept, the y-axis is cumulative explained variance.

Verify: , (no noise), and with noise . Monotone, bounded in , endpoints exact. ✓