How a graph Laplacian turns similarity into cluster coordinates, why its zero eigenvalues count connected components, and which choices matter for financial data.
Spectral clustering
Spectral clustering groups observations using eigenvectors of a matrix built from their similarities. For a quant, it can turn a network of asset relationships into candidate peer groups, including groups that are awkward to describe by distance from a single centre. The resulting partition reflects the chosen relationship, estimation window and graph construction; it does not establish a sector classification or a trading signal.
The distinguishing step comes before ordinary clustering: replace the original observations with coordinates that describe how they connect through a graph. The eigenvalues and eigenvectors belong to that graph matrix, rather than necessarily to a return covariance matrix. Von Luxburg, §§2–4 develops this graph construction.
A graph that can be solved by inspection
Take four fictional assets, numbered 1 to 4. Give edges 1–2 and 3–4 weight 1, with every other edge absent. These are stipulated, dimensionless similarities, not measured correlations.
Let W be the symmetric adjacency matrix, with zero diagonal. Its degree matrix is D=diag(d1,…,d4), where di=∑jwij. Each vertex has degree 1, so the unnormalised graph Laplacian is
L=D−W=1−100−1100001−100−11.
Each two-by-two block has characteristic polynomial λ(λ−2). The full spectrum, counting repeated values, is therefore
λ1,λ2,λ3,λ4=0,0,2,2.
One orthonormal basis for the zero-eigenvalue subspace is
u1=21(1,1,0,0)⊤,u2=21(0,0,1,1)⊤.
Put these vectors in the columns of U. The rows are the asset coordinates: assets 1 and 2 both become (1/2,0); assets 3 and 4 both become (0,1/2). Within each pair the distance is zero; between pairs it is 1. A two-group clustering of these coordinates recovers the two connected components.
Original dimensionless toy graph has weight-1 edges 1–2 and 3–4. A zero-eigenspace embedding maps nodes 1 and 2 to (0.707, 0), and nodes 3 and 4 to (0, 0.707). Its eigenvalues are 0, 0, 2, 2; adding edge 2–3 of weight 0.1 changes them to approximately 0, 0.0950, 2, 2.1050.
Original toy graph and one orthonormal zero-eigenspace embedding. Coincident nodes share coordinates. A weak bridge removes exact disconnection without removing the small second eigenvalue.
The mechanism follows from
f⊤Lf=21i,j∑wij(fi−fj)2.
With nonnegative weights, zero energy forces equal values along every edge, hence throughout each connected component. There is one independent constant per component: the multiplicity of zero equals the number of connected components. This statement requires the undirected, nonnegative graph convention used here. See von Luxburg, §3.1.
The displayed basis is not unique. An eigensolver may return UR for any orthogonal two-by-two matrix R. This rotates or reflects the row coordinates and preserves their distances. Reading one repeated-eigenvalue eigenvector as a uniquely identified economic factor would therefore be a mistake; the subspace carries the grouping information. Ng, Jordan and Weiss, §3.1 makes this distinction explicit.
What changes when the groups are connected?
Add an edge of weight 0.1 between vertices 2 and 3. The graph now has one connected component. Its unnormalised Laplacian eigenvalues are
0,1.1−1.01,2,1.1+1.01,
or approximately 0,0.0950,2,2.1050. There is only one exact zero, but the small second eigenvalue describes an inexpensive change across the weak bridge. In noisier graphs, spectral clustering uses such low-frequency directions rather than requiring perfectly disconnected groups. A gap after the kth smallest eigenvalue can suggest a candidate resolution; it does not determine an economically correct k by itself.
Normalisation matters when vertices have different total edge weights. A plain cut can favour separating a small, weakly connected set. A normalised cut instead scales the weight crossing a partition by each side's total degree, and its continuous relaxation leads to a generalised eigenproblem. Shi and Malik, §2–2.1 derive this objective.
One common implementation, the Ng–Jordan–Weiss method, uses
Lsym=I−D−1/2WD−1/2.
Take orthonormal eigenvectors for its k smallest eigenvalues, stack them as columns, normalise each row to unit length, then run k-means on the rows. Handle zero-degree vertices before using D−1/2. This row-normalisation step is part of this particular method, not a universal extra step for every spectral algorithm. The original algorithm, §2 uses the equivalent normalised adjacency matrix and its largest eigenvalues.
The financial modelling choice sits inside the edges
A correlation matrix may contain negative entries. Putting it directly into W breaks the nonnegative-weight assumption above; positive semidefiniteness of a correlation matrix does not make every entry nonnegative. Signed-network methods require their own definitions and guarantees.
For example, the explicit construction wij=max(ρij,0) for i=j discards negative correlations. Using ∣ρij∣ instead treats strong opposite movement as a strong relationship. These choices answer different questions: “moves together” versus “strongly related in either direction.” Neither transformation is a universal financial default. Feature-based distances and a nonnegative similarity function provide another route, but feature scales and graph sparsity still choose what counts as close.
In a historical trading study, construct the graph using information available at the decision date, then examine membership sensitivity across windows and edge rules. A stable-looking partition on the full sample can contain look-ahead bias. Any claim about diversification or subsequent returns needs its own evaluation.
For the linear algebra behind the embedding, Eigenvalues and Covariance Matrices develops symmetric eigenpairs and orthonormal bases (public preview; full lesson requires membership).
Sources
Ulrike von Luxburg, A Tutorial on Spectral Clustering, 2007, §§2–4 and 8.1–8.2: nonnegative similarity graphs, Laplacians, component multiplicity, algorithm variants and graph sensitivity.
Andrew Y. Ng, Michael I. Jordan and Yair Weiss, On Spectral Clustering: Analysis and an Algorithm, §§2–3.1: the normalised algorithm, row coordinates and invariance under a change of eigenspace basis.