← First Pair Library

The Mathematics of Eigen Times

A Tutorial Companion: Vectors, Covariance, SVD, LSA, Rotations, and the Thresholds of a Newspaper in an Eigenbasis

Alexy Khrabrov

4 October 2026 | Edition 1.1.2-c0d75f51

The Mathematics of Eigen Times — Alexy Khrabrov

Preface

This is the shared mathematical companion for Eigen Times and Eigen Hacks. It accompanies Eigen Times: A Newspaper in the Eigenbasis of the News, which states the methods compactly and reports their results. Here we slow down. A reader needs arithmetic, fractions, and a willingness to work through small lists of numbers. We explain the other tools when they become necessary: vectors, matrices, logarithms, covariance, eigenvectors, derivatives, and the singular value decomposition. The aim is to understand what each calculation measures, why we want it, and how to reproduce it.

The same mathematics can organize newspaper articles and technology discussions. Their data distributions need not be the same. A similarity threshold measured on one archive does not automatically work on another. Historical corpus counts and threshold observations in this book retain their original dates and source context; they are not current site counters or new measurements of Eigen Hacks. Synthetic examples, by contrast, are small teaching inputs that the reader can change.

A chapter first explains the problem in words, introduces the necessary terms, and then works through a calculation. Read the intermediate arithmetic before the compact formula. When a formula still looks dense, identify what goes in, what comes out, and the size of each object. The upfront guide and final glossary provide a second route through the terminology; the subject index links back to explanations.

Every matrix in the original figures is drawn as a grid of coloured squares: blue for positive entries, rust for negative, darker for larger. The figure inputs and dated aggregate observations remain frozen. The complete Python and native OCaml notebooks contain this text, all nineteen figures, and executable lessons interleaved with the chapters. Their cells calculate the worked examples from declared inputs, test identities and reference answers, and finish with matching numerical receipts. Neither notebook needs access to the production database or a private archive. The public teaching repository is querygraph/eigenmath; a delivered study bundle also contains the exact notebook editions and reading copies.

Version 1.1.2. This patch expands compressed teaching steps throughout the shared companion. It introduces the meaning of a residual before measuring its length, develops differentiation from a small change in a scalar function before using it for minimization, and unrolls normalization, covariance, decomposition, rotation, statistical thresholds, and streaming sums. It adds an upfront notation guide, a glossary, and a linked index, and repairs clipped or overlapping figure annotations. One clustering sentence is corrected to agree with its existing frozen fixture: a threshold of 0.9 leaves one linked pair on 24 February 2022. No archive is refitted and no historical threshold or measurement is replaced.

Reading and notation guide

0.1 How to work through the book

Chapters 1–3 build the numerical language. Chapters 4–6 find recurring directions and give them interpretable names. Chapter 7 measures a new article or story. Chapters 8–10 explain grouping, unusual days, and how directions retain their identity over time. Chapters 11–12 show how the same calculations can be accumulated in pieces rather than loading an archive into memory.

In a notebook, run the setup cell first and then run cells in reading order. A cell may use a result computed earlier. An assertion is an executable check: it stops the lesson if a mathematical identity or reference result fails. If you edit a teaching input, a reference answer may intentionally fail while an identity should still hold. Restarting the kernel—the running language process—and running all cells checks that the lesson does not depend on hidden state. Python and OCaml are alternative implementations of the same examples; neither language is a prerequisite for reading the prose.

The later volume Eigen Times Math History places these methods in a historical sequence. Its companion adds techniques beyond the present book; its complete teaching text is available in the History Math notebooks. The present chapters are the direct prerequisites for the calculations here; the historical volume is a route to the foundational literature, not a substitute for a missing teaching step.

0.2 Reading symbols before calculating

A scalar is a single number. A vector is an ordered list of numbers. A matrix is a rectangular table. An entry is one number inside a vector or matrix; a coordinate describes an amount along a chosen direction. Coordinates depend on which directions we choose.

Lowercase subscripts identify entries: xix_i is observation number ii, while xijx_{ij} is its coordinate number jj. Context distinguishes an observation index from a coordinate index. An index is a label, not a quantity to multiply. Superscripts usually indicate powers, so a2=aaa^2=a\,a, except that ⊤\top means transpose: exchange rows and columns. An accent is also part of the name: x̂\hat{x} means an estimate or reconstruction of xx, not a new multiplication.

For numbers a1,…,ana_1,\ldots,a_n, the dots mean the intervening entries. The expression ∑i=1nai\sum_{i=1}^{n}a_i means a1+⋯+ana_1+\cdots+a_n. The symbol ∏\prod means multiplication over an indicated set of entries. Parentheses group operations: first calculate what is inside. The square root a\sqrt{a} is the nonnegative number whose square is aa, for a≥0a\geq0. The relations ≤\leq and ≥\geq allow equality; << and >> do not. The relation ≈\approx means approximate equality, usually because a displayed decimal is rounded.

The real numbers, denoted ℝ\mathbb{R}, include positive and negative numbers and fractions. Writing x∈ℝdx\in\mathbb{R}^{d} says that xx has dd real entries. A matrix with nn rows and dd columns has shape n×dn\times d, also written ℝn×d\mathbb{R}^{n\times d}. Shapes count entries; they do not indicate physical units. The zero vector has every entry zero. The identity matrix II is square, with ones on its main diagonal and zeros elsewhere; multiplying by it leaves a compatible vector unchanged.

Single bars |a||a| mean the absolute value of a scalar, its size without its sign. Double bars ‖x‖\lVert x\rVert mean the Euclidean length of a vector: square its entries, add, and take a square root. The dot product multiplies corresponding entries of two equally long vectors and adds the products. Both operations receive explicit calculations in Chapter 2. Adjacent matrices or vectors mean a matrix product only when their inner dimensions agree; Chapter 3 works through that rule.

0.3 The book’s main objects

This is a map of symbols, not a formula to memorize. The chapters repeat the definitions at the point of use.

Symbol Meaning and shape in this book
nn or NN Number of observations in the calculation; NN often denotes an archive total.
pp, dd, kk Number of vocabulary terms, embedding coordinates, and retained directions, respectively. An embedding is a learned numerical representation of text.
xix_i, XX One observation as a d×1d\times1 column; a data table with one transposed observation per row. For lexical data the input width is pp.
μ\mu, Σ\Sigma Mean column and covariance matrix: the average location and the table describing variation around it.
wiw_i, ZZ Nonnegative fitting weight of observation ii and sum of all fitting weights. The sum must be positive.
VV, Λ\Lambda Columns of retained unit directions, and a diagonal table of their variances. Their shapes are d×kd\times k and k×kk\times k.
cc, x̂\hat{x}, rr Coordinates along retained directions, reconstructed observation, and residual—the difference left after reconstruction. Their lengths are kk, dd, and dd.
RR, yy, Γ\Gamma A k×kk\times k naming rotation, the kk named coordinates, and their k×kk\times k covariance.
T2T^2, QQ, ν\nu Variance-scaled squared distance within the retained space; squared residual length outside it; fraction of total centred squared length left outside.
TT, SS, β\beta Term table, table of variance-scaled raw scores, and table associating terms with directions. These are not the scalar statistic T2T^2.
UU, Σsvd\Sigma_{\mathrm{svd}}, VV The three matrix factors in a singular value decomposition; their local shapes are introduced in Chapter 5.
σj\sigma_j, λj\lambda_j Singular value number jj and covariance eigenvalue number jj. A bare σ\sigma in threshold discussions instead denotes a standard deviation.

The symbol VV appears in both the eigenvector and singular value chapters because the directions are closely related; the surrounding data table determines its shape. The symbol Σ\Sigma always means covariance here, except that an original SVD diagram uses it for the singular-value matrix and its caption explains that local convention. This prose writes that matrix as Σsvd\Sigma_{\mathrm{svd}}.

Across the series, the mathematical objects stay the same while storage conventions can differ. Here observations are columns in projection formulas and their transposes form data-table rows; in row-based formulas the same multiplication is transposed. Here Σ\Sigma means covariance and ZZ means total fitting weight. The History companion uses Γ\Gamma for covariance and ZZ for a standardized news table in some lessons. Read the local definition before transferring a formula. The present book reserves Γ\Gamma for the covariance after a naming rotation and keeps these conventions consistent throughout.

1 Why a newspaper needs linear algebra

Eigen Times starts from a claim about news: that most of it recurs. Wars, scandals, market shocks, elections, disasters happen again and again with different names attached. If that is true, then the enormous variety of news articles should be mostly explained by a small number of recurring directions, and each day’s news should be describable as “so much of this recurring thing, so much of that one, plus a remainder those directions do not capture.”

Linear algebra gives that sentence a precise meaning. We will build the meaning before using the machinery. A scalar is one number. A vector is an ordered list of numbers: in a two-coordinate illustration, (3,1)(3,1) says three units in the first coordinate and one in the second. Order matters; exchanging the entries changes the vector. A nonzero vector points from the origin, where every coordinate is zero, in a particular direction.

For a first example, suppose our representation records only the horizontal direction (1,0)(1,0). Taking three times that direction produces (3,0)(3,0). This is a reconstruction: the part of the observation that our chosen direction can rebuild. Subtract reconstruction from observation, coordinate by coordinate:

(3,1)−(3,0)=(0,1). (3,1)-(3,0)=(0,1).

That remainder is the residual. It records what the reconstruction missed. A residual is a vector before it is a length or a score; here its first entry is zero and its second entry is one. The later measurement chapter will explain exactly how to measure its size. For now, the decomposition is visible: observation equals reconstructed part plus residual.

The number three is a coordinate relative to the chosen direction: it tells us how much of that direction to use. A weighted combination adds several directions after multiplying each by a scalar. All combinations obtainable from a collection of directions form their span, a subspace. Our single horizontal direction spans a line; adding a genuinely different direction can span a plane. A low-dimensional representation keeps a limited collection of such directions. The question for Eigen Times is which directions let us reconstruct recurring patterns in news while making the remainder useful to inspect.

The notebook begins with three synthetic observations, (1,0)(1,0), (2,0)(2,0), and (3,1)(3,1). Their horizontal coordinates are 1, 2, and 3. The first two are rebuilt completely; only the third has a nonzero remainder. These are arithmetic examples, not measured levels of war or banking. Actual text representations acquire their coordinates in the next chapter.

The chapters follow the pipeline. Text becomes vectors (§2). Vectors are stacked into matrices, and matrices are multiplied (§3). The covariance of a million article vectors is computed and its eigenvectors found (§4). The singular value decomposition works directly on the data matrix and gives us latent semantic analysis (§5). The eigenvectors are oriented and rotated into axes with names (§6). A new story is projected, and what is left over is measured (§7). Then come the thresholds (§8–§9), matching axes across bases and nights (§10), streaming the calculation (§11), and the shapes of everything (§12).

2 Text as vectors

2.1 Counting words

The oldest way to turn a document into numbers is to count its words. Let pp count the terms in a fixed vocabulary; a document becomes a row of pp counts. A corpus is the collection of documents being analysed. Six tiny “articles”, labelled d1 through d6, and seven retained terms are enough to see the construction:

d1  troops shell border town
d2  ceasefire troops border
d3  bank raises rate
d4  rate rise hits mortgage
d5  troops ceasefire talks border
d6  bank mortgage rate rise

Terms that occur in only one document (shell, town, raises, hits, talks) are dropped in this example—they provide no shared term for connecting documents—leaving troops, border, ceasefire, bank, rate, mortgage, rise. Fix that order before writing any numbers. Document d1 then has row (1,1,0,0,0,0,0)(1,1,0,0,0,0,0): one occurrence of troops, one of border, and none of the other retained terms. Document d3 has row (0,0,0,1,1,0,0)(0,0,0,1,1,0,0). Their first entries refer to the same term even though the documents concern different subjects.

Stacking the six rows creates the count matrix, the left grid of Figure 1. Reading across answers “which retained words does this document use?” Reading down the troops column finds three documents containing that word. A count inside one row and a count of documents down a column answer different questions. The weighting rule below uses both.

2.2 TF‑IDF

TF‑IDF means term frequency–inverse document frequency. Its two factors answer two questions: how often does this document use a term, and how widely does that term occur across documents? Raw counts favour long documents and give common and rare words the same weight per occurrence. We soften the first effect and adjust the second.

2.2.1 Logarithms before the weighting rule

A power repeats multiplication: 23=2×2×2=82^3=2\times2\times2=8. A logarithm reverses this question: to what power must a chosen base be raised to produce a given positive number? The natural logarithm, written ln\ln, uses the fixed positive base e≈2.71828e\approx2.71828. Thus ln⁡(e)=1\ln(e)=1 and ln⁡(1)=0\ln(1)=0, because the first and zeroth powers of ee are ee and 1. The operator ≈\approx means approximately equal. Real-number powers extend this relationship between whole-number powers; we do not need to construct that extension to use a calculator’s log function.

The useful property is that doubling a positive input adds the same amount, ln⁡(2)\ln(2), to its logarithm. Doubling a count repeatedly therefore adds rather than doubles its contribution. For positive counts 1, 2, 4, and 8, the values of 1+ln⁡(count)1+\ln(\text{count}) are approximately 1.000, 1.693, 2.386, and 3.079. Eight mentions still count more than one, but they do not receive eight times the weight. This is damping.

Let tt identify a vocabulary term, NN count documents, and df(t)\mathrm{df}(t) count the documents containing tt. For a positive within-document count, define damped term frequency by tf=1+ln⁡(count)\mathrm{tf}=1+\ln(\text{count}). An absent term gets zero directly; we never ask for ln⁡(0)\ln(0), which is not defined as a real number. Define inverse document frequency, denoted idf(t)\mathrm{idf}(t), by

idf(t)=ln⁡N+1df(t)+1+1,\mathrm{idf}(t) = \ln\frac{N + 1}{\mathrm{df}(t) + 1} + 1,

Read the formula from inside outward. Add one to both document counts, divide, take the natural logarithm, then add one. The additions inside the fraction are a smoothing convention; the addition outside ensures that a term present in every document still has idf 1. Fewer containing documents make the denominator smaller, the ratio larger, and the idf larger.

There are six documents. Troops appears in three, so its calculation is 1+ln⁡(7/4)≈1.561+\ln(7/4)\approx1.56. Ceasefire appears in two, so its calculation is 1+ln⁡(7/3)≈1.851+\ln(7/3)\approx1.85. Multiply each term’s damped frequency by its idf. In these tiny documents each retained term occurs at most once, so each nonzero damped frequency is 1. Weighting changes how much each present word contributes without inventing a contribution for an absent word.

2.2.2 Turning a weighted row into a unit row

We next remove the row’s overall scale. For a row aa with entries ata_t, the squared Euclidean length is the sum of the squared entries, ∑tat2\sum_t a_t^2. The summation sign means add over all vocabulary positions tt. Squaring means multiplying an entry by itself. The Euclidean length, also called the norm and written ‖a‖\lVert a\rVert, is the nonnegative square root of that sum. A square root undoes squaring for a nonnegative result. In symbols,

‖a‖=∑tat2.\lVert a\rVert=\sqrt{\sum_t a_t^2}.

The double bars denote a vector’s length. Single bars around one scalar will mean its absolute value, or magnitude without sign: |−2|=2|-2|=2. A length is nonnegative even when some vector entries are negative.

For d2, only the first three weighted entries are nonzero. Using the unrounded idf values, its length is approximately 2.8770. Dividing each entry by that same length gives approximately (0.5421,0.5421,0.6421,0,0,0,0)(0.5421,0.5421,0.6421,0,0,0,0). Squaring and adding the unrounded normalized entries gives 1. Such a vector is a unit vector. Dividing every entry by one common positive number changes length without changing direction. This is normalization; it leaves the relative proportions of words in the row intact. An all-zero row has length zero and cannot be normalized by division.

From counts to TF‑IDF. Left: word counts for six documents over seven terms. Bottom: the idf weight of each term. Right: the TF‑IDF rows, each scaled to unit length.

Eigen Times builds this representation over 1,093,166 articles and a 50,000‑term vocabulary, keeping terms that occur in at least 20 documents and at most 30% of them. The result has 149 million non‑zero entries out of 55 billion cells—it is 99.7% zeros. Sparse storage keeps only nonzero entries and their positions; dense storage allocates every cell. The algorithms of §5 avoid forming this full matrix densely.

2.3 Cosine similarity

Let aa and bb be two nonzero rows with the same vocabulary order, and at,bta_t,b_t their entries for term tt. Their dot product, also called the Euclidean inner product and written a⋅ba\cdot b, multiplies corresponding entries and adds them. For three entries this means a1b1+a2b2+a3b3a_1b_1+a_2b_2+a_3b_3; for a vocabulary it means ∑tatbt\sum_t a_tb_t. Shared nonzero coordinates can contribute; a product involving an absent coordinate is zero.

The dot product alone grows if we multiply either vector by a large positive number. Cosine similarity, written cos⁡(a,b)\cos(a,b), removes this dependence on overall length by dividing by both norms:

cos⁡(a,b)=a⋅b‖a‖‖b‖=∑tatbtwhen ‖a‖=‖b‖=1.\cos(a, b) = \frac{a \cdot b}{\lVert a\rVert \, \lVert b\rVert } = \sum_t a_t b_t \quad \text{when } \lVert a\rVert = \lVert b\rVert = 1.

A cosine of 1 means the same direction, 0 means perpendicular directions, and −1-1 means opposite directions. In geometric language cosine is the horizontal coordinate of a unit direction measured relative to the first direction; this connects the formula to angles. Its value always lies between −1 and 1. For nonnegative word-count or TF‑IDF rows, negative cosines cannot occur; later centered or embedded vectors can have signed entries. The zero row has no defined cosine because the denominator would be zero.

For d2 compared with itself, the dot product is its first normalized entry squared, plus the second squared, plus the third squared; the remaining products are zero. Normalization made that sum 1. Document d5 has exactly the same retained row, so the same calculation gives 1 for d2 versus d5. For d1 versus d3, every coordinate product is zero: wherever one row has a nonzero retained term, the other has zero. Their dot product, and therefore their cosine, is zero.

In Figure 1, d2 and d5 share troops, border, ceasefire in the same proportions and have cosine 1.0; d1 and d3 share nothing and have cosine 0. Cosine is the similarity used throughout Eigen Times—for clustering a day’s articles into stories, for threading stories into episodes, for finding precedents—so §8 is largely about what values of it mean.

2.4 Embeddings

A TF‑IDF vector knows only which words appear. Two headlines using no shared retained terms have perpendicular, or orthogonal, TF‑IDF rows even if their meanings agree. A sentence embedding is a vector produced by a trained neural network—a numerical model that learns from examples—in which cosine similarity can track meaning beyond vocabulary. Eigen Times uses bge-small-en-v1.5, trained on hundreds of millions of sentence pairs, to turn a headline and lede (opening text: the first 300 characters, at most 96 tokens, or model text units) into 384 numbers. We treat the network as a black box that gives us a vector; everything downstream is linear algebra.

An embedding coordinate need not name a recognizable topic. Meaning is represented by the pattern across coordinates and relationships among vectors. This is why a direction in embedding space will later need evidence from words before we give it a readable name.

