QR Decomposition Calculator

A = QR factorization

CalculatorsFreeNo Signup
4.7(456 reviews)
All Tools

Loading tool...

About QR Decomposition Calculator

A QR decomposition calculator that factors A = QR where Q is orthogonal (QᵀQ = I) and R is upper triangular. Uses classical Gram-Schmidt orthonormalization. Shows Q and R matrices. Verify QR = A and QᵀQ = I. Select from preset matrices. All calculations are client-side. Foundation for QR algorithm (eigenvalues).

QR Decomposition Calculator Features

  • Q & R factors
  • Orthogonality
  • Verify QR
  • Gram-Schmidt
  • Presets
QR decomposition: A = QR, Q orthogonal (QᵀQ = I), R upper triangular. Computed via Gram-Schmidt: orthonormalize columns of A. rᵢⱼ = qᵢᵀaⱼ. Foundation of the QR algorithm for eigenvalues. Numerically stable least squares via QRx = Qᵀb.

How to Use

Enter a matrix:

  • A: m×n matrix
  • Q: Orthogonal columns
  • R: Upper triangular

Applications

  • Least squares: Rx = Qᵀb (no AᵀA needed)
  • QR algorithm: eigenvalues via repeated QR
  • Numerical stability: better than normal equations

vs LU

LU: faster (n³/3 vs 2n³/3) but less stable. QR: numerically superior, works for non-square matrices, gives orthogonal basis. Use QR for least squares, LU for square system solving.

Step-by-Step Instructions

  1. 1Select a matrix.
  2. 2View Q (orthogonal).
  3. 3View R (upper tri).
  4. 4Verify QR = A.
  5. 5Verify QᵀQ = I.

QR Decomposition Calculator — Frequently Asked Questions

Why is QR better than normal equations for least squares?+

Normal equations form AᵀA which squares the condition number (κ² instead of κ). QR avoids this: solve Rx = Qᵀb directly. For ill-conditioned A, normal equations lose half the digits; QR preserves them.

What is the QR algorithm?+

Iterate: Aₖ = QₖRₖ, then Aₖ₊₁ = RₖQₖ. This sequence converges to an upper triangular matrix whose diagonal = eigenvalues. The standard algorithm for computing all eigenvalues of a matrix.

Modified vs Classical Gram-Schmidt?+

Classical: projects against all original vectors (numerically unstable). Modified: projects against already-orthogonalized vectors (much more stable). Householder reflections are even better: O(2mn²−2n³/3) operations, perfect orthogonality.

Share this tool: