Matrix Decompositions — LU
00 · Symbol Glossary
A unit lower triangular matrix: ones on the main diagonal, zeros strictly above the diagonal. In the LU decomposition , the entries below the diagonal of are the multipliers from Gaussian elimination — the scalars in row operations .
An upper triangular matrix: zeros strictly below the main diagonal. In , is the row echelon form of (before back-substitution scales pivots to 1). Solving reduces to two easy triangular solves: , then .
A matrix obtained by permuting the rows of the identity . Each row and column has exactly one entry equal to 1, all others 0. When Gaussian elimination requires row swaps, the factorisation becomes — pivoting is encoded in , not in or .
The multiplier stored at position of for . If elimination uses , then is the ratio of the entry being eliminated to the pivot above it: at the moment of elimination.
01 · Why Factor a Matrix
Chapter 4 showed how to solve once by Gaussian elimination. In quantitative work, the matrix is often fixed while the right-hand side changes — stress scenarios, Monte Carlo paths, or successive time steps in a risk engine. Re-running full elimination for every new wastes the work already invested in reducing .
The LU decomposition records elimination as a matrix product: . The expensive step — reducing to triangular form — is done once. Each new costs only two triangular solves, each for an system instead of for full elimination.
A square matrix has an LU decomposition if there exist matrices such that:
is unit lower triangular — for all , and for .
is upper triangular — for .
When no row interchanges are needed during elimination, admits a direct LU factorisation. When pivots require row swaps, the factorisation becomes with a permutation matrix .
A sensitivity matrix arises from a finite-difference approximation of a PDE used in counterparty exposure. For each of Monte Carlo scenarios, you must solve .
Full Gaussian elimination per scenario: flops.
LU once () plus triangular solves ( flops): dominated by the single factorisation. The LU approach is roughly faster — the difference between overnight and a week of compute.
Suppose is fixed and you need solutions for and .
Attempted computation: run Gaussian elimination from scratch on the augmented matrix , then again on .
Where it breaks: the coefficient matrix operations — eliminating the entry, updating rows 2 — are identical in both runs. Only the augmented column differs. Re-doing elimination on duplicates work that LU stores permanently in and .
Consequence: for right-hand sides, naive elimination costs . LU plus solves costs . When , this gap is decisive.
02 · LU from Gaussian Elimination
Every multiplier written down during elimination becomes an entry of . The upper triangular result of elimination is .
When Gaussian elimination eliminates the entry at position using pivot row (with ), the multiplier is:
— the entry in row , column immediately before the elimination step.
— the pivot in row , column , which must be nonzero.
The row operation is . The multiplier is stored at position of .
Identify the matrix: . No zero pivot appears in column 1 — row swaps are not needed. Initialise (ones on the diagonal, zeros elsewhere) and work on a copy of to build .
Eliminate below pivot : target column 1, rows 2 and 3.
. Operation: . Row 2 becomes .
. Operation: . Row 3 becomes .
Store at , at .
Eliminate below pivot : target column 2, row 3 only.
. Operation: . Row 3 becomes .
Store at .
Read off from the reduced matrix:
Assemble from stored multipliers:
Verify entry by entry:
✓.
✓.
✓.
✓.
✓.
All nine entries match. The factorisation is correct.
is not mysterious — it is a bookkeeping matrix for the elimination multipliers. Row of (below the diagonal) records every scalar by which row was reduced during elimination. is the echelon form. Together they reconstruct exactly.
03 · Solving Systems via Forward and Back Substitution
Once is known, solving splits into two triangular systems.
Given and , solve in two stages:
Stage 1 — Forward substitution: solve for . Since is lower triangular with unit diagonal, solve top to bottom: , then .
Stage 2 — Back substitution: solve for . Since is upper triangular, solve bottom to top: , then .
Forward substitution — solve :
.
.
.
Back substitution — solve :
.
.
.
Verify in the original system: :
Row 1: ✓.
Row 2: ✓.
Row 3: ✓.
With and , attempting first is wrong.
Why it breaks: and mean and contribute to row 1. Until and are known, cannot be determined. Upper triangular systems must be solved from the bottom row upward.
Consequence: solving top-down gives a vector that satisfies row 1 by accident but violates rows 2 and 3. Back substitution is mandatory.
04 · Pivoting and the Factorisation
When a pivot is zero (or dangerously small), elimination must swap rows. The permutation is factored separately.
If Gaussian elimination on requires row interchanges, there exists a permutation matrix such that:
records the sequence of row swaps. Equivalently, . Since is a permutation matrix, — inversion is transposition.
To solve : compute , then solve (forward), then (back). The permutation reorders to match the pivoted rows of .
. Pivot in position is — elimination stalls.
Swap rows: , so .
Now , giving and .
✓. Without the swap, no LU factorisation of exists without pivoting.
For , attempting is undefined.
Why it breaks: division by zero in the multiplier formula. The matrix may still be invertible — here — but elimination must swap rows first so a nonzero pivot sits in position .
Consequence: LU without pivoting fails on matrices that are perfectly well-conditioned. Production solvers always use .
05 · Complexity and Quant Application
For :
LU factorisation: flops — same order as one Gaussian elimination.
Each triangular solve: flops.
right-hand sides: total — factorise once, solve times.
Determinant via LU: (times if pivoting was used).
A delta-gamma approximation for a book of risk factors requires solving for each of bump scenarios, where is the Hessian of mark-to-market value and each is a gradient under a different stress.
LU factorisation of : one flop pass.
50 solves: flops.
Total flops. Naive elimination: flops — roughly more work. In a nightly risk batch processing thousands of instruments, LU is the standard backend for repeated solves.
06 · Practice Exercises
Run Gaussian elimination without row swaps. Store each multiplier in . The final reduced matrix is .
.
. : row 2 becomes .
. : row 3 becomes .
. : row 3 becomes .
Verify ✓. ✓.
Find the LU decomposition of . Show all three multipliers and verify for at least three entries.
After factorising, solve top to bottom, then bottom to top.
From Exercise 16.1: , , .
Forward: . . .
Back: . . .
. Check: ✓; ✓.
Using with LU factors from elimination, solve where . Show forward and back substitution steps.
Row swap first: exchanges rows 1 and 2. Factorise , not . Then .
. , .
. , .
. (one row swap). .
Direct check: ✓.
Find for . State , , , and compute from the factorisation.
LU exists without pivoting only if every leading principal minor is nonzero. Equivalently, every upper-left submatrix must have nonzero determinant.
. Leading minor: ✓. Leading minor: .
Zero determinant means rows are linearly dependent: row 2 = row 1. Elimination gives — zero pivot on the diagonal. No LU factorisation with nonzero diagonal of exists.
For : system is consistent () with infinitely many solutions. For : inconsistent (). LU cannot be used to solve either case reliably because is singular.
Explain why has no usable LU factorisation without pivoting. What happens when you try to solve for versus ?
Count flops: one factorisation is ; each triangular solve is . Compare to .
Let , .
Naive: flops.
LU: flops.
Ratio: . LU is roughly 200 times cheaper for these parameters.
Break-even: LU wins when (one factorisation plus solves beats factorisations). The advantage grows linearly with .
A risk system has factors and scenario right-hand sides. Argue quantitatively why storing an LU factorisation beats re-running Gaussian elimination for each scenario. State the break-even value of .
Factorise once. For each , forward then back substitute. Compare total flop count to full eliminations.
. . , .
: , . . . .
: , . . . .
Factorisation cost: flops for . Each solve: flops. Total: flops. Two full eliminations: flops — break-even at for tiny ; for , factorisation dominates once and solves are cheap.
A sensitivity matrix is fixed. Solve for and using one LU factorisation. Show both solutions and comment on the cost advantage for large .
07 · Summary
| Term | Definition |
|---|---|
| LU decomposition | with unit lower triangular, upper triangular |
| Multiplier | Scalar stored in during elimination |
| Forward substitution | Solve top to bottom |
| Back substitution | Solve bottom to top |
| Pivoting version; records row swaps | |
| Complexity | Factorise once; each solve |
| Determinant |
Next: Matrix Decompositions — QR — orthogonal-triangular factorisation via Gram-Schmidt, and why it delivers numerically stable least squares where normal equations fail.