These embedding vectors are dense and not centred: their mean—the coordinate-by-coordinate average—has not been subtracted. To see why this matters, consider the synthetic vectors (1,1,0)(1,1,0) and (1,0,1)(1,0,1). Their dot product is 1 and each has length 2\sqrt2, so their cosine is 1/(22)=0.51/(\sqrt2\sqrt2)=0.5. Remove the shared component (1,0,0)(1,0,0) from both. The remaining vectors are (0,1,0)(0,1,0) and (0,0,1)(0,0,1), whose cosine is zero. Normalizing the original vectors would not remove that shared component; subtracting it changes their directions.

News embeddings also share a large common component, and the observed cosine between unrelated articles is around 0.5, not 0. The synthetic calculation demonstrates a mechanism; it does not reproduce that empirical distribution. The observation drives two of the thresholds in §8 and §9.

3 Matrices, pictured

3.1 A matrix times a vector

Let nn count document rows and pp count their coordinates. Stacking them gives an n×pn\times p matrix XX: the shape always lists rows before columns. Individual observation vectors will be written as columns when used in projection or outer-product formulas; their transposes supply the rows of a data matrix. A transpose exchanges rows and columns and is marked ⊤\top. Thus a column xx has row form x⊤x^{\top}.

For Figure 2, let AA be a 4×34\times3 example matrix and vv a 3×13\times1 column of weights, with entries v1v_1 through v3v_3. Their product AvAv is a 4×14\times1 column. Adjacent mathematical symbols mean multiplication when their shapes permit it.

The actual inputs and result are

A=(201130012111),v=(12−1),Av=(1702).A=\begin{pmatrix}2&0&1\\1&3&0\\0&1&2\\1&1&1\end{pmatrix},\qquad v=\begin{pmatrix}1\\2\\-1\end{pmatrix},\qquad Av=\begin{pmatrix}1\\7\\0\\2\end{pmatrix}.

The second output entry is 1×1+3×2+0×(−1)=71\times1+3\times2+0\times(-1)=7. Each row of AA has three entries and meets all three entries of vv. This is why the number of columns in the matrix must equal the number of entries in the input column. There are four rows to evaluate, so the output has four entries. A negative weight is allowed: it subtracts a contribution rather than adding one.

A matrix times a vector is a weighted sum of the matrix’s columns.

The definition of AvAv is “dot each row of AA with vv”, but the picture to keep is the other one (Figure 2): AvAv is a weighted sum of the columns of AA, with the entries of vv as the weights. If the columns of AA are directions, AvAv is the point you reach by going v1v_1 of the way along the first, v2v_2 along the second, and so on. That is what “coordinates” will mean in §7: the coordinates of a story are the weights that best rebuild it from the basis directions.

In this example, take the first column once, the second column twice, and subtract the third column once. The second entries combine as 1+2×3−0=71+2\times3-0=7, just as in the row calculation. Both descriptions perform the same multiplications; they group them differently. We will use row products to measure coordinates and column combinations to rebuild observations.

3.2 A matrix times a matrix

For Figure 3, take a new 3×43\times4 example AA, let BB be 4×24\times2, and call their product C=ABC=AB. Indices ii and jj select a row and column: entry CijC_{ij} is the dot product of row ii of AA with column jj of BB. Shapes must agree in the middle: (3×4)(4×2)(3\times4)(4\times2) gives 3×23\times2. Each column of BB is a separate input vector; multiplying by a matrix carries out both matrix–vector calculations together.

Here are the inputs, with the second row and second column providing a short calculation:

A=(120101122010),B=(10210311).A=\begin{pmatrix}1&2&0&1\\0&1&1&2\\2&0&1&0\end{pmatrix},\qquad B=\begin{pmatrix}1&0\\2&1\\0&3\\1&1\end{pmatrix}.

The entry C22C_{22} is 0×0+1×1+1×3+2×1=60\times0+1\times1+1\times3+2\times1=6. The four intermediate products correspond to the common inner dimension, 4. The two outer dimensions say that there will be three output rows and two output columns. Matrix multiplication is not entry-by-entry multiplication, and reversing the order need not give the same shape or result.

Two special cases recur. If XX has nn rows and pp columns, X⊤XX^{\top}X has shape p×pp\times p. A row of X⊤X^{\top} is a column of XX, so each output entry compares two columns of XX by their dot product. This is called a Gram matrix, and it is the raw material of covariance. In contrast, XX⊤XX^{\top} compares pairs of observation rows and has shape n×nn\times n.

For the other special case, let kk count selected, mutually perpendicular unit directions and let VV contain them as p×1p\times1 columns. Then XVXV has shape n×kn\times k. Entry (i,j)(i,j) asks how much observation ii points along direction jj. This table contains every document’s coordinates on those directions: the archive projected onto them. We will derive the reconstruction corresponding to those coordinates rather than assuming that taking a projection preserves everything.

Matrix multiplication: each entry of the product is a row of the left factor dotted with a column of the right one.

3.3 Transpose, symmetry, orthogonality

A⊤A^{\top} flips rows and columns. A square matrix has the same number of rows and columns. Call such a matrix SS; it is symmetric when S=S⊤S=S^{\top}. Real symmetric matrices, including covariances, admit a complete set of real, mutually perpendicular eigenvector directions, defined in the next chapter.

3.3.1 Perpendicular directions and what their products say

Two vectors are perpendicular when their dot product is zero. Unit-length perpendicular columns are orthonormal: “ortho” refers to perpendicularity and “normal” to unit length. The identity matrix II has ones on its diagonal and zeros elsewhere; multiplying by it changes nothing. A p×kp\times k matrix VV with orthonormal columns satisfies V⊤V=IV^{\top}V=I, with a k×kk\times k identity. Each diagonal entry in this product is a column’s squared length, so it is 1. Each off-diagonal entry compares two different columns, so it is 0.

Directions are independent when none can be formed as a weighted combination of the others. A basis is an independent collection spanning the space under discussion: its combinations reach every point in that space. The dimension counts the number of basis directions. A matrix’s rank counts the independent directions among its columns, equivalently among its rows. Listing a direction twice does not give us an extra independent direction.

3.3.2 A rotation keeps a whole space; a projection keeps part

If k=pk=p, the matrix VV is square and orthogonal. It has enough orthonormal columns to describe the whole space. Multiplication by VV or V⊤V^{\top} rotates or reflects coordinates and preserves lengths and angles. It also satisfies VV⊤=IVV^{\top}=I, so projecting and rebuilding recovers every input exactly.

If k<pk<p, the map V⊤xV^{\top}x keeps only selected coordinates of an observation column xx. Rebuilding gives VV⊤xVV^{\top}x, its orthogonal projection onto the retained subspace. Now VV⊤VV^{\top} need not be the identity: the missing directions cannot be recovered merely by changing back to the original number of coordinates.

For the notebook’s example, take x=(1,2,3)⊤x=(1,2,3)^{\top} and let VV contain the first two coordinate directions in three dimensions. The superscript ⊤\top makes the displayed list a column. Projection gives (1,2)⊤(1,2)^{\top} and rebuilding gives (1,2,0)⊤(1,2,0)^{\top}. The squared lengths are 1+4+9=141+4+9=14 before projection and 1+4=51+4=5 afterward. Nine units of squared length lie in the discarded coordinate. The rectangular matrix obeys V⊤V=IV^{\top}V=I, but the reconstruction operator is the diagonal matrix with entries 1, 1, 0, not a three-dimensional identity.

A quarter-turn in the retained plane maps (1,2)⊤(1,2)^{\top} to (−2,1)⊤(-2,1)^{\top}. The squared length remains 4+1=54+1=5. This separates two operations that the later pipeline uses for different purposes: retaining a subspace loses information; rotating coordinates within it does not.

4 The covariance and its eigenvectors

4.1 Centering and covariance

4.1.1 From an average to a measure of spread

The mean is an average: add the observations and divide by their count. For the scalar values 1, 2, and 3, the mean is (1+2+3)/3=2(1+2+3)/3=2. Their deviations are the observed values minus that mean: −1, 0, and 1. Subtracting a common reference mean is called centering. The centered values say where each observation lies relative to that reference rather than relative to zero on the original scale.

Adding signed deviations gives zero here. That does not mean there is no spread; the negative and positive deviations cancel. Squaring avoids this cancellation. The squared deviations are 1, 0, and 1, whose mean is 2/32/3. This average squared deviation is the variance under the total-count convention used for the fitted covariance. Its nonnegative square root, 2/3≈0.8165\sqrt{2/3}\approx0.8165, is the standard deviation. If observations are measured in some unit, variance is measured in that unit squared; standard deviation returns to the original unit.

Some statistical estimates divide the sum of squared deviations by one less than the count, to correct a bias when estimating a population variance from a sample. That is a different convention. The fitted covariance below divides by total weight. We will identify the reference and divisor when using a standard deviation elsewhere.

4.1.2 How two coordinates vary together

For more than one coordinate, calculate a mean for each coordinate. Consider the two observation rows (1,2)(1,2) and (3,4)(3,4). Their mean row is (2,3)(2,3), and their centered rows are (−1,−1)(-1,-1) and (1,1)(1,1). The first-coordinate squared deviations average to 1; the second-coordinate squared deviations also average to 1. The products between the first and second deviations are (−1)(−1)=1(-1)(-1)=1 and (1)(1)=1(1)(1)=1, so their average is also 1.

That last average is the covariance between the two coordinates. It is positive when deviations tend to have matching signs, negative when they tend to have opposite signs, and zero when their average product is zero. Statistical independence means that knowing one variable supplies no information about the other. Zero covariance does not generally establish independence: two variables may still have a relationship that this signed product does not detect.

Arrange these averages in a table. Diagonal entries compare a coordinate with itself and are variances; off-diagonal entries are covariances. For the two-row example the table is

(1111).\begin{pmatrix}1&1\\1&1\end{pmatrix}.

To compute every pairwise product at once, place a centered observation in a column and multiply it by its transpose. This outer product produces a square table. Its entry in row jj, column ll is the product of centered coordinates jj and ll. The two indices select coordinates, not articles. Averaging these tables produces the covariance matrix.

4.1.3 Fit weights change the average, not the operation

Let ii index fitted articles, from 1 to nn, and let dd count embedding coordinates. Each xix_i is a d×1d\times1 column; row ii of the n×dn\times d data matrix XX is xi⊤x_i^{\top}. Let wiw_i be its nonnegative fit weight. A weighted mean gives each observation the stated weight, adds the weighted contributions, then divides by the total weight. Let Z>0Z>0 be that total and μ\mu the d×1d\times1 weighted mean. A sum over ii includes every fitted article, and Z−1Z^{-1} means 1/Z1/Z:

Z=∑iwi,μ=Z−1∑iwixi,Z = \sum_i w_i, \qquad \mu = Z^{-1} \sum_i w_i x_i,

For example, give the two observation rows above weights 1 and 3. The total is 4, the first mean coordinate becomes (1×1+3×3)/4=2.5(1\times1+3\times3)/4=2.5, and the second becomes 3.5. Centering must use this new weighted mean. The centered rows are (−1.5,−1.5)(-1.5,-1.5) and (0.5,0.5)(0.5,0.5). The weighted mean of either squared coordinate is (1×2.25+3×0.25)/4=0.75(1\times2.25+3\times0.25)/4=0.75. Every entry of this example’s weighted covariance is 0.75.

Let Σ\Sigma name the d×dd\times d weighted covariance. Apply precisely the same weights to the outer products of deviations from the weighted mean:

Σ=Z−1∑iwi(xi−μ)(xi−μ)⊤.\Sigma = Z^{-1} \sum_i w_i (x_i - \mu)(x_i - \mu)^{\top}.

The first edition uses uniform article weights; the later archive fit uses inverse daily article counts, explained in §11. These weights are distinct from the story energy used to rank news. In Eigen Times d=384d=384, so Σ\Sigma is a 384×384384\times384 matrix—147,456 numbers summarising the fitted article cloud. Figure 4 pictures the operations in their working order: center each observation, take its outer product, and average the products.

The covariance matrix: centre the rows, then average the outer products.

4.1.4 Why three sums suffice to update the covariance

A practical point matters for updates. Let mm be the d×1d\times1 weighted coordinate sum and MM the d×dd\times d weighted outer-product sum:

m=∑iwixi,M=∑iwixixi⊤.m=\sum_i w_i x_i,\qquad M=\sum_i w_i x_i x_i^{\top}.

The mean is immediately m/Zm/Z. To recover covariance, first expand a single centered outer product:

(xi−μ)(xi−μ)⊤=xixi⊤−xiμ⊤−μxi⊤+μμ⊤.(x_i-\mu)(x_i-\mu)^{\top} =x_ix_i^{\top}-x_i\mu^{\top}-\mu x_i^{\top}+\mu\mu^{\top}.

Now take the weighted average of all four terms. The first becomes M/ZM/Z. In the second and third terms, the weighted average of xix_i is μ\mu, so each becomes −μμ⊤-\mu\mu^{\top}. The last term is the same for every observation and averages to +μμ⊤+\mu\mu^{\top}. Two subtractions and one addition leave one subtraction:

μ=m/Z,Σ=M/Z−μμ⊤.\mu=m/Z,\qquad \Sigma=M/Z-\mu\mu^{\top}.

The three running sums Z,m,MZ,m,M therefore retain everything needed for these mean and covariance calculations. They do not retain the full article collection. New observations with fixed weights can be added without revisiting old observations. If a day’s final article count changes its existing weights, the old contributions must also be corrected. Although the identity is exact, subtracting large nearly equal floating-point numbers can lose accuracy; the streaming chapter distinguishes algebraic identities from numerical reliability.

For compact matrix notation, let W=diag(w1,…,wn)W=\mathrm{diag}(w_1,\ldots,w_n) be the n×nn\times n diagonal weight matrix: diag\mathrm{diag} puts the listed values on the diagonal and zeros elsewhere. Let 𝟏\mathbf1 be a column of nn ones. Multiplying 𝟏μ⊤\mathbf1\mu^{\top} repeats the mean row nn times. The centered data matrix is therefore Xc=X−𝟏μ⊤X_c=X-\mathbf1\mu^{\top}. Multiplying WXcWX_c scales each centered row by its weight; multiplying on the left by Xc⊤X_c^{\top} then sums the weighted products. This gives the same covariance as Σ=Xc⊤WXc/Z\Sigma=X_c^{\top}WX_c/Z.

4.2 Eigenvectors: the axes of the cloud

A cloud of points in dd dimensions has a shape. It can be broad in one direction and narrow in another, even when neither direction follows an original coordinate axis. We want to measure that shape using perpendicular directions. The special directions of the covariance matrix will supply them.

A nonzero d×1d\times1 column vv is an eigenvector of Σ\Sigma with eigenvalue λ\lambda when Σv=λv\Sigma v=\lambda v. The left side multiplies the vector by a matrix; the right side multiplies it by a scalar. Equality says that this input stays on its own line under the matrix operation. For a positive eigenvalue it points the same way and changes length by that factor; a zero eigenvalue sends it to zero.

4.2.1 Check an eigenpair by multiplication

Consider the separate exact example

Σ=(2112).\Sigma=\begin{pmatrix}2&1\\1&2\end{pmatrix}.

Multiplying by (1,1)⊤(1,1)^{\top} gives (3,3)⊤=3(1,1)⊤(3,3)^{\top}=3(1,1)^{\top}. Multiplying by (1,−1)⊤(1,-1)^{\top} gives (1,−1)⊤=1(1,−1)⊤(1,-1)^{\top}=1(1,-1)^{\top}. We have found two eigendirections and eigenvalues 3 and 1. Their dot product is zero. Their lengths are both 2\sqrt2, so divide each by 2\sqrt2 to obtain unit columns, called v1v_1 and v2v_2. Scaling an eigenvector to unit length does not change its eigenvalue.

This is a way to verify an answer, not an assumption that every covariance’s eigenvectors are easy to guess. Numerical algorithms find them for larger matrices. The purpose of the example is to make the equation an operation we can inspect.

For a covariance, eigenvalues are nonnegative. Here is why. Let uu be any unit column direction and let ai=u⊤(xi−μ)a_i=u^{\top}(x_i-\mu) be observation ii’s scalar projection score along it. Its weighted mean is zero because the observations were centered. Its weighted variance is the average squared score. Substituting the covariance definition gives

Z−1∑iwiai2=u⊤Σu.Z^{-1}\sum_i w_i a_i^2=u^{\top}\Sigma u.

The left side is an average of nonnegative squares. If uu is a unit eigenvector with eigenvalue λ\lambda, the right side becomes u⊤(λu)=λ(u⊤u)=λu^{\top}(\lambda u)=\lambda(u^{\top}u)=\lambda. Thus the eigenvalue is exactly the variance along that unit direction and cannot be negative.

4.2.2 Write the whole covariance in its own directions

Choose dd unit, mutually perpendicular eigenvectors vjv_j, ordered by decreasing eigenvalue λj\lambda_j, with j=1,…,dj=1,\ldots,d. Real symmetric matrices permit such a choice, although repeated eigenvalues need not specify unique individual directions. Let VV contain those columns and Λ\Lambda the diagonal matrix of their eigenvalues, both d×dd\times d. They diagonalise the covariance, meaning

Σ=VΛV⊤,V⊤V=I,Λ=diag(λ1,…,λd),\Sigma = V\Lambda V^{\top},\qquad V^{\top}V=I,\qquad \Lambda=\mathrm{diag}(\lambda_1,\ldots,\lambda_d),

where λ1≥λ2≥⋯≥λd≥0\lambda_1\ge\lambda_2\ge\cdots\ge\lambda_d\ge0 and ≥\ge means greater than or equal to. The diagonal representation has zero covariances between different eigenvector coordinates. The principal components are these directions, ranked by variance; using them to summarize the cloud is principal component analysis (PCA).

Read the factorization from right to left when applying it to a column: V⊤V^{\top} expresses the input in eigenvector coordinates, Λ\Lambda scales each coordinate separately, and VV expresses the result back in the original coordinates. The covariance is simple in this basis because no off-diagonal terms mix the coordinates.

Why does the first direction capture the most variance? Express an arbitrary unit direction as a combination u=∑jαjvju=\sum_j\alpha_jv_j, where each scalar αj\alpha_j is its coordinate in the full orthonormal eigenbasis. Its unit length means ∑jαj2=1\sum_j\alpha_j^2=1. Its projected variance becomes

u⊤Σu=∑jλjαj2.u^{\top}\Sigma u=\sum_j\lambda_j\alpha_j^2.

The squared coordinates are nonnegative and add to one. The variance is therefore a weighted average of the eigenvalues and cannot exceed the largest, λ1\lambda_1. Choosing u=v1u=v_1 reaches that largest value. Requiring the next direction to be perpendicular to v1v_1 sets its first coordinate to zero; the same argument then selects v2v_2. This explains the ordering without assuming calculus.

Figure 5 shows 300 points in two dimensions: the long axis has eigenvalue 4.06, the short one 0.44, so about 90% of the displayed variation lies along one direction. The synthetic distribution has known mean zero. This illustration forms second moments about that origin, rather than subtracting the finite sample’s empirical mean; the displayed eigenvalues estimate population variances. The notebook computes both choices so that centering is an explicit decision.

