Decompositions & applications

QR decomposition

QR decomposition factors a matrix A into A = Q*R, where Q has orthonormal columns (an orthogonal matrix: its columns are unit-length and mutually perpendicular) and R is upper-triangular. Think of it as the Gram-Schmidt process packaged neatly: Q holds the cleaned-up perpendicular directions, and R bookkeeps how the original columns were built from them.

Its claim to fame is least-squares fitting, the math behind fitting a line or curve to noisy data. Because Q's columns are orthonormal, they do not amplify rounding errors, which makes solving the least-squares problem far more numerically stable than forming and inverting other matrices directly.

In short, when you want a dependable answer to an over-determined problem (more equations than unknowns, no exact solution), QR is the standard tool engineers and statisticians reach for.

A = Q*R, Q^T*Q = I, R upper-triangular (e.g. fit y = m*x + c to noisy points)

Q's perpendicular columns make the least-squares fit numerically safe.

Because Q is orthogonal it preserves lengths and angles, so QR rarely amplifies error.

Also called
QR factorizationQR 分解QR 因式分解orthogonal-triangular decomposition正交-三角分解正交-三角分解