Basic Prerequisites: High-school algebra and vector geometry. Nothing else - this page is the on-ramp to the whole toolbox.
1. Intuition & Practical Objective
This page builds the why of linear algebra with no prior linear algebra needed. The objective is one idea: a matrix is a machine that stretches, rotates, and flattens space, and the eigenvalues and eigenvectors tell you exactly which directions get stretched and by how much. Once you see a covariance matrix as such a machine, every risk/factor computation becomes “feed a direction in, read how much variance comes out.”
Start with the dumbest question: why does a portfolio’s risk behave like a matrix? If is a vector of portfolio weights and the vector of asset returns, the portfolio variance is
a quadratic form. The matrix is not a table of numbers to look up one at a time - it is a rule that takes any weight vector and returns its variance. Three steps:
- A matrix acts on a direction like a stretch factor. If (the direction is an eigenvector), then just scales that direction by . Everything does decomposes into independent stretchings along its eigenvectors - there is no mixing across them.
- Variance concentrates along a few directions. A covariance matrix is symmetric, so the spectral theorem guarantees its eigenvectors are orthonormal and its eigenvalues are the variances along those directions. For a book of correlated assets, one direction (the “market”) usually carries most of the total variance - this is why factor models and PCA work at all.
- Risk = a sum of independent bets. Because , the portfolio variance is - the variance is the sum of uncorrelated contributions along each principal axis. Risk decomposes into orthogonal, additive pieces. That decomposition is the entire job of the whole folder.
2. Mathematical Ground Truth & Derivations
The stretch-and-rotate picture. Any real symmetric matrix can be written
with (columns orthonormal) and . Because the are orthogonal, the contribution of direction to any quadratic form is separate from all the others:
This is the spectral theorem (Strang Ch 6; Horn & Johnson Thm 2.5.6) - the single most-used theorem in the toolbox. For a covariance matrix it says: there is an orthonormal frame in which the risk matrix becomes diagonal, i.e. the correlated problem becomes independent one-dimensional problems.
Why a covariance is a “machine”. Feed in ; out comes variance. The big eigenvalues mark the directions of large common risk; the small ones mark directions you can barely measure (and that fills with noise - see 06). The ratio of largest to smallest eigenvalue,
the condition number, tells you how “stretched out” the risk ellipsoid is - how ill-conditioned any inversion of will be.
3. Computational Implementation - power iteration “discovers” the dominant risk direction
The cleanest way to feel the theory: power iteration repeatedly applies to a vector and normalizes - it converges to the dominant eigenvector with no matrix algebra at all. On a simple covariance-like matrix it “finds” the direction of largest variance from a random start. Stdlib only.
Repeatedly “stretching and re-normalizing” a vector converges to the direction that stretches the most - that is the dominant risk mode, found with no matrix machinery. This is exactly what every eigen-solver (and every PCA routine) is doing under the hood, and the convergence failure when the top eigenvalues are close is the first warning of numerical trouble (06).
4. Failure Modes & First-Principles Breakdowns
- Conflating “correlated” with “a direction”. The matrix is not just a collection of pairwise correlations; it is a linear operator acting on weight vectors. Beginners read entries; the whole point is that the eigenvectors, not the entries, are the risk structure.
- The dominant-mode trap. Power iteration (and naive PCA) always reports the biggest eigenvalue first, which is usually the market factor. Stopping there and calling the rest “noise” throws away genuinely independent risk sources - and when , the rest is noise that looks real.
- Normalization is not optional. Eigenvectors are only determined up to scale (and sign); comparing “the market factor” across two models requires fixing a normalization convention (e.g. , or loadings rescaled as in Tsay §9.4).
5. References
- Strang, Introduction to Linear Algebra (5th ed., 2016)
- Tsay, Analysis of Financial Time Series
- Horn & Johnson, Matrix Analysis, Thm 2.5.6 (spectral theorem)
6. Connected Graph Bridges
- Continue: 02 · Vectors, Spaces & Matrices · 04 · Eigenvalues & Covariance · Index Hub
- Forward: Modern Portfolio Theory (risk as ) · Covariance Shrinkage & Denoising
- Base: Index Hub (self-contained entry to the toolbox)