Eigenvectors describe the point cloud’s axes. This synthetic illustration estimates variances about the known population mean zero.

This is the content of “the eigen‑news are the directions that explain the most variance”. Variance describes spread in the chosen numerical representation; the argument alone does not establish significance, truth, or editorial importance. Computing eigenvectors for a 384×384384\times384 symmetric matrix is a standard numerical operation (eigh in common linear-algebra libraries; faer in the Rust implementation) and takes milliseconds in the reported fit.

4.3 How many axes to keep

Let k≤dk\le d count retained directions; ≤\le means less than or equal to. The explained-variance fraction is ∑j=1kλj/∑j=1dλj\sum_{j=1}^{k}\lambda_j/\sum_{j=1}^{d}\lambda_j, provided total variance is positive. It reports how much of the fitted cloud’s variation those directions retain. For the Eigen Times embedding basis, 60 components carry 55% of the variance, and the curve is flat beyond; a small eigenvalue alone does not prove that a direction is meaningless.

In the exact two-direction example, total variance is 3+1=43+1=4. Keeping the first direction retains 3/4=75%3/4=75\% and discards 1/4=25%1/4=25\%. Keeping both retains all the variance. With a longer list of eigenvalues, make the same running calculation: add the retained values, divide by the sum of all values, and inspect what each extra direction contributes. A flat part of that curve means that each new direction adds little to the numerator. It does not mean that the discarded articles or subjects are unimportant.

The Marchenko–Pastur edge asks a different question: how large might covariance eigenvalues be in a specified model of featureless variation? Here noise means variation generated by that reference model, not a judgment about an article. The spectrum of a covariance is its collection of eigenvalues. In this illustration, let NN count independent observations in dd coordinates with equal noise variance σ2\sigma^2, unrelated to the singular-value notation used later. For a concrete reference, suppose all entries are independent draws from the same zero-mean Gaussian distribution, a symmetric bell-shaped probability model, with variance σ2\sigma^2. Independence applies across both observations and coordinates; repeated draws use the same distribution. These assumptions specify an illustrative noise model, not a description of news embeddings. Let λ+\lambda_+ denote the approximate upper edge of the model’s covariance spectrum. Under that model, in the large-sample limit,

λ+=σ2(1+(d/N)1/2)2,\lambda_{+} = \sigma^2 \left(1 + (d/N)^{1/2}\right)^2,

Here raising to 1/21/2 means taking a square root. First form the dimension-to-observation ratio d/Nd/N, take its square root, add one, square, and multiply by the stipulated variance. The notebook uses σ2=0.01\sigma^2=0.01, N=1,000,000N=1{,}000{,}000, and d=384d=384, giving approximately 0.010396. That is slightly larger than 0.01: finite sampling can spread estimated variances even when the model gives every coordinate the same underlying variance. This teaching input is not an estimate fitted to news.

Eigenvalues near or below such a reference may be noise; this is not a universal significance test for correlated, weighted news data. The median eigenvalue supplies a rough noise-variance estimate in the reported comparison. With N≈106N\approx10^6 and d=384d=384, the ratio d/Nd/N is tiny and the edge is close to that estimate. The deployed bases use fixed k=60k=60, with the variance curve as a check. From here onward VV usually means only the retained d×kd\times k columns and Λ\Lambda their k×kk\times k positive eigenvalue matrix; full decompositions will be identified explicitly.

5 The singular value decomposition and LSA

5.1 What the SVD is

The eigendecomposition works on a square covariance. The singular value decomposition (SVD) works directly on a rectangular data matrix. It separates a matrix operation into input directions, nonnegative scale factors, and output directions. The input and output can have different dimensions, so the directions on the two sides need not live in the same space.

5.1.1 Follow one input direction through a rectangular table

For this chapter let XX be any n×dn\times d matrix. A column input has dd entries and the output XvXv has nn entries. In the small example

X=(300200),X=\begin{pmatrix}3&0\\0&2\\0&0\end{pmatrix},

the input (1,0)⊤(1,0)^{\top} maps to (3,0,0)⊤(3,0,0)^{\top}, which is three times the unit output direction (1,0,0)⊤(1,0,0)^{\top}. The input (0,1)⊤(0,1)^{\top} maps to (0,2,0)⊤(0,2,0)^{\top}, which is twice (0,1,0)⊤(0,1,0)^{\top}. These perpendicular input directions map to perpendicular output directions, with scale factors 3 and 2. The output has three entries even though the input has two.

For a general matrix, SVD finds suitable directions even when the input table is not already diagonal. Let vjv_j be a unit right singular direction in the input space, let uju_j be its unit left singular direction in the output space, and let σj\sigma_j be their nonnegative scale. The key relation is Xvj=σjujXv_j=\sigma_ju_j. “Right” and “left” describe where the directions appear in the factorization; neither means an orientation on a page. A zero scale contributes no output in that direction.

5.1.2 Assemble the separate directions into matrices

Let UU be an n×nn\times n orthogonal matrix of left directions, and VV a d×dd\times d orthogonal matrix of right directions. Let Σsvd\Sigma_{\mathrm{svd}} be an n×dn\times d rectangular diagonal matrix: its only potentially nonzero entries lie where row and column indices agree. Those entries are the singular values σj\sigma_j in decreasing order. Then

X=UΣsvdV⊤.X=U\Sigma_{\mathrm{svd}}V^{\top}.

Figure 6 labels this singular-value matrix with the traditional bare Σ\Sigma; it is a different object from the covariance Σ\Sigma in §4. The columns of VV are directions indexed by features, and those of UU are directions indexed by observations. Actual coordinate scores are XV=UΣsvdXV=U\Sigma_{\mathrm{svd}}, not UU alone: each left direction must receive its singular-value scale.

Read the product from right to left, as with eigendecomposition. V⊤V^{\top} resolves an input into right-direction coordinates; Σsvd\Sigma_{\mathrm{svd}} scales those coordinates and accounts for the change in dimension; UU writes the result in the original output coordinates. For the 3×23\times2 example, full factors can use a 3×33\times3 identity for UU, a 2×22\times2 identity for VV, and the displayed rectangular table for Σsvd\Sigma_{\mathrm{svd}}. Nothing needs turning because the table already uses suitable directions.

Let q=min⁡(n,d)q=\min(n,d), where min\min selects the smaller number. The thin SVD removes the unused full-matrix directions: it has UU of shape n×qn\times q, Σsvd\Sigma_{\mathrm{svd}} of shape q×qq\times q, and VV of shape d×qd\times q, with the same product XX. Keeping only k<qk<q directions is the further operation of truncation.

In the example, q=2q=2. The thin UU keeps the first two columns of the three-dimensional identity, the scale matrix becomes diag(3,2)\mathrm{diag}(3,2), and VV remains the two-dimensional identity. Multiplying these factors still reconstructs every entry. Thin factorization changes storage without losing any information; truncation will deliberately lose contributions.

The SVD as blocks. The darker parts illustrate a rank-k truncation: k columns of U, k singular values, and k rows of the transpose of V. The figure’s Sigma denotes the singular-value matrix.

5.1.3 Why covariance eigenvalues contain squared singular values

Transposing a product reverses its order: (AB)⊤=B⊤A⊤(AB)^{\top}=B^{\top}A^{\top}. Apply that rule to the SVD, multiply, and use U⊤U=IU^{\top}U=I. For the full rectangular decomposition the steps are

X⊤X=VΣsvd⊤U⊤UΣsvdV⊤=V(Σsvd⊤Σsvd)V⊤.X^{\top}X =V\Sigma_{\mathrm{svd}}^{\top}U^{\top}U\Sigma_{\mathrm{svd}}V^{\top} =V(\Sigma_{\mathrm{svd}}^{\top}\Sigma_{\mathrm{svd}})V^{\top}.

Each diagonal entry in the middle is a singular value multiplied by itself. For the thin decomposition the middle product is the square diagonal matrix Σsvd2\Sigma_{\mathrm{svd}}^2. Thus the right singular directions are also eigenvectors of the Gram matrix, with squared singular values as eigenvalues. In the exact example, the Gram matrix is diag(9,4)\mathrm{diag}(9,4).

If XX is centered and equally weighted, covariance is that Gram matrix divided by nn. Its right directions therefore stay the same, and its eigenvalues are λj=σj2/n\lambda_j=\sigma_j^2/n. The diagonal example above is not centered, so its Gram matrix should not silently be called an empirical centered covariance. The notebook also applies the identity to the centered six-document table.

For the weighted covariance of §4, instead decompose W1/2XcW^{1/2}X_c. Here W1/2W^{1/2} is diagonal with entries wi\sqrt{w_i}, so it scales each centered row by the square root of its weight. When we form a Gram product, one square-root weight comes from each factor; their product is the full weight wiw_i. Divide the resulting squared singular values by total weight ZZ. Scores for the original, unweighted observations are still XcVX_cV, not the weighted rows’ scores. A direction’s canon is its representative collection of high-scoring stories; a left singular vector alone is not generally the original article-score column in a weighted fit.

5.2 Truncation

Let UkU_k and VkV_k contain the first kk columns of the thin factors, and let Σk\Sigma_k contain their kk singular values on its diagonal. Their shapes are n×kn\times k, d×kd\times k, and k×kk\times k, respectively. The approximation Xk=UkΣkVk⊤X_k=U_k\Sigma_kV_k^{\top} has rank at most kk. It keeps only kk independent contributions with which to rebuild the table.

5.2.1 Measure what a reconstruction leaves behind

The residual table is original minus reconstructed, X−XkX-X_k. A positive residual entry says that the reconstruction was smaller than the original there; a negative entry says it was larger. Adding those signed errors would allow overestimates and underestimates to cancel. Instead square every entry and add. This is the sum of squared errors. Least squares means choosing a reconstruction that makes such a sum as small as the allowed family permits.

The Frobenius norm, written ‖A‖F\lVert A\rVert_F for a matrix AA, is the square root of the sum of all its squared entries. It extends vector length to a whole table by treating every cell as a coordinate. Minimizing this norm or its square gives the same minimizing table, because the square-root function preserves order among nonnegative numbers.

In the rectangular diagonal example, keeping the scale 3 and dropping the scale 2 reconstructs only the entry 3. The residual has a single nonzero entry, 2. Its squared Frobenius norm is therefore 4, and its norm is 2. The original table’s squared norm is 9+4=139+4=13. Define relative error as residual norm divided by the positive original norm; here it is 2/13≈0.55472/\sqrt{13}\approx0.5547. An error ratio is not a proportion of articles reconstructed correctly; it compares geometric lengths in this representation.

5.2.2 A small detour: what minimizing and differentiating mean

Before asking a matrix theorem to minimize anything, solve a scalar fitting problem. Suppose we must replace the observations 1, 2, and 3 by one common fitted value, called θ\theta (Greek theta). Their residuals are 1−θ1-\theta, 2−θ2-\theta, and 3−θ3-\theta. Let J(θ)J(\theta) name their sum of squared residuals; JJ is a function, a rule returning a number for each proposed input θ\theta. Expanding the three squares gives

J(θ)=(1−θ)2+(2−θ)2+(3−θ)2=3θ2−12θ+14=3(θ−2)2+2.\begin{aligned} J(\theta)&=(1-\theta)^2+(2-\theta)^2+(3-\theta)^2\\ &=3\theta^2-12\theta+14\\ &=3(\theta-2)^2+2. \end{aligned}

The last form makes the minimum visible. A square cannot be negative, and (θ−2)2(\theta-2)^2 is zero exactly when θ=2\theta=2. Thus the smallest squared error is 2. Trying θ=1\theta=1 or θ=3\theta=3 gives squared error 5. At the best fit the signed residuals are −1, 0, and 1; their sum is zero, while their sum of squares is two. These are different quantities.

Differentiation provides another way to inspect how changing the fit changes the error. Let hh be a small nonzero change in θ\theta. The difference J(θ+h)−J(θ)J(\theta+h)-J(\theta) is the change in error. Divide by hh to obtain change in error per unit change in the fitted value, an average slope over that step. Expanding the quadratic and canceling equal terms gives

J(θ+h)−J(θ)h=6θ−12+3h.\frac{J(\theta+h)-J(\theta)}{h}=6\theta-12+3h.

As the step becomes arbitrarily small, the last term approaches zero. The resulting local slope is the derivative, written J′(θ)J'(\theta) or dJ/dθ\mathrm{d}J/\mathrm{d}\theta; the prime here means derivative, not the rotated coordinate notation used later:

J′(θ)=6θ−12.J'(\theta)=6\theta-12.

We differentiated to learn which way the error changes. Below 2 the slope is negative, so increasing the fit locally lowers error; above 2 the slope is positive, so increasing it locally raises error. At 2 the slope is zero. A zero derivative is a stationary point, not automatically a minimum for every function. Here the completed-square formula proves it is the global minimum. This example supplies the meaning of derivative, the calculation from a small change, and the reason for setting it to zero. No matrix differentiation is required to use the SVD that follows.

5.2.3 The best reconstruction within a rank budget

The Eckart–Young theorem says that the truncated SVD minimizes ‖X−Xk‖F\lVert X-X_k\rVert_F among all matrices of rank at most kk. This comparison matters: we are not saying that an arbitrary reconstruction is best, or that the reconstruction is a true explanation of the subjects. We are choosing the best approximation under this particular squared-error measure and rank constraint.

The squared error equals the sum of squared discarded singular values. To see the accounting, each singular component has a unit left direction, a unit right direction, and a scale σj\sigma_j. Its contribution to squared table length is σj2\sigma_j^2. Distinct components are perpendicular when their tables are compared entry by entry, so their squared lengths add without cross terms. Keeping the largest scales retains the most of this length budget. The theorem adds the stronger claim that no different rank-kk table does better.

Figure 7 applies this to the six-document matrix of Figure 1. Its singular values are 1.64, 1.51, 0.82, 0.55, and then almost nothing. Relative error means ‖X−Xk‖F/‖X‖F\lVert X-X_k\rVert_F/\lVert X\rVert_F for nonzero XX. Compute it by squaring and adding the discarded singular values, dividing by the sum of all squared singular values, and taking a square root. Rank 1 rebuilds only the war documents (relative error 0.74); rank 2 rebuilds both blocks, war and banking, and the error drops to 0.42; rank 3 reaches 0.24. Two components already separate the two kinds of document in this small example. The notebook uses unrounded singular values, so its checks do not accumulate rounding error from the printed labels.

Truncated SVD of the toy corpus. Rank 1 captures one block; rank 2 captures both.

5.3 Latent semantic analysis

Latent semantic analysis (LSA) uses a truncated SVD of a document–term matrix such as TF‑IDF; Eigen Times additionally centres and, in the archive edition, weights that matrix. Each retained column of VV is a direction over terms. Its entries are loadings: coefficients telling how strongly each input feature contributes to the direction. Its largest term loadings provide a word list (Figure 8). In the toy corpus the first component loads on troops, border, ceasefire, the second on bank, rate, mortgage, rise. In the real Eigen Times v0 basis the axes read bank · financial · credit · rate · loan, Russian · Russia · Ukraine · Putin · Moscow, flight · airline · passenger · airport · crash, and so on—sixty word lists that a reader recognises at once.

There are two distinct roles for a loading. When measuring an article’s coordinate, multiply each term entry by the direction’s loading for that term, then add the products. When reconstructing an article, multiply that whole direction by the article’s coordinate on it. A loading’s sign determines which pole of the direction it supports; its magnitude measures strength within this numerical representation. Neither alone is a probability that a document concerns a subject. A word list is a reading aid extracted from the direction, not a replacement for its full vector.

Term loadings: each column of  is a weighted word list.

The small factorization can be computed directly. The real document–term table needs two additional ideas: applying a centered table without storing it, and finding its leading directions through a much smaller working space. We develop them separately.

5.3.1 Apply centering without storing a dense centered table

For this calculation, XX has nn document rows and pp term columns, μ\mu is its p×1p\times1 reference mean, and 𝟏\mathbf1 has nn entries. Forming Xc=X−𝟏μ⊤X_c=X-\mathbf1\mu^{\top} would turn many absent-term zeros into negative mean values and destroy sparsity. We can still calculate a product involving XcX_c without storing those changed cells.

Let ll count a small number of working columns, let Ω\Omega (capital omega) be any p×lp\times l matrix, and let YY be n×ln\times l. Each column of Ω\Omega is an input direction. Expand the centered product using the rule that multiplication distributes over subtraction:

XcΩ=(X−𝟏μ⊤)Ω=XΩ−(𝟏μ⊤)Ω.X_c\Omega=(X-\mathbf1\mu^{\top})\Omega =X\Omega-(\mathbf1\mu^{\top})\Omega.

Associativity lets us change the grouping in the last product without changing its order. Compute the small 1×l1\times l row μ⊤Ω\mu^{\top}\Omega first, then repeat that row nn times using 𝟏\mathbf1. For the transposed operation, apply the same reasoning. The resulting identities are

XcΩ=XΩ−𝟏(μ⊤Ω),X_c\Omega=X\Omega-\mathbf1(\mu^{\top}\Omega), Xc⊤Y=X⊤Y−μ(𝟏⊤Y).X_c^{\top}Y=X^{\top}Y-\mu(\mathbf1^{\top}Y).

The results have shapes n×ln\times l and p×lp\times l. In the second correction, 𝟏⊤Y\mathbf1^{\top}Y adds each column of YY over observations; multiplying those column totals by μ\mu constructs the needed adjustment. Each correction is an outer product, of rank at most one, because all its columns are scalar multiples of the same column. The sparse XX is used as is; the centered dense matrix need never be stored. The notebook verifies both identities against a directly centered small table before using them in the larger algorithm.

5.3.2 Build a small working space

A 1,093,166×50,0001{,}093{,}166\times50{,}000 matrix is far too large for a full classical SVD here, but only the top 60 directions are wanted. The method of Halko, Martinsson and Tropp approximates them with repeated matrix products. Draw a random 50,000×8050{,}000\times80 matrix Ω\Omega: l=80l=80 working columns provide k=60k=60 desired directions plus 20 extra directions for approximation. Each random column mixes many input features; applying XcX_c gives one corresponding mixture of output directions. The resulting n×ln\times l table Y=XcΩY=X_c\Omega is called a sketch: a smaller collection of vectors with which to explore the large matrix’s output space. The extra columns are oversampling, a margin for approximation rather than extra final news axes.

The range of a matrix is the set of outputs it can produce. The goal is for the sketch’s span to cover the most important part of that range. Random combinations can capture the leading directions well when the singular values decay sufficiently; the method offers an approximation whose quality must still be assessed.

5.3.3 Make the working directions perpendicular

To orthonormalise is to replace spanning vectors by perpendicular unit vectors spanning the same space. Here is one step of the Gram–Schmidt idea used to explain that operation. Take columns a=(1,1)⊤a=(1,1)^{\top} and b=(1,0)⊤b=(1,0)^{\top}. First normalize aa to the unit column q1=a/2q_1=a/\sqrt2. The scalar q1⊤b=1/2q_1^{\top}b=1/\sqrt2 measures how much of bb already lies along q1q_1. The corresponding vector contribution is q1(q1⊤b)=(1/2,1/2)⊤q_1(q_1^{\top}b)=(1/2,1/2)^{\top}.

