Projects/Foundations/Pivot strategies and backward stability of Gaussian elimination — real-data stress test
Level 5 · research · ~14 h
Pivot strategies and backward stability of Gaussian elimination — real-data stress test
Implement partial, complete and rook pivoting for LU factorization and quantify backward error on Hilbert and Vandermonde matrices. Repeat on a real dataset, report a table with confidence intervals over three trials, and explain which assumption broke.
Prerequisites
Problem statement
- 01Implement partial, complete and rook pivoting for LU factorization and quantify backward error on Hilbert and Vandermonde matrices. Repeat on a real dataset, report a table with confidence intervals over three trials, and explain which assumption broke.
Real-world motivation
- 01Pivot choice controls growth factor and determines whether elimination is backward stable in finite precision. The real-data stress test setting forces concrete choices about data, scale and evaluation.
Learning objectives
- 01Implement three pivoting rules
- 02Measure growth factor and residual
- 03Identify when partial pivoting fails
- 04Report wall-clock seconds on one pinned CPU core alongside the baseline metrics.
Technical architecture
- 01in-place LU with row and column permutations
- 02growth-factor tracker
- 03residual and condition-number estimator
Mathematical foundations
- 01growth factor $\rho=\max_{i,j}|U_{ij}|/\max_{i,j}|A_{ij}|$
- 02backward error $\lVert PAQ-LU\rVert/(\lVert A\rVert\rho)$
Dataset and sources
- 01MNIST 70k subset
- 02UCI Sparse Matrix collection
Step-by-step tasks
- 01Frame the task and freeze the real-data stress test evaluation protocol with a fixed random seed.
- 02Implementation 1: Write lu_pivot(A, rule) in NumPy
- 03Implementation 2: Track pivots in permutation vectors
- 04Implementation 3: Compare with scipy.linalg.lu_factor
- 05Verification 1: Check PAQ = LU to 1e-12 on well-conditioned inputs
- 06Verification 2: Verify determinant from the diagonal of U
- 07Run the ablation grid and report wall-clock seconds on one pinned CPU core over three independent trials.
Implementation requirements
- 01Write lu_pivot(A, rule) in NumPy
- 02Track pivots in permutation vectors
- 03Compare with scipy.linalg.lu_factor
- 04Log all hyperparameters and the random seed for the real-data stress test run.
Testing requirements
- 01Check PAQ = LU to 1e-12 on well-conditioned inputs
- 02Verify determinant from the diagonal of U
- 03Measure wall-clock seconds on one pinned CPU core over at least three seeds.
Evaluation metrics
- 01relative residual
- 02growth factor
- 03pivot count
- 04wall-clock seconds on one pinned CPU core
Expected outputs
- 01stability table across condition numbers
- 02heatmap of U magnitudes
Common failure modes
- 01Hilbert matrices are numerically singular well before n=15
- 02rook pivoting costs extra comparisons
- 03real data violates the synthetic noise model and the baseline overfits
Stretch goals
- 01implement iterative refinement
- 02test on totally nonnegative matrices
- 03profile the method with cProfile and report the dominant kernel
Research extensions
- 01characterize growth for random sign matrices
- 02study when complete pivoting helps in practice
GitHub submission requirements
- 01A repository whose README states the real-data stress test protocol and the exact command to reproduce it.
- 02Source for the scratch implementation, a test file, and a results table with uncertainty estimates.
- 03A two-page report explaining failures on MNIST 70k subset and what the ablation revealed.
Completion rubric
- 01all three pivot rules correct
- 02residual computation correct
- 03explanation of growth factor
- 04Extra credit: profile the method with cProfile and report the dominant kernel
Submit when every rubric item is satisfied and your repository contains runnable code plus a reproduction command.