Numerical Methods · Numerical Methods
Numerical Linear Algebra
Explanation
Why Numerical Linear Algebra?
Linear systems appear everywhere in the real world: physical simulations, image processing, machine learning, and networking. Matrices can contain millions of entries, so solving them efficiently and accurately matters greatly.
** Factorization — Extending Gaussian Elimination**
factorization writes a matrix as a product where:
- — lower triangular matrix with 1s on the main diagonal
- — upper triangular matrix
The advantage: to solve , perform two steps:
1. Forward substitution: solve
2. Back substitution: solve
You can solve many systems with the same at each after the initial factorization.
**Finding and **: exactly like Gaussian elimination — the elimination multiplier becomes an entry of .
> Note — Partial Pivoting: Not every invertible matrix admits a plain factorization. For example, is invertible but has , blocking the factorization. **The general form is **, where is a permutation matrix (partial pivoting — row swaps). The plain (no pivoting) exists when all leading principal submatrices of are nonsingular (sufficient condition: is positive definite).
Cholesky Factorization — For Positive Definite Matrices
If is symmetric and positive definite (all eigenvalues positive), then where is lower triangular with positive diagonal entries.
- Twice as efficient as due to symmetry
- Numerically stable — no pivoting required
- Common in optimization problems and statistics
Condition Number and Ill-Conditioned Problems
The condition number is defined (norm-dependent) as:
For the spectral norm (, induced by the vector 2-norm):
where and are the largest and smallest singular values of . For other norms (, ), the condition number is computed in that norm and does not equal the singular-value ratio in general. (Assumption: is invertible and for the relative-error bound.)
Interpretation: if , then a relative perturbation of in the data can cause a relative error of up to in the solution:
- : well-conditioned matrix — stable solution
- : ill-conditioned matrix — solution is highly sensitive to small errors
Iterative Methods — Jacobi and Gauss-Seidel
For large problems (sparse matrices), estimate the solution in steps. Write where is the diagonal part.
Jacobi method: each iteration computes simultaneously:
Gauss-Seidel method: each iteration uses new values immediately:
Gauss-Seidel typically converges faster than Jacobi. Both converge if is diagonally dominant.
** Factorization and Gram-Schmidt Orthogonalization**
factorization writes where is orthogonal and is upper triangular.
Gram-Schmidt method: makes each column orthogonal to the previous ones, then normalizes.
**Uses of **: solving systems, computing eigenvalues ( algorithm), and least-squares problems.
SVD — The Most Powerful Numerical Tool
Every matrix can be factored as where:
- (): left singular vectors — orthogonal columns
- (): diagonal matrix with singular values
- (): right singular vectors — orthogonal columns
Pseudo-inverse (Moore-Penrose): .
Least-squares solution for overdetermined system (): .
Truncated SVD: keeping largest singular values gives a rank- approximation — the basis of PCA and many compression methods.
Numerical Eigenvalue Computation — Power Method
To compute the dominant eigenvalue :
The vector converges in direction to the eigenvector of , provided the initial vector has a nonzero component in that direction. The rate determines speed. (If , the sign alternates between iterations — the direction converges, not the vector itself.)
** Algorithm for Eigenvalues**: initialize , then iterate: , . The sequence converges to Real Schur Form — block upper-triangular: real eigenvalues appear directly on the diagonal, while complex conjugate pairs are encoded in blocks. For real matrices with distinct real eigenvalues, convergence to upper triangular (eigenvalues on the diagonal) holds.
Linear systems appear everywhere in the real world: physical simulations, image processing, machine learning, and networking. Matrices can contain millions of entries, so solving them efficiently and accurately matters greatly.
** Factorization — Extending Gaussian Elimination**
factorization writes a matrix as a product where:
- — lower triangular matrix with 1s on the main diagonal
- — upper triangular matrix
The advantage: to solve , perform two steps:
1. Forward substitution: solve
2. Back substitution: solve
You can solve many systems with the same at each after the initial factorization.
**Finding and **: exactly like Gaussian elimination — the elimination multiplier becomes an entry of .
> Note — Partial Pivoting: Not every invertible matrix admits a plain factorization. For example, is invertible but has , blocking the factorization. **The general form is **, where is a permutation matrix (partial pivoting — row swaps). The plain (no pivoting) exists when all leading principal submatrices of are nonsingular (sufficient condition: is positive definite).
Cholesky Factorization — For Positive Definite Matrices
If is symmetric and positive definite (all eigenvalues positive), then where is lower triangular with positive diagonal entries.
- Twice as efficient as due to symmetry
- Numerically stable — no pivoting required
- Common in optimization problems and statistics
Condition Number and Ill-Conditioned Problems
The condition number is defined (norm-dependent) as:
For the spectral norm (, induced by the vector 2-norm):
where and are the largest and smallest singular values of . For other norms (, ), the condition number is computed in that norm and does not equal the singular-value ratio in general. (Assumption: is invertible and for the relative-error bound.)
Interpretation: if , then a relative perturbation of in the data can cause a relative error of up to in the solution:
- : well-conditioned matrix — stable solution
- : ill-conditioned matrix — solution is highly sensitive to small errors
Iterative Methods — Jacobi and Gauss-Seidel
For large problems (sparse matrices), estimate the solution in steps. Write where is the diagonal part.
Jacobi method: each iteration computes simultaneously:
Gauss-Seidel method: each iteration uses new values immediately:
Gauss-Seidel typically converges faster than Jacobi. Both converge if is diagonally dominant.
** Factorization and Gram-Schmidt Orthogonalization**
factorization writes where is orthogonal and is upper triangular.
Gram-Schmidt method: makes each column orthogonal to the previous ones, then normalizes.
**Uses of **: solving systems, computing eigenvalues ( algorithm), and least-squares problems.
SVD — The Most Powerful Numerical Tool
Every matrix can be factored as where:
- (): left singular vectors — orthogonal columns
- (): diagonal matrix with singular values
- (): right singular vectors — orthogonal columns
Pseudo-inverse (Moore-Penrose): .
Least-squares solution for overdetermined system (): .
Truncated SVD: keeping largest singular values gives a rank- approximation — the basis of PCA and many compression methods.
Numerical Eigenvalue Computation — Power Method
To compute the dominant eigenvalue :
The vector converges in direction to the eigenvector of , provided the initial vector has a nonzero component in that direction. The rate determines speed. (If , the sign alternates between iterations — the direction converges, not the vector itself.)
** Algorithm for Eigenvalues**: initialize , then iterate: , . The sequence converges to Real Schur Form — block upper-triangular: real eigenvalues appear directly on the diagonal, while complex conjugate pairs are encoded in blocks. For real matrices with distinct real eigenvalues, convergence to upper triangular (eigenvalues on the diagonal) holds.
Interactive Visualization
Loading visualization
Worked Examples
Practice
Exercise 1 of 6
1
After factorization of , what is the matrix ?
★Quiz
Test your knowledge from this lesson
A mix of questions from the lesson — each attempt varies slightly
Answer at least 4 out of 5 questions correctly to pass (70%)