Subtract that contribution from bb. The residual is (1/2,−1/2)⊤(1/2,-1/2)^{\top} and has dot product zero with q1q_1. Normalize it to get q2=(1,−1)⊤/2q_2=(1,-1)^{\top}/\sqrt2. The columns q1,q2q_1,q_2 now have unit lengths and zero mutual dot product, while their combinations still reach the same plane as a,ba,b. If the residual were zero, the new input would add no independent direction and should be skipped. Practical routines also address floating-point accuracy, often with repeated orthogonalization or other stable factorizations. The notebook checks the small construction directly.

5.3.4 Strengthen leading directions, then factor the small table

Two rounds of power iteration amplify stronger singular directions relative to weaker ones. The update Y←Xc(Xc⊤Y)Y\leftarrow X_c(X_c^{\top}Y) means replace YY by that product. The left arrow denotes assignment: calculate the right side using the current YY, then store the result as the next YY.

Why does this help? A left singular direction with scale σj\sigma_j receives a factor σj\sigma_j when mapped back by Xc⊤X_c^{\top} and another factor σj\sigma_j when mapped forward by XcX_c. Its coefficient is multiplied by σj2\sigma_j^2. In the rectangular diagonal example the two factors are 9 and 4, so the stronger contribution gains relative to the weaker. Orthonormalising between rounds prevents all the stored columns from merely growing huge and becoming numerically indistinguishable. The calculation applies two products in sequence; it does not form a huge XcXc⊤X_cX_c^{\top} matrix.

Call the final n×ln\times l orthonormal working matrix QrangeQ_{\mathrm{range}}. Its columns describe a smaller output space in which to seek the answer. The product Qrange⊤XcQ_{\mathrm{range}}^{\top}X_c expresses every original feature column in those working coordinates and has shape l×pl\times p. Compute an SVD of that smaller table. Its left directions have ll entries; multiplying them by QrangeQ_{\mathrm{range}} returns them to the original nn-entry output space. Retain the desired kk directions. If a sketch has fewer than ll independent columns, the working dimension is reduced accordingly.

This gives an approximate truncated SVD of XcX_c. Weighted fitting applies the same method to W1/2XcW^{1/2}X_c. Each sparse product touches the nonzero entries once. On the reported laptop the first LSA fit, including tokenising 1.6 GB of text twice, takes about five minutes. A fixed random seed, input order, and numerical procedure make the computation reproducible. For teaching, the notebooks use the same explicitly specified four-column sketch in both languages, so differences in random-number generators cannot hide disagreements in the algebra.

6 From eigenvectors to named axes

6.1 Two ambiguities

Eigenvectors come with two kinds of freedom that the mathematics does not fix and a newspaper must.

6.1.1 Choose which end of an axis points positive

If vv is an eigenvector, so is −v-v: the same line pointing the other way. A score is measured by a dot product with the direction, so flipping the direction also flips its scores. The contribution to reconstruction is unchanged because (−v)(−c)=vc(-v)(-c)=vc for a scalar score cc. Its positive and negative poles, the two ends of the line, exchange names. Choosing a sign gives the display a consistent convention without changing the represented observations.

Eigen Times fixes orientation using skewness, a measure of asymmetry in the score distribution. Here a distribution describes how frequently different score values occur, and a tail is the part extending toward unusually large or small scores. A central moment averages powers of deviations from the mean. We already know the second central moment: averaging squared deviations gives variance. The third central moment instead averages cubed deviations. Cubing retains signs, so a large negative deviation contributes negatively and a large positive deviation contributes positively.

Let m2m_2 and m3m_3 denote the second and third central moments on one axis. For the notebook’s scores −5, −1, 0, 1, 1, the mean is −0.8. The centered scores are −4.2, −0.2, 0.8, 1.8, 1.8. Squaring and averaging gives m2=4.96m_2=4.96; cubing and averaging gives m3=−12.384m_3=-12.384. The negative third moment says that, by this signed cubic measure, the negative side is more pronounced.

When m2>0m_2>0, standardized skewness is m3/m23/2m_3/m_2^{3/2}. The power 3/23/2 means the standard deviation cubed: m23/2=(m2)3m_2^{3/2}=(\sqrt{m_2})^3. This division removes the units of the scores, but it does not change the sign. The orientation rule therefore needs only the sign of m3m_3: flip if m3<0m_3<0, making the third moment positive. Reversing all centered scores preserves their squares and reverses their cubes. This is a convention based on the measured third moment, not a claim that every asymmetric distribution has one unambiguous longer tail. A zero third moment supplies no preferred sign. The streaming chapter computes these moments without retaining every score.

6.1.2 Choose directions inside an already selected subspace

Equal eigenvalues are called degenerate: any perpendicular unit pair in their plane is an eigenbasis. For example, a covariance equal to twice the identity multiplies every direction by two. There is no uniquely preferred diagonal in its plane because every unit direction has variance two. The notebook rotates this covariance and verifies that its entries remain unchanged.

Close eigenvalues can make individual directions sensitive to small data changes, even when their shared subspace is stable (Figure 9). A perturbation is such a change to the covariance; the eigenvalue gap is the separation from neighbouring eigenvalues. The tracking chapter explains the bound relating them. Even distinct principal axes can be difficult to name: variance-maximising directions may blend subjects such as markets and party politics. Naming keeps the selected subspace and chooses different axes inside it; the rotated axes need no longer be covariance eigenvectors. The purpose of the new coordinates is readability, while the retained geometric information stays the same.

Well‑separated eigenvalues pin the axes; exactly equal ones admit many eigenbases, while nearly equal ones are sensitive to perturbations. The tracking chapter gives the precise stability bound.

6.2 Varimax

6.2.1 Turn the axes and counter-turn the coordinates

Recall the retained d×kd\times k orthonormal basis VV. Let RR be a k×kk\times k orthogonal rotation and let V′=VRV'=VR be the named basis; the prime here means rotated. If cc is a k×1k\times1 raw coordinate column, its named column is y=R⊤cy=R^{\top}c (also sometimes written c′c'). Why does the coordinate transformation use the transpose? The coordinates must change oppositely to the basis so that the represented point stays fixed. Substituting yy and using RR⊤=IRR^{\top}=I gives

V′y=VR(R⊤c)=Vc.V'y=VR(R^{\top}c)=Vc.

Both bases therefore reconstruct the same projection. Subtracting that same projection from an observation leaves the same residual, so its length is unchanged. The covariance-adjusted distance called T2T^2 in §7 is also unchanged when its covariance is transformed consistently; it is not determined by the subspace alone.

6.2.2 Read the criterion as a variance calculation

Kaiser’s varimax criterion selects a rotation making each direction load strongly on some features and weakly on others. A criterion, or objective, is a numerical rule for comparing candidate choices. A larger value of this criterion indicates greater contrast in the sizes of loadings within the columns. It favors concentration but does not force entries to become exactly zero.

Let pp count the features, let i=1,…,pi=1,\ldots,p index them, and let j=1,…,kj=1,\ldots,k index axes. Write ℓij\ell_{ij} for row ii, column jj of the rotated loading table. Hold one column jj fixed. Square each loading, average those squared loadings, then measure how much the squared loadings vary around their mean. Squaring treats equally strong positive and negative loadings equally; it is concentration of magnitude that matters here.

We already derived the identity “variance equals mean square minus square of mean.” Apply it to the values ℓij2\ell_{ij}^2. Their squares are ℓij4\ell_{ij}^4, so this column’s variance is the average fourth power minus the square of the average second power. Add those variances over columns. That sequence of operations gives the criterion

∑j=1k[1p∑i=1pℓij4−(1p∑i=1pℓij2)2].\sum_{j=1}^{k}\left[\frac1p\sum_{i=1}^{p}\ell_{ij}^{4}-\left(\frac1p\sum_{i=1}^{p}\ell_{ij}^{2}\right)^2\right].

The fourth power appears because it is the square of a squared loading. It is not a new assumption that extreme feature values should be counted four times. For a two-feature column with loadings 1 and 0, squared loadings are 1 and 0, their mean is 0.5, and the variance of those squared loadings is ((1−0.5)2+(0−0.5)2)/2=0.25((1-0.5)^2+(0-0.5)^2)/2=0.25. Spread the same total squared loading equally by using loadings 1/21/\sqrt2 and 1/21/\sqrt2. The squared loadings are now 0.5 and 0.5, so their variance is zero. The first column has greater concentration even though both columns have squared length one. In a rotation we cannot choose each column independently: the whole loading table must turn together. The notebooks compute the variance of squared loadings by directly subtracting each column’s mean and also by the displayed formula; the two methods agree.

Figure 10 shows six variables in two groups mixed by 30°. Their small secondary loadings make the computed maximizing rotation approximately −33.3°-33.3°, rather than an exact reversal of the mixing angle. The rotation concentrates each variable on one axis without making its other loading exactly zero.

Varimax: the same plane, different axes. Before rotation the loadings are mixed; afterwards they are more concentrated on individual factors, with small secondary loadings remaining.

6.2.3 Rotate two columns at a time

Eigen Times sweeps over every pair of axes, rotating just that pair by its best angle. This two-coordinate operation is a Givens rotation. It leaves the other columns unchanged, reducing one step of a many-axis search to choosing one angle.

Let ϕ\phi (Greek phi) denote that angle. Angles may be measured in degrees, with 360° in a full turn, or in radians, where angle is arc length divided by circle radius. One full turn is 2π2\pi radians, with π\pi the circle constant. On the unit circle, cos⁡ϕ\cos\phi is the horizontal coordinate and sin⁡ϕ\sin\phi the vertical coordinate after turning through ϕ\phi from the positive horizontal direction. Their squared sum is 1 because the point lies on that circle. A two-dimensional rotation matrix is

R(ϕ)=(cos⁡ϕ−sin⁡ϕsin⁡ϕcos⁡ϕ).R(\phi)=\begin{pmatrix}\cos\phi&-\sin\phi\\\sin\phi&\cos\phi\end{pmatrix}.

For one pair only, let x,yx,y be its p×1p\times1 loading columns, distinct from article and score vectors elsewhere. Multiplying the loading table by R(ϕ)R(\phi) changes row ii’s pair to

xicos⁡ϕ+yisin⁡ϕ,−xisin⁡ϕ+yicos⁡ϕ.x_i\cos\phi+y_i\sin\phi,\qquad -x_i\sin\phi+y_i\cos\phi.

These two entries’ squared sum remains xi2+yi2x_i^2+y_i^2. Rotation redistributes a row’s contribution between axes while preserving its total squared size.

6.2.4 Why the best angle contains a quarter of an angle

We can evaluate the criterion for many trial angles, but the two-column case also has a direct formula. Elementwise arithmetic treats each row separately. Define ui=xi2−yi2u_i=x_i^2-y_i^2 as the difference of the squared loadings and vi=2xiyiv_i=2x_iy_i as twice their product. Define four scalar sums

A=∑iui,B=∑ivi,C=∑i(ui2−vi2),D=∑i2uivi.A=\sum_i u_i,\quad B=\sum_i v_i,\quad C=\sum_i(u_i^2-v_i^2),\quad D=\sum_i2u_iv_i.

These local capital letters are scalars, not earlier matrices. The first two sums measure the column totals of the new quantities; the last two collect their squared and cross-product terms. Define centered combinations C*=C−(A2−B2)/pC_*=C-(A^2-B^2)/p and D*=D−2AB/pD_*=D-2AB/p. The subscript star marks these adjusted scalar values.

Here is the route from the criterion to the angle. After rotation, the difference of the two squared loadings is uicos⁡(2ϕ)+visin⁡(2ϕ)u_i\cos(2\phi)+v_i\sin(2\phi), obtained by expanding the two squared rotated entries and using the double-angle identities. In those identities, cos⁡(2ϕ)=cos⁡2ϕ−sin⁡2ϕ\cos(2\phi)=\cos^2\phi-\sin^2\phi and sin⁡(2ϕ)=2sin⁡ϕcos⁡ϕ\sin(2\phi)=2\sin\phi\cos\phi. Substituting this difference into the variance criterion and expanding once more leaves an angle-independent part plus

C*cos⁡(4ϕ)+D*sin⁡(4ϕ)4p.\frac{C_*\cos(4\phi)+D_*\sin(4\phi)}{4p}.

The appearance of 4ϕ4\phi comes from squaring expressions that already involve 2ϕ2\phi. We can maximize the displayed part geometrically: it is a dot product between the fixed vector (C*,D*)(C_*,D_*) and the unit vector (cos⁡(4ϕ),sin⁡(4ϕ))(\cos(4\phi),\sin(4\phi)), divided by a positive constant. The dot product is largest when the unit vector points along the fixed vector. The function atan2⁡(a,b)\operatorname{atan2}(a,b) returns the angle of the point with horizontal coordinate bb and vertical coordinate aa, preserving the quadrant that a ratio alone would lose. It supplies 4ϕ4\phi; divide by four to get

ϕ=14atan2⁡(D−2AB/p,C−(A2−B2)/p).\phi = \tfrac{1}{4}\,\operatorname{atan2}\left(D - 2AB/p,\; C - (A^2 - B^2)/p\right).

This is a formula for choosing a maximizing angle, not a requirement to memorize trigonometric manipulation. The notebooks check its objective against a dense grid of trial angles and verify the angle-dependent expression. If both arguments of atan2\operatorname{atan2} are zero, that expression is constant and the pair supplies no preferred rotation.

A sweep visits every axis pair. Sweeps stop when no pair rotates by more than 10−610^{-6} radians (one millionth of a radian), or after fifty sweeps. Exact pairwise maximization cannot decrease the criterion, so its bounded objective improves monotonically, meaning it never moves downward. This does not guarantee the global best orientation: the choices across many column pairs interact. The reported alternative, an SVD-based fixed-point iteration (repeatedly applying one update rule), oscillated between two mirror-image states on a symmetric configuration, motivating the pairwise method.

6.2.5 Give an embedding direction evidence from words

For the embedding basis, naming rotates associations with words rather than unexplained embedding coordinates. The articles supply the common rows connecting the two descriptions: each has term measurements and raw eigen-coordinates.

Let TT be the N×pN\times p article TF‑IDF matrix, μT\mu_T its p×1p\times1 article mean, and 𝟏\mathbf1 a column of NN ones. Let SS be an N×kN\times k table of raw eigen-coordinates divided by their positive raw-axis standard deviations. Dividing a coordinate by its standard deviation makes one unit mean one reference standard deviation on every axis. Because the unrotated eigen-coordinates already have zero reference mean and zero reference cross-covariance, this scaling gives unit reference variance and zero reference cross-covariance. Together those properties are called whitening. Scaling arbitrary correlated coordinates to unit variance would not by itself remove their cross-covariances.

Let β\beta (Greek beta) be the p×kp\times k term-loading matrix. Its entry for one term and one axis sums, over articles, the centered term value multiplied by that article’s standardized raw score. Positive products arise when the term and score are both above their respective references, or both below. The sum measures association between term use and the direction; it is not a probability and has not been divided by the number of articles. Matrix multiplication performs all these sums together:

β=(T−𝟏μT⊤)⊤S.\beta=\left(T-\mathbf1\mu_T^{\top}\right)^{\top}S.

Here p=50,000p=50{,}000 and k=60k=60. Lexical whitening floors its raw variance denominators at 10−1210^{-12} before taking square roots: if a variance is smaller, the implementation uses that positive minimum to avoid division by zero or an excessively small scale. Exact unit-variance whitening applies to positive axes whose denominators have not been changed by this safeguard, under the same reference weights used to fit them.

The embedding naming fit rotates β\beta; the LSA fit rotates its right singular directions, already indexed by terms. Applying the resulting RR to the corresponding raw coordinate map gives named directions. Because scaling and rotation need not give the same result in opposite orders, word associations fitted from whitened scores are labels for investigation, not exact term-by-term decompositions of every stored named score. The block-sum chapter expands the centered loading formula. The older shorthand T⊤UT^{\top}U assumes compatible centered, scaled score columns; the SVD factor UU must not generally be substituted for SS. The distinction is practical: a unit left singular direction, an article coordinate, and a variance-standardized coordinate carry different scales even when they point along related patterns.

7 Measuring a story

7.1 Projection, reconstruction, residual

The question is now about one observation: how much of it can the retained directions reconstruct, and what do they leave out? Here an observation is an article, or a representative vector chosen for a story. It is already a numerical vector; we are not yet assigning it a claim about historical novelty.

Let dd count its original coordinates and kk count retained directions. Write xx for the d×1d\times1 observation column and μ\mu for the d×1d\times1 fitted article mean. The d×kd\times k matrix VV contains the retained raw directions as columns. They are orthonormal: each has length one and different columns have dot product zero. The following steps have different jobs.

7.1.1 First find coordinates, then reconstruct

Subtract the reference point. The centred column x−μx-\mu is the displacement from the fitted mean. Projection concerns this displacement, so the mean must be removed before measuring coordinates.

Measure along each retained direction. Define the k×1k\times1 coordinate column cc. Entry cjc_j, with j=1,…,kj=1,\ldots,k, is the dot product with retained direction jj. Stacking those dot products is matrix multiplication:

c=V⊤(x−μ).c=V^{\top}(x-\mu).

Rebuild what those coordinates describe. Multiplying by VV takes the weighted sum of the retained directions. Adding the mean puts the result back in the original coordinate system. Call this d×1d\times1 reconstruction x̂\hat x; the hat marks an approximation:

x̂=μ+Vc.\hat x=\mu+Vc.

Subtract the reconstruction from the observation. The d×1d\times1 difference rr is the residual: what remains after the attempted reconstruction. The word names a difference vector, not its length and not its probability:

r=x−x̂.r=x-\hat x.

For a complete synthetic example, retain the first two coordinate directions in three dimensions. Take x=(2,1,3)⊤x=(2,1,3)^{\top} and μ=(0,0,0)⊤\mu=(0,0,0)^{\top}. Then

V=(100100),c=(21),x̂=(210),r=(003).V=\begin{pmatrix}1&0\\0&1\\0&0\end{pmatrix},\qquad c=\begin{pmatrix}2\\1\end{pmatrix},\qquad \hat x=\begin{pmatrix}2\\1\\0\end{pmatrix},\qquad r=\begin{pmatrix}0\\0\\3\end{pmatrix}.

The first coordinate survives unchanged, the second survives unchanged, and the third is absent from the retained plane. Subtraction reveals that absence explicitly: 3−0=33-0=3 in the last residual entry.

7.1.2 Why this is the nearest reconstruction

An orthogonal projection keeps the component in the chosen subspace and leaves a residual perpendicular to it. Here this can be checked by taking its coordinates again. Since V⊤V=IV^{\top}V=I, where II is the k×kk\times k identity,

V⊤r=V⊤(x−μ)−V⊤Vc=c−c=0.V^{\top}r=V^{\top}(x-\mu)-V^{\top}Vc=c-c=0.

Thus every retained direction has zero dot product with the residual. This is also why the reconstruction is a least-squares one. Any change to the reconstructed point within the retained subspace adds another perpendicular component to the error. Its squared length adds to the existing residual squared length, so it cannot improve the fit. No differentiation is needed for this geometric argument.

Recall the two distinct operations in a length calculation. Squaring entries and adding them gives squared length; taking its square root gives length. For our residual,

‖r‖2=02+02+32=9,‖r‖=9=3.\lVert r\rVert^2=0^2+0^2+3^2=9,\qquad \lVert r\rVert=\sqrt9=3.

The centred observation has squared length 22+12+32=142^2+1^2+3^2=14. The retained part has squared length 22+12=52^2+1^2=5. The Pythagorean identity reads 14=5+914=5+9: retained variation and residual variation account for the whole squared length. We use squared lengths below because perpendicular contributions add in this way. The ordinary lengths do not add: 14\sqrt{14} is not 5+3\sqrt5+3.

A story against the basis: its projection onto the news subspace, and the residual perpendicular to it.

7.2 T² and Q

We need two different comparisons. One asks how far the story lies along the retained directions, taking each direction’s usual spread into account. The other asks how much of the story lies outside those directions. A statistic is a numerical summary calculated from data; calling something a statistic does not by itself assign a probability to it.

7.2.1 Compare a coordinate with its usual spread

Recall that variance is an average squared deviation from a mean, and standard deviation is its nonnegative square root. Raw coordinate jj has fitted mean zero and variance λj\lambda_j. For this calculation retain only positive eigenvalues, so dividing by λj\sqrt{\lambda_j} is possible. The quotient cj/λjc_j/\sqrt{\lambda_j} expresses the coordinate in units of its own standard deviation. A displacement of two units is ordinary on an axis whose usual spread is two, but larger relative to an axis whose usual spread is one.

A z-score subtracts a reference mean and divides by a positive reference standard deviation. The mean subtraction has already happened for the raw coordinates. Their variances can differ, but their fitted cross-covariances are zero. Dividing each by its own standard deviation therefore gives whitened coordinates: unit variance in every direction and zero cross-covariances under that same fitted reference.

Define T2T^2, Hotelling’s squared covariance-adjusted distance, by squaring these standardized coordinates and adding. Here T2T^2 is the statistic’s name, not the square of the TF‑IDF matrix TT. With j=1,…,kj=1,\ldots,k,

T2=∑j(cjλj)2=∑jcj2λj.T^2=\sum_j\left(\frac{c_j}{\sqrt{\lambda_j}}\right)^2 =\sum_j\frac{c_j^2}{\lambda_j}.

Our synthetic story has c=(2,1)⊤c=(2,1)^{\top}. Suppose the fitted raw variances are 44 and 11, hence standard deviations 22 and 11. Its standardized coordinates are (2/2,1/1)⊤=(1,1)⊤(2/2,1/1)^{\top}=(1,1)^{\top}. Squaring and adding gives

T2=12+12=2.T^2=1^2+1^2=2.

Both retained coordinates are one reference standard deviation from their means, although their original sizes differ.

For compact matrix notation let Λ\Lambda be the k×kk\times k diagonal matrix of those positive raw eigenvalues. A superscript −1-1 denotes an inverse, the operation undoing multiplication by an invertible matrix. For a diagonal matrix, inversion replaces each nonzero diagonal entry by its reciprocal. Consequently Λ−1\Lambda^{-1} first divides coordinate jj by λj\lambda_j; the dot product with cc then multiplies by cjc_j again and adds:

T2=c⊤Λ−1c.T^2=c^{\top}\Lambda^{-1}c.

7.2.2 Measure the part outside the retained space

Define QQ to be residual squared length:

Q=‖r‖2.Q=\lVert r\rVert^2.

For the same story, Q=9Q=9. This is a different measurement from T2=2T^2=2. A point can be far along a retained direction and have no residual at all; another can lie close to the mean within the retained directions but have a substantial perpendicular residual. A residual can contain discarded familiar variation as well as genuinely new material. Neither statistic alone proves that an event is unprecedented.

Figure 12 shows why reference spreads matter: equal Euclidean distances can have different covariance-adjusted distances. With 60 fitted positive directions, the fitted average of T2T^2 under the matching covariance weights is 60. To see why, average each term cj2/λjc_j^2/\lambda_j: the numerator’s fitted average is precisely λj\lambda_j, so every term contributes one. A value of 400 is much larger than that fitted average. This arithmetic does not yet provide the probability of reaching 400; that would require a justified probability model or a separately assessed reference distribution.

7.2.3 Keep the covariance when changing coordinates

The calculation uses raw eigen-coordinates before the naming rotation. The rotation changes the coordinate descriptions without changing the retained point. Recall the k×kk\times k orthogonal naming rotation RR. In the named coordinate column y=R⊤cy=R^{\top}c, define the covariance Γ=R⊤ΛR\Gamma=R^{\top}\Lambda R. Its off-diagonal entries need not be zero: named coordinates can vary together even though the raw eigen-coordinates did not.

To measure the same distance in this new coordinate system, use its full covariance:

T2=y⊤Γ−1y.T^2=y^{\top}\Gamma^{-1}y.

The inverse now adjusts for both different spreads and shared movement between coordinates. Reusing the old diagonal eigenvalues would attach old scales to new directions. Dividing by the named coordinates’ own variances is also insufficient when their covariances are nonzero. That operation is marginal standardization: it gives each coordinate unit variance separately but leaves correlations. Full whitening removes cross-covariances as well. The notebooks rotate the synthetic story and verify that the full calculation stays unchanged while the diagonal shortcut generally changes it.

The implementation sums cj2/λjc_j^2/\lambda_j only for positive raw eigenvalues and contributes zero otherwise. This is an explicit handling rule for zero-variance directions, not permission to divide by zero. The inverse formulas above assume positive retained eigenvalues.

Whitening: after dividing each raw eigen-coordinate by its axis’s standard deviation, squared distance from the centre is T squared.

7.2.4 Turn residual size into a share

The two statistics originated in monitoring variation against a principal-component reference model. For browsing, it is also useful to ask what share of a centred observation remains outside the retained subspace. Let ν\nu (Greek nu) denote this novelty ratio. When x≠μx\ne\mu, meaning the observation differs from the fitted mean, define

ν=Q‖x−μ‖2.\nu=\frac{Q}{\lVert x-\mu\rVert^2}.

The denominator counts all centred squared length; the numerator counts only the residual part. In our example, ν=9/14≈0.643\nu=9/14\approx0.643. About 64.3% of this observation’s squared length lies outside the retained plane. That is a statement about this representation, not a 64.3% probability of a historically new event.

Orthogonality makes the denominator the sum of retained and residual squared lengths, both nonnegative. The ratio therefore lies between zero and one. Zero means the centred vector is fully represented; one means it lies perpendicular to the retained subspace. At x=μx=\mu, both numerator and denominator are zero, so the ratio is undefined. The implementation returns zero in that case as a software convention. This geometric use of “energy” means squared length; the attention score below uses the same ordinary word for a different quantity.

7.2.5 Average measurements in the order intended

These equations describe one vector. The site’s stored story statistics are means of the member articles’ T2T^2, QQ, and ν\nu values. The order matters: measure every member, then average the measurements. Measuring the mean embedding answers a different question.

For example, two member coordinate columns (2,0)⊤(2,0)^{\top} and (−2,0)⊤(-2,0)^{\top} under variances (4,1)(4,1) each have T2=4/4=1T^2=4/4=1, so their mean statistic is one. Their mean coordinate column is zero, whose T2T^2 is zero. Averaging first cancels their opposite departures. Squared distances and ratios generally do not commute with averaging; that is why an article statistic, an average article statistic, and a centroid statistic must be kept distinct.

7.3 Dominant axis, spectrum, profile

These three objects answer questions at three different levels. The dominant axis selects a story’s label. The spectrum combines the day’s stories. A profile describes the stories usually carrying one label.

7.3.1 Select a label using comparable signed scores

For story ss, let ysy_s be its k×1k\times1 named-coordinate column, with entry ysjy_{sj} on axis jj. Here ss identifies a story. The separate notation sj>0s_j>0 denotes the empirical standard deviation of named coordinate jj across stories in the profile window: the latest ten years of loaded data. This is a reference scale, estimated separately from the raw eigenvalue λj\lambda_j. The implementation replaces scales smaller than 10−610^{-6} by that positive floor to avoid division by zero or an extremely small denominator.

Divide each named coordinate by its reference scale. The dominant archetype is the axis with the largest signed result. The notation arg⁡max⁡j\arg\max_j means “return the index attaining the largest value”, whereas max⁡j\max_j would return the value itself. Thus the rule is arg⁡max⁡jysj/sj\arg\max_j y_{sj}/s_j.

Take the notebook’s synthetic story (2,1)⊤(2,1)^{\top} and scales (2,0.5)(2,0.5). The scores are 2/2=12/2=1 and 1/0.5=21/0.5=2, so the second axis wins despite its smaller raw coordinate. For a second story (−1,−0.1)⊤(-1,-0.1)^{\top}, the scores are −0.5-0.5 and −0.2-0.2. The second wins again because −0.2-0.2 is larger. Taking absolute values would change that decision. This particular rule does not subtract an empirical axis mean, so it is scale division rather than a general mean-subtracted z-score.

One possible “mixed” heuristic compares the positive top score a1a_1 with the runner-up a2a_2. Their relative gap is (a1−a2)/a1(a_1-a_2)/a_1; the denominator is the top score. A rule declaring a mixture when that gap is at most 0.200.20 would accept scores 11 and 0.850.85, whose gap is 0.150.15. This is an illustrative rule retained from the original explanation, not a rule implemented by the current site.

7.3.2 Combine stories into a daily spectrum

A simple average gives every story equal influence. A weighted mean first multiplies each value by its nonnegative weight, adds those products, and divides by the positive total weight. Division by the total makes the result an average rather than a total that grows automatically when more stories are present.

Let εs\varepsilon_s denote story ss’s attention weight, called story energy in the site:

εs=distinct sources×ln⁡(1+article count).\varepsilon_s=\text{distinct sources}\times\ln(1+\text{article count}).

The natural logarithm grows slowly; adding one makes the argument positive even for a zero count. This weight uses source and article counts. It is distinct from article fit weights, eigenvalues, and vector squared length.

For one chosen day, let y‾day\bar y_{\mathrm{day}} be its k×1k\times1 spectrum column. The bar indicates averaging, and the sum includes that day’s stories only:

y‾day=∑sεsys∑sεs.\bar y_{\mathrm{day}}=\frac{\sum_s\varepsilon_s y_s}{\sum_s\varepsilon_s}.

The notebooks use three synthetic story rows (2,1)(2,1), (−1,−0.1)(-1,-0.1), and (0.5,3)(0.5,3), with source counts 2,1,32,1,3 and article counts 3,1,53,1,5. Their attention weights are 2ln⁡4≈2.7732\ln4\approx2.773, ln⁡2≈0.693\ln2\approx0.693, and 3ln⁡6≈5.3753\ln6\approx5.375. For the first spectrum coordinate, multiply 2,−1,0.52,-1,0.5 by those weights, add, and divide by their sum. Repeating for the second coordinate gives approximately (0.853,2.130)(0.853,2.130). The more heavily weighted third story pulls the mixture towards its second coordinate; no new direction has been fitted in this averaging step.

7.3.3 Compare a day, or compare a story

The era statistics are each spectrum coordinate’s mean and standard deviation over all loaded day spectra. The algorithm named after Welford updates three running summaries: how many values have arrived, their current mean, and the sum of squared deviations from that current mean. It adjusts the deviation sum when the mean changes; simply squaring deviations from an outdated mean would give the wrong answer. The statistical-threshold chapter walks through its calculation.

Each spectrum z-score subtracts the coordinate’s era mean and divides by its positive era standard deviation. The front page highlights values beyond ±2\pm2 (plus or minus two) and lists values below −2-2 under Silence. These are comparisons with all loaded data, including dates later than some selected historical dates. They are not historical forecasts computed using only the past available at the time.

An archetype’s profile uses a different reference set: the stories it dominates in the profile window. For each named coordinate, it records a mean and standard deviation among those stories. Same as always combines strong positive profile and story signals with agreement within one profile standard deviation; agreement alone is insufficient. Different this time lists departures exceeding 1.5 profile standard deviations. The symbol σ\sigma in these descriptions is shorthand for the relevant reference standard deviation, not an SVD singular value. A zero reference deviation needs an explicit fallback before any z-score can be computed. Always identify the reference population before interpreting a standardized score.

8 The clustering thresholds

A threshold turns a numerical measurement into a decision: link two articles if their similarity reaches a chosen value; highlight an axis if its standardized departure exceeds a chosen size. The measurement and the decision are separate. Cosine supplies a similarity, but mathematics alone does not say which cosine deserves a link.

The thresholds described here use cosines, z-scores, and counts. This chapter shows the empirical distributions used to choose them for the dated Eigen Times corpus. The methods also apply to Eigen Hacks, but these recorded newspaper measurements are not measurements of its technology-community corpus. A changed embedding model, input length, language, or corpus can change the distribution enough to require a fresh assessment.

8.1 Stories: single linkage on a day’s articles

Start with a graph: a collection of nodes and connections called edges. Here each article is a node. Compare each pair of that day’s article vectors; add an undirected edge when their cosine reaches the chosen threshold. Undirected means that a link from the first article to the second is also a link back.

Next follow links, including indirect links. A path is a sequence of edges joining successive nodes. A connected component is a maximal group joined by paths: no linked node has been left outside it. Each component becomes one story. An isolated article is a singleton, a component of size one.

This rule is called single linkage because one eligible link is enough to join groups. It does not require every pair in a story to meet the threshold. A union–find data structure implements that decision economically: each node begins in its own group; whenever an edge joins two groups, their group records are merged. It is a bookkeeping method for the same connected components, not an additional similarity rule.

The notebooks show the resulting chaining with four synthetic unit directions at 0, 30, 60, and 90 degrees. Adjacent directions have cosine about 0.866, so a threshold of 0.72 joins all four through a chain. The endpoints have cosine zero but still belong to one component. At 0.9, none of those synthetic pairs link. Figure 13 illustrates the danger: on a busy day, intermediate similarities can connect unrelated endpoints and let one chain absorb much of the news.

Single linkage: clusters are connected components of the “similar enough” graph, so chains of intermediaries can join unrelated articles.

Figure 14 examines the cosines of article pairs on five busy days (12 September 2001, 16 September 2008, 24 June 2016, 12 March 2020, 24 February 2022), split by whether the two ended up in the same story. A distribution describes how values are spread across possible sizes. A histogram groups them into intervals, or bins, and counts values in each interval. The sample’s median is its middle value; its 99th percentile is a value at or below which about 99% of observations lie. The figure scales each histogram to its own highest bin, so equal displayed heights do not mean equal pair counts or equal probabilities. These are descriptive same-story labels from the grouping, not an independent human-labeled test set. In embedding space, pairs from different stories have median cosine 0.49 and a 99th percentile of 0.67—confirming that unrelated news embeddings sit around 0.5, not 0—while pairs from the same story have median 0.65 and a long tail toward 1. The two distributions overlap, as they must for anything less than a perfect representation, but the crossover is narrow.

Cosine similarity of article pairs on five busy days, in embedding space (top) and LSA space (bottom), split by whether the articles belong to the same story. Each series is scaled to its own peak.

Choosing a threshold balances two failures. Lowering it adds edges, which can join distinct events through chains. Raising it removes edges, which can split one event into several components; this is fragmentation. Figure 15 shows the search for a useful balance on 24 February 2022, the day Russia invaded Ukraine. At 0.6, one chain contains 143 of the day’s 152 articles—most of the day has become one “story”. At 0.66 the chain still holds 104. At 0.72 the largest cluster is the 62‑article invasion story, the intended grouping identified during inspection, with 67 singletons (features, comment, unrelated items). At 0.78 the invasion story has fragmented to 34 articles; at 0.82 no cluster is larger than 8; at 0.9 only one linked pair remains: 151 components, the largest of size 2, and 150 singletons among 152 articles. These are the counts in the frozen aggregate fixture; the earlier wording that nothing linked was incorrect. The deployed threshold is 0.72. The sweep shows the effect of this choice on that day’s graph; it does not prove an optimal threshold for every possible day. The original choice had been 0.82 (a number appropriate for a larger embedding model with longer inputs); the first look at the data—“Day of terror” on 12 September 2001 rendered as a three‑article story—showed it was wrong, and the sweep in Figure 15 replaced it.

Cluster sizes on 24 February 2022 as the threshold varies.

The lower panel of Figure 14 explains why the LSA space needs a different threshold. LSA coordinates are projections onto the 60 leading right singular directions of the term matrix; articles about the same event share vocabulary but in a 60‑dimensional summary their cosines spread from 0 to 1 (median 0.35), and unrelated articles sit around 0 (median −0.01-0.01). The distributions are wider and cross lower, and the threshold that reproduces sensible stories is 0.6. The same numerical threshold therefore has a different meaning in the two representations. Their coordinate systems and similarity distributions differ. This is one reason the deployed newspaper clusters in embedding space and uses the LSA basis only for measurement. The notebooks can recompute the histogram scaling and proportions from frozen aggregate counts; they cannot recreate historical cluster assignments without the original article vectors.

8.2 Episodes: threading across days

An episode is a chain of related stories across days. First summarize each story by its centroid: average its member embedding vectors, then use that mean’s direction in the cosine comparison. Averaging is done coordinate by coordinate. A zero mean has no direction, so an implementation must handle that case explicitly rather than calculate an undefined cosine.

In this subsection tt indexes calendar days, distinct from the earlier term index. To thread a story on day tt, compare its centroid with each story centroid on day t−1t-1. Keep the greatest cosine, the best match. If it reaches 0.9, continue that previous story’s episode; otherwise start a new episode. This is a best-previous-story rule, not a one-to-one assignment between all stories on the two days. Several current stories can independently select the same previous episode.

The threshold acts after the maximum is found. In the notebook’s synthetic two-story example, one current centroid has best similarity 0.92 and continues; the other fails the 0.9 threshold and starts a new episode. A best match always exists when there are eligible nonzero previous vectors, but it need not be a good match. Figure 16 shows, for 678 stories over eight day-pairs, each best previous-day cosine. With raw embeddings the median is 0.66 because unrelated news shares a common component. Reported continuations above the strict threshold include “Battle for Kyiv” after “Putin invasion deepens” (0.92), the Hamas attack’s death toll two days running (0.90), and Brexit voters’ portraits (0.93). In late February 2022, 21 of 1,077 stories continued an episode, and the longest, the invasion, ran fourteen days from 18 February to 3 March.

Best previous‑day match per story, with raw and with centred cosines.

Subtracting the mean first removes the common component and lowers the median to 0.29, with a sparser region around 0.55–0.75. A centred threshold near 0.75 is a candidate for separate evaluation, not a direct replacement proved by the figure. It would still miss the cited Crimea continuation at 0.69; lowering it enough to include that pair could also admit the unrelated New Zealand protest and abortion pair at 0.70. To assess this tradeoff, first obtain judgments of which candidate links really are continuations. Precision is the number of correct accepted links divided by all accepted links. Recall is the number of correct accepted links divided by all true continuations in the evaluated set. If no link is accepted, precision has a zero denominator; if the evaluated set has no true links, recall does too. Those cases need explicit reporting conventions.

The notebooks supply five labeled synthetic candidates: three true links at 0.92, 0.90, and 0.93, a false link at 0.70, and a true link at 0.69. A 0.9 threshold accepts three correct links: precision is 3/3=13/3=1 and recall is 3/4=0.753/4=0.75. Lowering it to 0.69 recovers all four true links but also accepts the false one: precision becomes 4/5=0.84/5=0.8 and recall 4/4=14/4=1. Those labels are teaching inputs, not a new evaluation of the historical stories. The strict raw rule aims to favor precision. An episode is a thread, not a day: “episode day 7” counts from the chain’s beginning, and an archetype’s canon counts episodes rather than repeated days.

8.3 Precedents

A precedent is an earlier candidate presented for comparison, not proof that history will repeat. The search has an eligibility stage and a ranking stage.

First retain only stories earlier than the query story and having the same dominant axis. This prevents future stories from entering a historical comparison and makes the archetype part of the search definition. Then compare named-coordinate vectors by cosine. Among stories from the same episode, keep the strongest match; finally take the five strongest remaining matches, or fewer if fewer are eligible. The distinct-episode restriction avoids filling the list with five days of the same event.

No similarity threshold is required to return the nearest eligible candidates. This is a ranking: the largest scores come first. A ranking can still return weak matches if all eligible candidates are weak. Printing the cosine beside each precedent lets the reader assess that distinction: recorded examples include 0.97 for the same week’s build-up briefing and 0.93 for Crimea in 2014. A shared dominant axis or a large cosine establishes resemblance in this representation, not a causal relationship between the events.

9 The statistical thresholds

9.1 ±2σ on the spectrum

The symbol σ\sigma in this heading means a reference standard deviation. For each named axis, collect one spectrum value per loaded day. Subtract their mean to describe departures from the usual level, then divide by their positive standard deviation to put those departures on a common scale. The unit is now “reference standard deviations”, rather than the original coordinate unit. An axis is loud above +2+2 and silent below −2-2.

9.1.1 Calculate a reference spread before a z-score

Use the synthetic daily values −1,0,1,2,3-1,0,1,2,3. Their mean is 11. Their deviations are −2,−1,0,1,2-2,-1,0,1,2, whose squares add to 4+1+0+1+4=104+1+0+1+4=10. The notebook uses the sample variance: divide by the count minus one, giving 10/(5−1)=2.510/(5-1)=2.5. Its standard deviation is 2.5≈1.581\sqrt{2.5}\approx1.581. This count-minus-one convention differs from the total-weight normalization of the fitted covariance earlier; name the convention instead of silently switching denominators.

Against this reference, a value −3-3 first gives deviation −3−1=−4-3-1=-4, then z-score −4/2.5≈−2.530-4/\sqrt{2.5}\approx-2.530. It belongs to Silence. Neither −3-3 nor −4-4 alone could be compared directly with the standardized cutoff −2-2; dividing by the reference spread is essential.

To obtain the same summaries one value at a time, let nn be the count after a new scalar value aa arrives. Let holdh_{\mathrm{old}} denote the previous running mean and AoldA_{\mathrm{old}} the previous sum of squared deviations from that mean. Define δ=a−hold\delta=a-h_{\mathrm{old}}, the new value’s departure from the old mean. The updated mean hnewh_{\mathrm{new}} moves by that departure divided among all nn values:

hnew=hold+δ/n.h_{\mathrm{new}}=h_{\mathrm{old}}+\delta/n.

The updated squared-deviation sum is

Anew=Aold+δ(a−hnew).A_{\mathrm{new}}=A_{\mathrm{old}}+\delta(a-h_{\mathrm{new}}).

These are Welford’s updates. Initialize the first mean at the first observation and its deviation sum at zero. Each later update uses both the old and new mean; this compensates for the movement of the reference point. With at least two values, divide the final sum by n−1n-1 for the sample variance. With only one value, that sample variance is undefined. The notebooks verify these updates against the direct five-value calculation.

9.1.2 A standardized cutoff is not automatically a probability

A probability model specifies how frequently values are expected to fall in different ranges. A Gaussian, or normal bell-shaped distribution, is one such model. Under that model, about 4.55% of observations lie outside two standard deviations, often rounded to “one in twenty”. News series can be heavy-tailed, meaning that large departures occur more often than this model predicts. Standardization alone does not make them Gaussian.

There is also a many-comparisons issue. If 60 axes each really had the Gaussian 4.55% tail frequency, the expected number flagged would be about 60×0.0455=2.7360\times0.0455=2.73. An expected number is a long-run average count, not the probability that any particular day has a flag. This average-count calculation does not require independent axes; independence would be an additional assumption when calculating the probability of at least one flag. The notebooks compute the Gaussian benchmark, not a calibrated newspaper alarm probability.

The empirical display intent is that a typical day lights one to three axes, not ten. On 24 February 2022 the Ukraine axis was at +8+8; on 12 September 2001 terrorism was at +2.9+2.9, Europe at +2.6+2.6, markets at +2.5+2.5. These recorded numbers are spectrum z-scores against the loaded reference, not probabilities.

9.2 1.5σ for “different this time”

Now change the reference set. We are comparing one story with the stories usually assigned to its archetype, rather than comparing a day with other days. On each axis, subtract the archetype profile mean from the story coordinate and divide by the positive profile standard deviation. Keep departures whose absolute values exceed 1.5, sort them by that magnitude, and display at most three.

For example, the notebook has profile mean 22, profile standard deviation 0.50.5, and story value 3.63.6 on one synthetic axis. The departure is (3.6−2)/0.5=3.2(3.6-2)/0.5=3.2 profile standard deviations. Another has mean 00, standard deviation 22, and value −4-4, giving −2-2. Both exceed 1.5 in magnitude, but their signs say whether the story lies above or below its profile. A story exactly at every profile mean produces zero departures and an empty panel.

The threshold is lower than the spectrum’s because the display asks a different question: whether this instance differs from its class. A specific secondary signal, such as airline · airport on a terrorism story at +3.2σ+3.2\sigma, can be useful to inspect. The recorded invasion example has nothing beyond 1.5σ of this archetype’s profile; an empty panel is a possible result, not an error.

This display rule is not a formal proof that a difference is statistically significant. Under a Gaussian reference, a two-sided 1.5-standard-deviation cutoff is crossed about 13.36% of the time. Across 59 such secondary axes, the expected count would be about 7.887.88. Correlation between axes changes how flags arrive together; it does not by itself invalidate this expectation calculation if the individual Gaussian tail assumptions held. Here those marginal assumptions are not established either. The empirical panel depends on the observed profile distributions, their correlations, and the three-item display cap.

9.3 Energy × (1 + ν) for ranking

Let νs\nu_s be story ss’s mean member-article novelty ratio, distinguishing it from a ratio calculated on the story centroid. Recall its attention weight εs\varepsilon_s. The ranking score is

εs(1+νs).\varepsilon_s(1+\nu_s).

The first factor rewards the recorded source and article attention. The second raises that score when more of the member articles’ centred variation lies outside the retained model. Since 0≤νs≤10\le\nu_s\le1, the multiplier runs from one to two: an equally energetic story at novelty one gets twice the score of one at novelty zero. This is an explicit ranking design, not a learned probability of importance. The residual section orders by νs\nu_s alone. A large residual remains a property of this representation, not independent evidence of newsworthiness.

9.4 0.8 for matching axes across nights

A nightly refit supplies new eigenvectors. Their order can change, and multiplying an eigenvector by −1-1 leaves the same geometric line. Comparing column numbers or signed cosines alone would confuse these bookkeeping changes with new patterns.

An assignment first pairs new and old eigenvectors to maximize total absolute cosine, written |cos⁡||\cos| and explained in the next chapter. Absolute value removes the sign ambiguity: cosine −1-1 and cosine +1+1 both identify the same line. After pairing, signs can be oriented to agree with the old directions.

A matched cosine below 0.8 is rejected: the component is treated as a new archetype, while retirement uses the separate noise-edge rule. The notebook reverses one axis’s sign during a small rotation and verifies that this does not turn a strong match into a rejection. Reported well-separated axes match at 0.99+ between nights. The 0.8 value is an operational continuity rule, not proof of semantic identity; poorly separated directions can move substantially while their common subspace stays similar.

10 Matching axes

10.1 Kuhn–Munkres

Suppose several old axes each resemble several new axes. Picking the best match for one axis can consume the only good match available to another. We need to consider the whole set of pairings together.

An assignment problem chooses a one-to-one pairing: each old axis receives one new axis, and no new axis is reused. Its objective is to maximize the sum of the chosen similarities. For a small synthetic example, the notebook uses this table; rows name old axes and columns name new axes:

new A new B new C
old A 0.90 0.80 0.10
old B 0.85 0.20 0.10
old C 0.10 0.10 0.95

Taking old A’s strongest match first selects new A at 0.90. If old B then takes new B and old C takes new C, the total is 0.90+0.20+0.95=2.050.90+0.20+0.95=2.05. Swapping the first two matches gives 0.80+0.85+0.95=2.600.80+0.85+0.95=2.60, a larger total. The slightly weaker choice for old A permits a much stronger one for old B. This is why a greedy procedure, choosing the best currently available local option, need not solve the global assignment.

The Hungarian algorithm, also called Kuhn–Munkres, solves the assignment problem without trying every possible permutation. It runs in polynomial time: its work grows no faster than a fixed power of the problem size. The numerical routines implement that search; the similarity table and one-to-one constraint define what it is solving. For nightly comparisons in the same feature space, table entries are absolute eigenvector cosines. Signs are then oriented to agree.

10.1.1 Compare different spaces through shared observations

A raw dot product requires matching coordinate meanings and dimensions. The notation ℝd\mathbb R^d means lists of dd real-number coordinates. A 50,000-term direction and a 384-coordinate embedding direction live in ℝ50,000\mathbb R^{50{,}000} and ℝ384\mathbb R^{384} respectively. Their entries cannot be multiplied pairwise to obtain a meaningful cosine.

Instead ask both directions about the same stories in the same order. Each direction yields one score per story. Those two score columns now have matching observation positions, regardless of the different spaces that produced them.

Compare the score columns using correlation: their covariance divided by their positive standard deviations. Operationally, subtract each column’s own mean, take the dot product of the centred columns, and divide by their lengths. This is the cosine of the centred score columns; the common averaging denominators cancel. Positive correlation means above-mean scores tend to occur on the same stories, negative correlation means they tend to occur on opposite stories, and a constant column has no defined correlation because its centred length is zero.

For intuition, the notebook pairs scores 1,2,3,4,51,2,3,4,5 with an identical score column produced in the other space. Their shared ordering and departures give correlation one. Reversing a nonconstant centred column’s sign reverses the correlation. Using these score comparisons as table entries lets assignment match across representations without pretending their original coordinate systems are the same.

The reported study compared scores on the same 100,000 stories. Figure 17 shows selected matches: Ukraine with Ukraine at 0.67 and courts with courts at 0.62; the reported comparisons also include the EU at 0.57. Those are dated empirical associations. The notebook’s small synthetic score table teaches the calculation without re-estimating unavailable archive measurements.

Axes of the two bases paired by correlation of story coordinates.

10.2 Why nightly refinement is stable

Why should yesterday’s directions resemble today’s at all? One reason is that adding a modest amount of data to a large fixed reference often changes its covariance only a little. A second condition is essential: the direction must be separated from competing directions. If two eigenvalues are equal, rotating their eigenvectors inside their common plane changes the axes without changing the covariance. Near equality can therefore make individual axes sensitive to small changes.

10.2.1 Measure the change and the separation separately

A perturbation is the difference between the new and old matrices. Let EE be this covariance change, with the same shape as each covariance. Its spectral norm, written ‖E‖2\lVert E\rVert_2, is the greatest output length EE produces from any unit input. The subscript 22 denotes the Euclidean-length operator norm; it does not mean that all matrix entries have been squared and summed. Define the scalar ε=‖E‖2\varepsilon=\lVert E\rVert_2 as the size of the perturbation.

A simple eigenvalue has a one-dimensional eigenspace, so its unit eigenvector is determined up to sign. Consider a matched simple old eigenvalue and a new eigenvalue. Define the positive separation gg by comparing that new eigenvalue with every other old eigenvalue and taking the smallest distance. This precise comparison is part of the hypothesis. An arbitrary gap taken from a nearby pair of values cannot be substituted without further assumptions.

After matching the signs, let θ\theta be the acute angle between the two unit eigenvectors. Its sine, sin⁡θ\sin\theta, is the length of the component of one direction perpendicular to the other. It is zero when the lines agree and increases towards one as they become perpendicular. The Davis–Kahan bound in this setting is

sin⁡θ≤εg.\sin\theta\le\frac{\varepsilon}{g}.

The inequality gives an upper bound, not a prediction of the exact turn. A smaller covariance change lowers the bound; a smaller separation raises it. If the right-hand side exceeds one, the inequality gives no useful improvement over the fact that a sine is at most one.

The notebook starts with covariance diagonal entries 33 and 11, then adds 0.050.05 to both off-diagonal entries. The perturbation norm is 0.050.05 and the specified separation is slightly greater than 22, so the bound is about 0.0250.025. The notebook calculates both the actual turning sine and the bound and checks the inequality. It also rotates a two-direction basis within a fixed plane: individual columns change while the projection onto the plane remains identical. This explains why nearly degenerate groups call for subspace comparisons.

10.2.2 What a growing archive does and does not guarantee

If the added day’s total weight and observation lengths stay bounded while accumulated weight grows in proportion to an observation count NN, the one-step covariance change can be O(1/N)O(1/N). This big-O notation means bounded by a constant times 1/N1/N under the stated assumptions. Larger accumulated weight then dilutes a bounded new contribution. The statement concerns an individual update. It does not prove that an evolving sequence of news bases converges forever, particularly when the data distribution or weighting policy changes.

Two continuity procedures address different remaining freedoms. Procrustes alignment rotates or reflects a matched group to minimize its total squared difference from the preceding group; it aligns coordinate frames without asserting that the underlying subspace never changed. Warm-starting begins the new varimax optimization at the preceding rotation instead of a fresh starting point. Both can aid continuity, but neither overrides a substantial data change or a vanishing eigengap.

11 Streaming the computation

The first edition of Eigen Times was fitted on 1.09 million articles, and its code could afford to hold what it needed: every article’s embedding and coordinates while the axes were oriented, and the whole document–term matrix while the axes were named. The second edition ingested the New York Times archive back to 1851 and multiplied the corpus by fifteen, to 16.5 million articles. The first attempt to fit it was killed by the operating system at about forty gigabytes. What follows is the arithmetic that let the same computation run in a fraction of a gigabyte—not a bigger machine, but a change of shape. The principle is one sentence: every quantity the fit needs is a sum over documents, and a sum can be taken in blocks.

11.1 Weights that balance the days

Before the sums, the weights. By article count the modern era dominates the archive—the Guardian alone publishes about as many articles a day as the Times index ever recorded—while by the calendar it is fifteen per cent of 175 years. Let ii index articles and τ\tau a calendar day. Write τ(i)\tau(i) for article ii’s day and nτ>0n_\tau>0 for the number of eligible articles on that day. The second edition assigns article ii the inverse-count weight wiw_i. A sum constrained by τ(i)=τ\tau(i)=\tau includes only articles from the chosen day:

wi=1/nτ(i),∑τ(i)=τwi=1,w_i = 1 / n_{\tau(i)}, \qquad \sum_{\tau(i) = \tau} w_i = 1,

Every populated day therefore contributes one unit to the fit: a day in 1887 with 40 index entries and a day in 2024 with 900 articles count the same. The arithmetic is 40(1/40)=140(1/40)=1 and 900(1/900)=1900(1/900)=1. An article from the smaller day has greater individual weight, while both days have equal total influence.

The notebooks make this distinction visible using a synthetic coordinate that is zero for each of the 40 first-day articles and one for each of the 900 second-day articles. Its article-weighted mean is 900/940≈0.957900/940\approx0.957. Its day-balanced mean is (1×0+1×1)/(1+1)=0.5(1\times0+1\times1)/(1+1)=0.5. Neither is an arithmetic error: they answer different questions about what counts as one unit of influence. Total weight ZZ is the number of represented days, 63,270. The covariance formulas retain their shapes; the diagonal entries of WW change. For term-space fitting, let μT,w\mu_{T,w} be the p×1p\times1 TF‑IDF mean under these same article weights. Let W1/2W^{1/2} be the diagonal matrix of the nonnegative square roots of the article weights. With TT of shape N×pN\times p and 𝟏\mathbf1 of length NN, the balanced LSA fit decomposes W1/2(T−𝟏μT,w⊤)W^{1/2}(T-\mathbf1\mu_{T,w}^{\top}). Its mean is distinct from the unweighted naming mean μT\mu_T below.

Why multiply centred rows by square-root weights? The covariance calculation subsequently multiplies a row by its transpose. The two factors each contribute wi\sqrt{w_i}, whose product is wiw_i. Using the full weight on both sides instead would produce wi2w_i^2 and answer a different weighting question. Weighting, centering, and normalization each have a separate role; none can be omitted merely because the matrix shapes still match.

11.2 Sums over blocks

Split the article rows into disjoint blocks indexed by b=1,2,…b=1,2,\ldots. In Eigen Times, a block is one source’s articles for one month; there are about three thousand. The notation i∈bi\in b means article row ii belongs to block bb. Let gg be any fixed rule converting a row xix_i into a scalar, vector, or matrix contribution of the same shape for every row. Then

∑ig(xi)=∑b∑i∈bg(xi).\sum_i g(x_i)=\sum_b\sum_{i\in b}g(x_i).

Read the inner sum first: calculate the contributions from articles in one block and add them. The outer sum adds the resulting block totals. Every article must appear in exactly one block; missing or duplicated rows would change the answer. Once a block’s contribution has been added, its article rows can be discarded from memory. Here the function gg is unrelated to the eigengap scalar in §10.

For covariance the contributions are already known: an article adds its weight to ZZ, its weighted coordinate column to mm, and its weighted outer-product matrix to MM. Each block produces a scalar, a d×1d\times1 column, and a d×dd\times d matrix. Add like-shaped block summaries, then compute the mean m/Zm/Z and covariance M/Z−(m/Z)(m/Z)⊤M/Z-(m/Z)(m/Z)^{\top}. Do not average block means equally unless their total weights are equal; a block with more weight must contribute proportionally more.

A thread is a worker executing part of the computation; an accumulator stores its partial total. Workers can merge partial sums because addition commutes in exact arithmetic. Floating-point arithmetic can introduce small order-dependent rounding differences. Memory is bounded by the largest block plus these accumulators. The covariance’s Z,m,MZ,m,M are sufficient summaries for reconstructing that mean and covariance; the phrase does not claim they retain all information about the articles. Two other stages needed the same treatment.

