The Sherman-Morrison-Woodbury Formula
A shortcut for updating a matrix inverse after a small, low-rank change — such as adding one new asset to a covariance matrix — without recomputing the whole inverse from scratch.
Prerequisites: Matrix Inverses and Linear Systems, The Schur Complement
Recomputing the inverse of a large covariance matrix every time a single new asset is added, or a single risk factor exposure is updated, is wasteful — a full inverse of an matrix costs on the order of operations, and most of that work is thrown away and redone from scratch for a change that only touched a handful of entries. The Sherman-Morrison-Woodbury formula says you don't need to: if the change is low-rank (a small number of new rows/columns, or a rank-one update), the new inverse can be built directly from the old inverse plus a small correction.
An analogy: patching a map instead of redrawing it
If a single road closes on a large city map, you don't redraw the entire map from scratch — you take the existing map and patch in a local correction around the closure. The Sherman-Morrison-Woodbury formula is the same idea applied to matrix inverses: instead of recomputing the whole inverse (redrawing the whole map) after a small, localized change, it patches the old inverse with a correction term sized to the rank of the change, which is cheap when the change itself is small.
The math, one symbol at a time
For an invertible matrix and a low-rank update (where , are tall/wide with few columns and is small), the formula gives
In words: the inverse of the updated matrix equals the old inverse, minus a correction term built entirely from the old inverse and the small pieces , , describing the update — no inversion of the full updated matrix is needed, only inversion of the much smaller matrix , whose size matches the rank of the update, not the size of . The simplest case, a rank-one update , simplifies further to — a correction built from just two matrix-vector products.
Worked example 1: a rank-one update by hand
Let , so . Update with , i.e. . Compute . Then , which works out to . The formula gives — matching a direct inversion of , but computed with only vector operations.
Worked example 2: adding one asset to a portfolio covariance inverse
A quant already has the inverse of a 500-asset covariance matrix cached (needed repeatedly for mean-variance optimization). A new asset arrives whose covariances with the existing 500 form a vector , and its own variance requires a rank-one adjustment. Instead of re-inverting a matrix (roughly million operations), the formula updates the cached inverse using a handful of matrix-vector products, each costing about operations — several hundred times cheaper, and exactly why production risk systems use incremental updates rather than full recomputation whenever the investable universe changes by one name.
What this means in practice
This formula is what makes incremental portfolio risk updates, online regression (adding one data point without refitting), and Kalman filter covariance updates computationally feasible at scale. It's the same block-elimination logic as the The Schur Complement, specialized to the case of a low-rank update, and it's why production systems maintain a cached inverse and patch it rather than re-solving a full linear system on every new data point.
For a low-rank update , the new inverse can be built from the old inverse plus a correction sized to the rank of the update — turning an expensive full re-inversion into a cheap, incremental patch.
The formula assumes the small matrix being inverted is itself well-conditioned. If the update nearly cancels part of 's structure — pushing that small matrix close to singular — the formula becomes numerically unstable even though it's algebraically exact. In practice, always sanity-check an incrementally updated inverse periodically against a fresh full inversion; small numerical errors from repeated incremental updates can accumulate silently over many updates.
Related concepts
Practice in interviews
Further reading
- Golub & Van Loan, Matrix Computations, ch. 2