QR Decomposition Calculator
Factor any matrix into orthogonal (Q) and upper triangular (R) matrices using the QR decomposition
Matrix Input
Enter Matrix Elements
QR Decomposition: A = QR
Q Matrix (Orthogonal)
R Matrix (Upper Triangular)
Matrix Properties
Verification: QR = A
Maximum reconstruction error: 0.00e+0
Example Calculation
Input Matrix A
Consider the 3×2 matrix:
[3 4]
[5 6]
QR Decomposition Process
1. Apply Gram-Schmidt orthogonalization to columns
2. Normalize vectors to get orthogonal matrix Q
3. Calculate R = QTA (upper triangular)
4. Verify: A = QR
QR Decomposition Properties
Orthogonal Matrix
QTQ = I
Columns are orthonormal
Upper Triangular
Rij = 0 for i > j
Zero below diagonal
Decomposition
A = QR
Always exists for any matrix
Applications
Solving linear systems Ax = b
Least squares regression
Eigenvalue computation (QR algorithm)
Gram-Schmidt orthogonalization
Signal processing and data analysis
Understanding QR Decomposition
What is QR Decomposition?
QR decomposition factors a matrix A into the product of an orthogonal matrix Q and an upper triangular matrix R. For any m×n matrix A (where m ≥ n), we can write A = QR.
Key Properties
- •Q matrix: Orthogonal columns (QTQ = I)
- •R matrix: Upper triangular (zeros below diagonal)
- •Existence: Every matrix has a QR decomposition
- •Uniqueness: Unique if A has full rank and R diagonal is positive
Gram-Schmidt Method
Step 1: Start with matrix columns a₁, a₂, ..., aₙ
Step 2: Orthogonalize using projections
Step 3: Normalize to get orthonormal vectors
Step 4: Form Q from orthonormal vectors, compute R = QTA
Why Use QR Decomposition?
- •Numerically stable for solving linear systems
- •Efficient for least squares problems
- •Foundation for eigenvalue algorithms