11.3 Orienting an axis from power sums

Fix one raw axis jj and let cijc_{ij} be article ii’s score on it. Let n>0n>0 count the articles in this orientation pass and let c‾j\bar c_j be their unweighted mean score; an overbar denotes a mean. A central moment averages powers of deviations from a mean. The second central moment uses squares and measures spread; the third uses cubes and retains a sign. Cubes of negative deviations are negative, so a long negative tail can outweigh shorter positive deviations. Define the third central moment m3m_3 by

m3=n−1∑i(cij−c‾j)3,m_3=n^{-1}\sum_i(c_{ij}-\bar c_j)^3,

where n−1=1/nn^{-1}=1/n. The orientation rule flips the axis when m3m_3 is negative. Flipping all scores reverses their centred cubes’ signs while preserving squared lengths. If the third moment is zero, this particular rule supplies no preference between the two signs. The old pass retained 16.5 million scores for each axis. Instead define three power sums, sums of first, second, and third powers:

n,S1=∑icij,S2=∑icij2,S3=∑icij3,n, \qquad S_1 = \sum_i c_{ij}, \qquad S_2 = \sum_i c_{ij}^2, \qquad S_3 = \sum_i c_{ij}^3,

These scalar S1,S2,S3S_1,S_2,S_3 are distinct from the naming-score matrix SS. For this one axis, abbreviate c‾j\bar c_j as c‾=S1/n\bar c=S_1/n. To see why these summaries suffice, first expand one squared deviation:

(cij−c‾)2=cij2−2c‾cij+c‾2.(c_{ij}-\bar c)^2=c_{ij}^2-2\bar c\,c_{ij}+\bar c^2.

Averaging the first term gives S2/nS_2/n. In the second, c‾\bar c is constant over articles and the average score is itself c‾\bar c, so the average is −2c‾2-2\bar c^2. The last term averages to c‾2\bar c^2. Adding them gives the second central moment, denoted m2m_2:

m2=S2/n−c‾2.m_2=S_2/n-\bar c^2.

The cube has four terms:

(cij−c‾)3=cij3−3c‾cij2+3c‾2cij−c‾3.(c_{ij}-\bar c)^3=c_{ij}^3-3\bar c\,c_{ij}^2 +3\bar c^2c_{ij}-\bar c^3.

Average each term in order. They become S3/nS_3/n, −3c‾S2/n-3\bar c S_2/n, 3c‾33\bar c^3, and −c‾3-\bar c^3. Combining the last two gives

m3=S3/n−3c‾S2/n+2c‾3.m_3=S_3/n-3\bar c\,S_2/n+2\bar c^3.

The notebook reuses the synthetic orientation scores −5,−1,0,1,1-5,-1,0,1,1. They give n=5n=5, S1=−4S_1=-4, S2=28S_2=28, and S3=−124S_3=-124, hence c‾=−0.8\bar c=-0.8. Substitution gives

m2=28/5−(−0.8)2=5.6−0.64=4.96,m_2=28/5-(-0.8)^2=5.6-0.64=4.96,

m3=−124/5−3(−0.8)(28/5)+2(−0.8)3=−24.8+13.44−1.024=−12.384.\begin{aligned} m_3&=-124/5-3(-0.8)(28/5)+2(-0.8)^3\\ &=-24.8+13.44-1.024\\ &=-12.384. \end{aligned}

The negative third moment triggers a sign flip. The two notebooks verify these values both from the original centred scores and from independently accumulated blocks.

Four numbers per axis—nn and three sums—replace the column. Each partition adds its documents’ powers to an accumulator; accumulators merge by adding those four numbers. These polynomial identities are exact, but subtracting nearly equal floating-point values can lose precision when the mean is large compared with the spread. The reported tests compare streaming and batch orientation signs, including merged partial accumulators; they do not make that numerical risk disappear for arbitrary data.

11.4 Term loadings block by block

Recall that TT has NN article rows and pp TF‑IDF columns, μT\mu_T is their unweighted p×1p\times1 mean, and SS has the matching NN rows of kk whitened raw scores. Its row order must agree with TT. A cross-product multiplies one table’s transposed columns against another table’s columns. Here it measures which terms co-occur with large axis scores. It is a numerical association, not evidence that a term causes a story or uniquely owns an axis.

Let t=1,…,pt=1,\ldots,p index vocabulary terms in this subsection and j=1,…,kj=1,\ldots,k index raw score axes. Write μT,t\mu_{T,t} for entry tt of the mean column μT\mu_T. Article ii contributes its centred term value, Tit−μT,tT_{it}-\mu_{T,t}, multiplied by its score SijS_{ij}. Add over articles to obtain entry (t,j)(t,j) of the p×kp\times k term-loading matrix β\beta:

βtj=∑i(Tit−μT,t)Sij.\beta_{tj}=\sum_i\bigl(T_{it}-\mu_{T,t}\bigr)S_{ij}.

The mean term value is constant over articles. Distributing multiplication over subtraction therefore yields the same entry as

βtj=∑iTitSij−μT,t∑iSij.\beta_{tj}=\sum_iT_{it}S_{ij}-\mu_{T,t}\sum_i S_{ij}.

In matrix form, with 𝟏\mathbf1 the N×1N\times1 column of ones, these are the raw term–score product and its centering correction:

β=T⊤S−μT(𝟏⊤S).\beta=T^{\top}S-\mu_T(\mathbf1^{\top}S).

Check the correction’s shape: 𝟏⊤S\mathbf1^{\top}S is a 1×k1\times k row of score sums; multiplying the p×1p\times1 term-mean column by it gives a p×kp\times k outer product. A fitted score mean can be zero under one weighting convention but not another. Keeping the centering term explicit avoids assuming a cancellation the naming pass does not guarantee.

Let NbN_b count articles in block bb, and let TbT_b and SbS_b contain its matching rows, with shapes Nb×pN_b\times p and Nb×kN_b\times k. Write 𝟏b\mathbf1_b for the Nb×1N_b\times1 column of ones, while 𝟏\mathbf1 without a subscript has length NN. Then

T⊤S=∑bTb⊤Sb,𝟏⊤S=∑b𝟏b⊤Sb,T^{\top}S=\sum_b T_b^{\top}S_b,\qquad \mathbf1^{\top}S=\sum_b\mathbf1_b^{\top}S_b, μT=N−1∑bTb⊤𝟏b.\mu_T=N^{-1}\sum_b T_b^{\top}\mathbf1_b.

Read these formulas as three accumulation tasks. First multiply matching term and score rows to update the cross-product. Second add term columns to update their sums. Third add score columns to update their sums. Also retain the total row count so the final term sums can be divided by NN. The final mean and centering correction are computed after the block summaries have been combined, using the same unweighted naming convention as the full matrix.

Each block therefore contributes three small numerical arrays: a p×kp \times k matrix (50,000×6050{,}000 \times 60, twenty-four megabytes), the column sums of its term rows (pp numbers) and the column sums of its scores (kk numbers). The block itself—the sparse rows of one month’s articles and their scores—is built, folded in, and dropped (Figure 18). The full TT, which has 455 million non-zero entries for the 175-year corpus and was being held twice by the batch code, never exists in the naming pass. At the end the three accumulated pieces are combined by the formula above; a property test checks that the result equals the whole-matrix operator applied to the concatenated blocks, to 10−1210^{-12}.

Term loadings block by block: each block of documents contributes one small  matrix, and the sum is the whole.

The same pass over a block also projects its embeddings to coordinates and computes T2T^2, QQ and ν\nu for its documents, writing them to the partition’s own table. The whole eigen fit is thus three passes over the archive—covariance, orientation, measurement—each of which reads one partition at a time. On 16.5 million articles it runs in ten minutes and stays at 0.3 GB of memory.

11.5 Stories one month at a time

Clustering into stories (chapter The clustering thresholds) is done within a day, and threading into episodes links a day’s stories to the previous day’s. For the clustering and episode-linking calculation, the dependency of day τ\tau is on that day’s articles and the previous day’s story state. The carried state includes centroids and episode identities, which summarize the thread inherited from earlier days. It is not necessary to reload every earlier article. Other tasks, such as finding long-range precedents, have broader dependencies and are not covered by this particular memory reduction. The batch code loaded every article’s vector and title before starting; the streaming version walks the months in order, loads one month’s articles, clusters its days in sequence, carries the last day’s stories across the month boundary, writes the month’s stories and drops the month. Memory is one month of articles instead of 175 years of them. The month boundary is only a storage boundary: preserve the previous day’s state when crossing it, or an ongoing episode would be split accidentally. The notebook processes the same six synthetic days once as a full batch and once as two blocks, checking that the resulting episode identities agree.

11.6 What still has to fit in memory

A matrix’s shape tells us how many numerical entries it contains. A dense p×kp\times k accumulator has pkpk entries. With eight-byte floating-point values, the 50,000×6050{,}000\times60 loading accumulator needs 50,000×60×8=24,000,00050{,}000\times60\times8=24{,}000{,}000 bytes, or 24 decimal megabytes. Each simultaneous worker needs its own accumulator unless the implementation arranges shared updates. A decimal megabyte is one million bytes; a gibibyte uses 2302^{30} bytes, so unit labels matter when comparing reported memory.

This size calculation concerns numerical entries only. Sparse indices, object metadata, temporary arrays, and stored text consume additional memory. A measured process total cannot generally be obtained by multiplying a single matrix shape.

Two stages remain large. Randomized LSA uses a p×lp\times l working matrix Ω\Omega, where ll is the chosen working width, normally larger than the final retained rank. Products such as TΩT\Omega and T⊤(TΩ)T^{\top}(T\Omega) are the range-finding operations described in §5, with the required centering and weighting corrections. The first product can be emitted by row block; the second is a sum of block cross-products. This avoids requiring all of TT at once, although working score matrices also need a storage plan. In the reported edition the 455-million-nonzero matrix remains in memory: 31 GB on a 64 GB laptop. The block form is a next step, not a claimed implementation. The other large object is the site index, which retains story centroids and profiles for precedents: about 20 GB for 13.4 million stories. These retained objects determine the second edition’s build-machine requirement.

pass before after
eigen: orientation every vector and coordinate (≈30 GB) four power sums per axis
eigen: term loadings TT twice, plus SS (≈20 GB) one p×kp \times k accumulator per thread (24 MB)
stories every vector and title (≈25 GB) one month at a time
LSA: randomized SVD TT in memory (31 GB) unchanged
site index every story (20 GB) unchanged

12 The pipeline as matrices

Figure 19 brings the stages together. Shapes are a useful final check because they force us to say what each row and column represents. They can detect incompatible operations, although matching shapes alone do not prove that row identities, units, weights, or meanings agree.

Here NN counts articles and EE is their N×384N\times384 embedding matrix. This use of EE names embeddings, distinct from the local covariance-perturbation symbol in the stability section. Each row is an article; each column is an embedding coordinate. Let 𝟏\mathbf1 be the N×1N\times1 column of ones and μ\mu the 384×1384\times1 embedding mean. The product 𝟏μ⊤\mathbf1\mu^{\top} repeats that mean in every article row. Subtracting it centres all rows at once.

The retained basis VV has 384 rows and 60 columns. Define the raw coordinate table CC by

C=(E−𝟏μ⊤)V.C=(E-\mathbf1\mu^{\top})V.

The multiplication has shape (N×384)(384×60)(N\times384)(384\times60), producing N×60N\times60. Each article receives 60 coordinates. To reconstruct the retained part in the original embedding coordinates, multiply by V⊤V^{\top}, giving shape (N×60)(60×384)=N×384(N\times60)(60\times384)=N\times384, then add the repeated mean. The difference from EE gives one residual row per article.

The term-space mean remains μT\mu_T. The table SS denotes the standardized raw score rows used for lexical naming; it has the same article ordering as the term matrix. Its cross-product with centred terms has shape (50,000×N)(N×60)=50,000×60(50{,}000\times N)(N\times60)=50{,}000\times60. The 60×6060\times60 rotation changes the coordinates within the retained space without increasing their number. The subscript “lsa” below identifies a basis fitted in term space.

The numerical decompositions are consequently small—a 384×384384\times384 covariance, a 384×60384\times60 basis, a 50,000×6050{,}000\times60 loading table, and a 60×6060\times60 rotation—even though some article and story tables remain large. The preceding chapter identifies the objects that still determine memory requirements; small final matrices do not imply that every intermediate calculation is small.

The pipeline, stage by stage, as matrices.
stage object shape operation
tokenise TF‑IDF matrix TT N×50,000N \times 50{,}000, sparse randomized SVD → VlsaV_{\text{lsa}}, UU
embed EE N×384N \times 384 streaming Z,m,MZ, m, M
covariance Σ\Sigma 384×384384 \times 384 eigh → V,ΛV, \Lambda
name centred term–score product β\beta 50,000×6050{,}000 \times 60 varimax → RR
measure C=(E−𝟏μ⊤)VC = (E - \mathbf{1}\mu^{\top})V N×60N \times 60 T2T^2, QQ, ν\nu per row
stories centroids 842,278×60842{,}278 \times 60 profiles, precedents
days spectra 10,102×6010{,}102 \times 60 era statistics, z‑scores

The numbers in the table are those of the first edition on 28 August 2026; each grows by a day’s worth every night. The second edition, fitted on 3 September 2026 over the New York Times archive as well, has N=16,500,781N = 16{,}500{,}781 articles (455 million non-zeros in TT), 13,421,090 stories and 63,270 day spectra; the small matrices—Σ\Sigma, VV, β\beta, RR—have exactly the same shapes, which is the point of the chapter Streaming the computation.

Notation

symbol meaning
xix_i, wiw_i article column vector and its covariance fit weight
μ\mu, Σ\Sigma, ZZ weighted article mean, covariance, and total fit weight
mm, MM, WW weighted vector sum, outer-product sum, and diagonal fit-weight matrix
VV, Λ\Lambda eigenvectors (columns) and eigenvalues of Σ\Sigma; kk of them kept
RR, V′=VRV' = VR, y=R⊤cy=R^{\top}c naming rotation, named directions, and named coordinate column
cc, x̂\hat{x}, rr raw coordinates, reconstruction, residual of an observation column xx
Γ=R⊤ΛR\Gamma=R^{\top}\Lambda R covariance of the rotated raw coordinates; generally not diagonal
T2T^2, QQ, ν\nu Hotelling’s statistic, residual energy, novelty ratio
TT, μT\mu_T, SS, β\beta TF‑IDF rows, their naming mean, whitened raw score rows, centred term–score loadings
UU, Σsvd\Sigma_{\mathrm{svd}}, VV left directions, singular-value matrix, and right directions in the SVD context
σj\sigma_j singular values; λj=σj2/n\lambda_j=\sigma_j^2/n for an equally weighted centred matrix
εs\varepsilon_s, sjs_j story attention energy; empirical named-axis standard deviation for dominance
nτn_\tau, wi=1/nτ(i)w_i = 1/n_{\tau(i)} articles on day τ\tau and the day-balanced weight of article ii
TbT_b, SbS_b, NbN_b term rows, score rows, and article count in block bb
S1,S2,S3S_1, S_2, S_3 power sums of an axis’s scores, from which its skewness sign is read

The main symbols above keep their stated meaning throughout the pipeline. The following are local calculation symbols; each is defined again where it is used. A shared letter in two explicitly separated examples does not assert that the objects are equal.

Local symbols Meaning and scope
e,πe,\pi Natural-logarithm base and circle constant; one full turn is 2π2\pi radians.
at,bta_t,b_t; df,tf,idf\mathrm{df},\mathrm{tf},\mathrm{idf} Entries of two term vectors; document frequency, damped term frequency, and inverse document frequency in Chapter 2.
A,B,CA,B,C; AijA_{ij} Example matrices and an entry selected by row ii and column jj in Chapter 3.
XcX_c, 𝟏\mathbf1, II Centred data table; a column of ones of the required row count; identity matrix of the stated square size.
u,v,vj,αju,v,v_j,\alpha_j Candidate direction, eigenvector, eigenvector number jj, and coefficient along it in the covariance chapter.
aia_i Scalar projection score of centred observation ii along a temporary unit direction in the eigenvalue proof.
λ+\lambda_+, σ2\sigma^2 Model noise edge and stipulated noise variance in the Marchenko–Pastur illustration.
qq, Uk,Vk,ΣkU_k,V_k,\Sigma_k Smaller data-table dimension; truncated factors retaining kk directions in Chapter 5.
XkX_k Rank-at-most-kk reconstructed table in the truncation chapter.
θ,J,h\theta,J,h Proposed scalar fit, its squared-error function, and a nonzero change in the fit in the differentiation lesson.
J′(θ),dJ/dθJ'(\theta),\,dJ/d\theta Derivative of the scalar error function. The prime means differentiation here, unlike the named-basis prime later.
l,Ω,Y,Qrangel,\Omega,Y,Q_{\mathrm{range}} Working width, random input table, output sketch, and orthonormal working basis for randomized SVD.
q1,q2q_1,q_2 Unit columns built in the Gram–Schmidt teaching example.
ℓij,ϕ\ell_{ij},\phi Rotated loading entry and a pairwise rotation angle in radians in the varimax calculation.
x,y,ui,vix,y,u_i,v_i Two local loading columns and rowwise squared-loading differences and products in the pairwise varimax formula.
A,B,C,D,C*,D*A,B,C,D,C_*,D_* Four scalar sums and two centred combinations in that local formula.
R(ϕ)R(\phi) Two-dimensional rotation through the angle ϕ\phi.
ys,ysj,y‾dayy_s,y_{sj},\bar y_{\mathrm{day}} Story ss’s named column, its entry on axis jj, and a day’s attention-weighted spectrum.
a1,a2a_1,a_2 Top and runner-up scores in the explicitly illustrative mixed-label heuristic.
a,hold,hnew,δa,h_{\mathrm{old}},h_{\mathrm{new}},\delta Incoming value, running means, and departure from the old mean in Welford’s update.
Aold,AnewA_{\mathrm{old}},A_{\mathrm{new}} Old and new squared-deviation sums in that update.
E,ε,g,θE,\varepsilon,g,\theta Covariance perturbation, its operator norm, the specified eigenvalue separation, and the turning angle in the stability bound. Here θ\theta is an angle, unlike the scalar fit in Chapter 5.
g(xi)g(x_i) A fixed per-row contribution function in the block-sum identity; unrelated to the eigengap scalar.
μT,w\mu_{T,w} The term-vector mean under day-balanced fit weights, distinguished from the unweighted naming mean μT\mu_T.
cij,c‾j,m2,m3c_{ij},\bar c_j,m_2,m_3 Raw score of article ii on axis jj, its unweighted orientation-pass mean, and second/third centred moments.

For operators, diag\mathrm{diag} creates a diagonal table; min\min chooses the smallest value; max\max chooses the largest; and arg⁡max\arg\max returns the index attaining the largest. A superscript −1-1 means a reciprocal for a nonzero scalar and an inverse for an invertible square matrix. Fractional powers of positive scalars express roots. The trigonometric functions sin\sin and cos\cos describe unit-circle components; atan2\operatorname{atan2} reverses that description while keeping the quadrant. The subscript FF on a matrix norm means Frobenius norm; subscript 22 in the stability bound means Euclidean operator norm. Chapter 5 explains the limit used to define a derivative. Chapter 10 explains the rate bound denoted by big-O notation.

Glossary

Definitions are repeated here for lookup. Each discussion link returns to the chapter that develops the idea and its scope.

Absolute value. The size of a scalar without its sign. Discussion.

Accumulator. A stored partial total to which later block contributions are added. Discussion.

Anisotropy. Unequal distribution across directions. A shared embedding component can make unrelated texts point partly the same way. Discussion.

Assignment. A one-to-one pairing chosen to maximize a total similarity score, instead of choosing each match independently. Discussion.

Attention energy. A nonnegative story weight used in the spectrum or ranking. It is distinct from squared vector length and from a covariance fitting weight. Discussion.

Basis. Independent directions whose weighted combinations describe a space. Coordinates specify the weights in those combinations. Discussion.

Block. A manageable group of rows processed together; compatible accumulated sums can be combined across blocks. Discussion.

Canon. Representative high-scoring stories associated with an axis; episode deduplication prevents repeated days from dominating the collection. Discussion.

Centring. Subtracting a specified mean from every observation. The choice of mean is part of the calculation. Discussion.

Centroid. The coordinate-wise average of a group’s vectors; a centroid can hide variation among its members. Discussion.

Connected component. A maximal set of graph vertices joined by paths. Direct similarity is not required between every pair in a component. Discussion.

Coordinate. An amount along a chosen direction; changing the basis changes the coordinates even when the underlying vector is unchanged. Discussion.

Corpus. The collection of documents being analysed. Discussion.

Correlation. Covariance divided by two standard deviations, when both are positive; it compares linear variation on a common scale. Discussion.

Cosine similarity. The dot product divided by the two vector lengths. It measures directional agreement and is undefined for a zero vector. Discussion.

Covariance. The average product of two coordinates’ centred deviations; it describes how those coordinates vary together. Discussion.

Covariance matrix. The square table of all coordinate-pair covariances, calculated using specified observations and weights. Diagonal entries are variances. Discussion.

Damping. Reducing how quickly a contribution grows; the logarithmic term-frequency rule gives diminishing increments for repeated words. Discussion.

Dense storage. Allocating a place for every entry of a matrix, including zeros. Discussion.

Derivative. The limiting rate of output change for a small input change. It helps locate a minimum but needs a separate argument that the point is a minimum. Discussion.

Diagonal matrix. A matrix whose entries are zero wherever row and column indices differ. Usually square here, but the full SVD also uses a rectangular diagonal factor. Discussion.

Dimension. The number of independent directions needed to describe a space; in a table’s shape, the word also refers to its row or column count. Discussion.

Document frequency. The number of documents containing a term, regardless of its number of occurrences in each document. Discussion.

Dominant axis. The named direction with the largest signed scale-adjusted coordinate under the stated rule. Taking absolute values would give a different rule. Discussion.

Dot product. Multiply corresponding vector entries and add the products. The vectors must have the same number of entries. Discussion.

Eigengap. Separation between an eigenvalue or eigenvalue group and competing eigenvalues outside it; small gaps make individual directions less stable. Discussion.

Eigenspace. The space of vectors associated with one eigenvalue, including zero; a repeated eigenvalue can allow several independent directions. Discussion.

Eigenvalue. The scalar by which a matrix stretches an associated eigenvector. Covariance eigenvalues measure variance along unit eigenvectors. Discussion.

Eigenvector. A nonzero vector that a square matrix sends to a scalar multiple of itself. Its sign is arbitrary; repeated eigenvalues permit changes of direction within the space sharing that eigenvalue. Discussion.

Embedding. A vector computed by a trained model to represent text numerically, often allowing related meanings to have similar directions. Discussion.

Energy. A context-dependent quantity. Squared Euclidean length is geometric energy; story attention energy is a separate weighting convention. Discussion.

Episode. A group linking related stories across days under a stated similarity and time rule. Discussion.

Euclidean norm. A vector’s length: the square root of the sum of its squared entries. Discussion.

Explained variance. Variation captured by retained covariance directions; its fraction is their eigenvalue sum divided by the total eigenvalue sum. Discussion.

Fit weight. A nonnegative amount of influence assigned to an observation when calculating a mean and covariance. Discussion.

Frobenius norm. The square root of the sum of all squared matrix entries. It measures the total size of a matrix error. Discussion.

Function. A rule assigning an output to an input; for example a squared-error function assigns a cost to each proposed fitted value. Discussion.

Gaussian distribution. The symmetric bell-shaped probability model used to interpret illustrative standard-deviation cutoffs; real news scores need not obey it. Discussion.

Gram matrix. A matrix of pairwise dot products, formed by multiplying a table’s transpose by the table when comparing its columns. Discussion.

Gram–Schmidt. Making independent input directions perpendicular by subtracting their projections onto earlier unit directions, then normalizing the remainders. Discussion.

Graph. Vertices connected by edges. Here articles or stories are vertices and a similarity rule determines edges. Discussion.

Greedy matching. Taking the best currently available pair at each step. It can miss the best total one-to-one assignment. Discussion.

Identity matrix. The square matrix with diagonal ones and other entries zero; multiplication by it leaves compatible vectors unchanged. Discussion.

Inverse. A matrix operation that undoes another square matrix operation when such an undoing exists; a zero diagonal scale cannot be inverted. Discussion.

Latent semantic analysis. A text representation obtained by retaining leading singular directions of a document–term table. Discussion.

Least squares. Choosing an allowed fit to minimize the sum of squared residual entries. Discussion.

Linear combination. A sum of vectors multiplied by scalar weights. Discussion.

Loading. A number associating an input coordinate or vocabulary term with a direction. Its scaling and centring must be specified. Discussion.

Logarithm. The inverse of exponentiation; the natural logarithm uses base e and is defined for positive real inputs. Discussion.

Marginal scaling. Dividing each coordinate by its own standard deviation. This fixes each variance but does not generally remove correlations. Discussion.

Matrix. A rectangular table of numbers; its shape records rows first, then columns. Discussion.

Mean. A coordinate-wise average. For a weighted mean, multiply by nonnegative weights, add, and divide by their positive total. Discussion.

Moment. An average of powers or products of values. Centred moments use deviations from a specified mean. Discussion.

Naming rotation. An orthogonal change of coordinates within the retained space, chosen to make terms concentrate on interpretable directions. Discussion.

Norm. A rule measuring size; here Euclidean vector length, Frobenius matrix length, or an explicitly identified matrix operator norm. Discussion.

Novelty ratio. Residual squared length divided by total centred squared length. It measures unexplained geometric fraction, not social importance or a probability of novelty. Discussion.

Operator norm. The largest matrix output length over unit-length inputs; it measures the largest possible amplification. Discussion.

Orthogonal. Perpendicular: two vectors have zero dot product. A square orthogonal matrix preserves lengths. Discussion.

Orthonormal. Mutually perpendicular and individually of unit length. Discussion.

Orthonormalization. Replacing spanning directions by mutually perpendicular unit directions spanning the same space, discarding dependent inputs. Discussion.

Outer product. A column times a row, making a matrix of all pairwise products of their entries. Discussion.

Overnight matching. Associating newly fitted directions with previous directions so that labels remain useful across updates. Discussion.

Oversampling. Using additional working directions beyond the desired final rank in a randomized decomposition. Discussion.

Percentile. A cutoff in an ordered collection or distribution. It describes a proportion of values, not the probability that an individual match is correct. Discussion.

Perturbation. A change to a matrix or other object; stability asks how much an output can change in response. Discussion.

Positive semidefinite. A symmetric matrix for which every quadratic form is nonnegative; a covariance matrix has this property. Discussion.

Power iteration. Repeated matrix products that amplify larger singular directions relative to smaller ones, with normalization for numerical stability. Discussion.

Power sum. A sum of values raised to a specified power; the first three sums can recover a third centred moment. Discussion.

Precedent. An earlier story selected for comparison by similarity in a specified representation. Discussion.

Precision. Correct accepted links divided by all accepted links; it needs a convention if none are accepted. Discussion.

Principal component. A covariance eigendirection, or an observation’s score along it when referring to component scores; leading directions capture the largest fitted variance. Discussion.

Procrustes alignment. An orthogonal rotation or reflection used to compare bases describing nearly the same subspace even if individual columns differ. Discussion.

Profile. An archetype’s per-axis means and standard deviations over the stories it dominates in its reference window. Discussion.

Projection. Keeping the component of a vector inside a chosen subspace. Orthogonal projection leaves a perpendicular residual. Discussion.

Quadratic form. A scalar made by multiplying a row vector, a square matrix, and the matching column; it generalizes a weighted sum of squared coordinates. Discussion.

Randomized SVD. An approximation that first finds a smaller space with random test directions, then decomposes the data inside that space. Discussion.

Range. The set of outputs a matrix can produce from all compatible input vectors. Discussion.

Rank. The number of independent directions in a matrix; retaining fewer singular directions produces a lower-rank approximation. Discussion.

Recall. Correct accepted links divided by all true links in a specified evaluated set; it needs a convention if there are no true links. Discussion.

Reconstruction. An estimate made by combining retained directions with their coordinates and restoring the mean if it was removed. Discussion.

Relative error. Residual norm divided by the positive original norm; it compares geometric sizes, not the fraction of correct articles. Discussion.

Residual. The difference between an observation and its reconstruction. It is a vector before its length or squared length is measured. Discussion.

Rotation invariance. A quantity remains unchanged when coordinates are rotated consistently, including its covariance or metric where needed. Discussion.

Score. A coordinate along a fitted direction, or a ranking value when explicitly identified as such. Discussion.

Shape. The row and column counts of a matrix, or length of a vector; compatible shapes are required for multiplication. Discussion.

Single linkage. Clustering by connected components of the graph of sufficiently similar pairs; chains can connect unlike endpoints. Discussion.

Singular value. A nonnegative scale in a singular value decomposition, usually ordered largest first. Discussion.

Singular value decomposition. Factoring a matrix into orthogonal directions, separate nonnegative scales, and orthogonal directions on the other side. Discussion.

Sketch. A smaller collection of matrix-output vectors used to approximate the important output space. Discussion.

Skewness. Asymmetry of a distribution, measured here through a standardized third centred moment when variance is positive. Discussion.

Sparse storage. Storing nonzero values and their positions rather than every cell of a mostly zero matrix. Discussion.

Spectrum. In the newspaper interface, a day’s attention-weighted vector of named coordinates; in eigenvalue analysis, a collection of eigenvalues. Context identifies the meaning. Discussion.

Standard deviation. The nonnegative square root of variance, returning squared deviations to the original coordinate scale. Discussion.

Standardization. Subtracting a reference mean and dividing by its positive standard deviation. Discussion.

Story. A cluster of related articles under the chosen within-day rule. Discussion.

Streaming. Processing manageable blocks while carrying forward sufficient intermediate quantities instead of retaining every input row. Discussion.

Subspace. A collection containing all linear combinations of selected directions, including zero. Discussion.

SVD. Abbreviation for singular value decomposition. Discussion.

Term frequency. A term’s count within a document, optionally damped by the logarithmic rule specified here. Discussion.

TF–IDF. Term frequency multiplied by inverse document frequency, followed here by row normalization. Discussion.

Threshold. A chosen decision boundary. Its meaning depends on the representation, population, and inequality used. Discussion.

Trace. The sum of a square matrix’s diagonal entries. The covariance trace is total variance. Discussion.

Transpose. Exchanging rows and columns, denoted by a superscript top symbol. Discussion.

Truncation. Discarding later singular or eigen directions while retaining the leading ones. Discussion.

T² statistic. Hotelling’s variance-scaled squared distance in retained coordinates. It uses positive retained variances or an appropriate full covariance inverse. Discussion.

Uncorrelated. Having covariance zero under the specified reference distribution; this does not generally imply statistical independence. Discussion.

Unit vector. A vector with Euclidean length one. Discussion.

Variance. An average squared deviation from a mean; the denominator and weights depend on whether describing a fitted population or estimating from a sample. Discussion.

Varimax. An orthogonal rotation criterion that encourages uneven squared loadings within each direction, supporting simpler term-based names. Discussion.

Vector. An ordered list of numbers; the order determines which coordinate each entry represents. Discussion.

Weighted average. A sum of values multiplied by nonnegative weights, divided by a positive weight total. Discussion.

Welford update. An incremental running mean and sum of squared deviations, avoiding subtraction of two large nearly equal sums. Discussion.

Whitening. A transformation giving fitted coordinates identity covariance; unlike marginal scaling, it also removes pairwise linear correlations. Discussion.

Z-score. A deviation from a reference mean divided by its positive standard deviation; it is a standardized coordinate, not itself a probability. Discussion.

Subject index

The PDF gives linked page references; digital editions link directly to the named discussion.

Absolute value: Cosine similarity.

Accumulator: Sums over blocks.

Anisotropy: Embeddings.

Assignment: Kuhn–Munkres.

Attention energy: Dominant axis, spectrum, profile.

Basis: Transpose, symmetry, orthogonality.

Block: Sums over blocks.

Canon: Episodes: threading across days.

Centring: Centering and covariance.

Centroid: T² and Q.

Connected component: Stories: single linkage on a day’s articles.

Coordinate: A matrix times a vector.

Corpus: Counting words.

Correlation: Kuhn–Munkres.

Cosine similarity: Cosine similarity.

Covariance: Centering and covariance.

Covariance matrix: Centering and covariance.

Damping: TF‑IDF.

Dense storage: TF‑IDF.

Derivative: Truncation.

Diagonal matrix: What the SVD is.

Dimension: Transpose, symmetry, orthogonality.

Document frequency: TF‑IDF.

Dominant axis: Dominant axis, spectrum, profile.

Dot product: Cosine similarity.

Eigengap: Why nightly refinement is stable.

Eigenspace: Two ambiguities.

Eigenvalue: Eigenvectors: the axes of the cloud.

Eigenvector: Eigenvectors: the axes of the cloud.

Embedding: Embeddings.

Energy: Energy × (1 + ν) for ranking.

Episode: Episodes: threading across days.

Euclidean norm: Cosine similarity.

Explained variance: How many axes to keep.

Fit weight: Weights that balance the days.

Frobenius norm: Truncation.

Function: Truncation.

Gaussian distribution: ±2σ on the spectrum.

Gram matrix: A matrix times a matrix.

Gram–Schmidt: Latent semantic analysis.

Graph: Stories: single linkage on a day’s articles.

Greedy matching: Kuhn–Munkres.

Identity matrix: Transpose, symmetry, orthogonality.

Inverse: T² and Q.

Latent semantic analysis: Latent semantic analysis.

Least squares: Truncation.

Linear combination: A matrix times a vector.

Loading: Varimax.

Logarithm: TF‑IDF.

Marginal scaling: T² and Q.

Matrix: A matrix times a vector.

Mean: Centering and covariance.

Moment: Orienting an axis from power sums.

Naming rotation: Varimax.

Norm: Cosine similarity.

Novelty ratio: T² and Q.

Operator norm: Why nightly refinement is stable.

Orthogonal: Transpose, symmetry, orthogonality.

Orthonormal: Transpose, symmetry, orthogonality.

Orthonormalization: Latent semantic analysis.

Outer product: Centering and covariance.

Overnight matching: 0.8 for matching axes across nights.

Oversampling: Latent semantic analysis.

Percentile: Stories: single linkage on a day’s articles.

Perturbation: Why nightly refinement is stable.

Positive semidefinite: Eigenvectors: the axes of the cloud.

Power iteration: Latent semantic analysis.

Power sum: Orienting an axis from power sums.

Precedent: Precedents.

Precision: Episodes: threading across days.

Principal component: Eigenvectors: the axes of the cloud.

Procrustes alignment: Why nightly refinement is stable.

Profile: Dominant axis, spectrum, profile.

Projection: Projection, reconstruction, residual.

Quadratic form: T² and Q.

Randomized SVD: Latent semantic analysis.

Range: Latent semantic analysis.

Rank: Truncation.

Recall: Episodes: threading across days.

Reconstruction: Projection, reconstruction, residual.

Relative error: Truncation.

Residual: Projection, reconstruction, residual.

Rotation invariance: T² and Q.

Score: Projection, reconstruction, residual.

Shape: A matrix times a matrix.

Single linkage: Stories: single linkage on a day’s articles.

Singular value: What the SVD is.

Singular value decomposition: What the SVD is.

Sketch: Latent semantic analysis.

Skewness: Two ambiguities.

Sparse storage: TF‑IDF.

Spectrum: Dominant axis, spectrum, profile.

Standard deviation: ±2σ on the spectrum.

Standardization: ±2σ on the spectrum.

Story: Stories: single linkage on a day’s articles.

Streaming: Sums over blocks.

Subspace: Why a newspaper needs linear algebra.

SVD: What the SVD is.

Term frequency: TF‑IDF.

TF–IDF: TF‑IDF.

Threshold: The clustering thresholds.

Trace: How many axes to keep.

Transpose: Transpose, symmetry, orthogonality.

Truncation: Truncation.

T² statistic: T² and Q.

Uncorrelated: Centering and covariance.

Unit vector: Cosine similarity.

Variance: Centering and covariance.

Varimax: Varimax.

Vector: Why a newspaper needs linear algebra.

Weighted average: Weights that balance the days.

Welford update: ±2σ on the spectrum.

Whitening: Varimax.

Z-score: ±2σ on the spectrum.

References

  1. Deerwester, S., Dumais, S. T., Furnas, G. W., Landauer, T. K., & Harshman, R. (1990). Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6), 391–407.
  2. Eckart, C., & Young, G. (1936). The approximation of one matrix by another of lower rank. Psychometrika, 1(3), 211–218.
  3. Halko, N., Martinsson, P.-G., & Tropp, J. A. (2011). Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review, 53(2), 217–288.
  4. Hotelling, H. (1931). The generalization of Student’s ratio. Annals of Mathematical Statistics, 2(3), 360–378.
  5. Jackson, J. E., & Mudholkar, G. S. (1979). Control procedures for residuals associated with principal component analysis. Technometrics, 21(3), 341–349.
  6. Kaiser, H. F. (1958). The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23(3), 187–200.
  7. Kuhn, H. W. (1955). The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1–2), 83–97.
  8. Davis, C., & Kahan, W. M. (1970). The rotation of eigenvectors by a perturbation. III. SIAM Journal on Numerical Analysis, 7(1), 1–46.
  9. Marchenko, V. A., & Pastur, L. A. (1967). Distribution of eigenvalues for some sets of random matrices. Mathematics of the USSR‑Sbornik, 1(4), 457–483.
  10. Welford, B. P. (1962). Note on a method for calculating corrected sums of squares and products. Technometrics, 4(3), 419–420.
  11. Xiao, S., Liu, Z., Zhang, P., & Muennighoff, N. (2023). C‑Pack: Packaged resources to advance general Chinese embedding. arXiv:2309.07597.
  12. Khrabrov, A. (2026). Eigen Times: A Newspaper in the Eigenbasis of the News. First Pair Press. https://firstpair.org/read/eigentimes/