QR Decomposition (QRD) is a matrix factorization that expresses a matrix A as the product of an orthogonal matrix Q and an upper triangular matrix R (A = QR). This decomposition is a cornerstone of numerical linear algebra, providing a numerically stable method for solving linear least squares problems without explicitly forming the normal equations, which squares the condition number and amplifies rounding errors.
Glossary
QR Decomposition (QRD)

What is QR Decomposition (QRD)?
QR Decomposition is a matrix factorization technique that decomposes a matrix into an orthogonal matrix Q and an upper triangular matrix R, used to solve linear least squares problems with high numerical stability.
In adaptive filtering and Digital Pre-Distortion (DPD) coefficient estimation, QRD is implemented recursively via Givens rotations to update the triangular factor R directly. This approach avoids the numerical instability of the Recursive Least Squares (RLS) algorithm when processing highly correlated input signals, making it the preferred method for real-time parameter extraction in embedded systems where precision is critical.
Key Properties of QR Decomposition
QR Decomposition (QRD) factorizes a matrix A into an orthogonal matrix Q and an upper triangular matrix R. This structure provides a numerically stable foundation for solving linear least squares problems, making it a cornerstone algorithm for coefficient estimation in digital predistortion systems.
Numerical Stability via Orthogonalization
Unlike solving the Normal Equation directly, QRD avoids squaring the condition number of the data matrix. By operating on the original matrix A using orthogonal transformations, it prevents the amplification of rounding errors. This is critical for ill-conditioned correlation matrices common in wideband DPD where signal bandwidths are large and memory depth is high.
- Condition Number Preservation: The condition number of R equals that of A.
- No Explicit Matrix Inversion: The upper triangular structure of R allows solution via simple back-substitution.
Solving the Least Squares Problem
QR decomposition transforms the overdetermined system Ax ≈ b into an equivalent, easily solvable form. By applying the transpose of Q to both sides, the problem reduces to solving Rx = Qᵀb. Since R is upper triangular, the optimal coefficient vector x is found through efficient back-substitution.
- Minimizes ||Ax - b||²: Directly solves the minimization problem without forming the normal equations.
- Residual Analysis: The bottom rows of Qᵀb directly provide the least squares residual norm.
Computation via Householder Reflections
The most common method for computing QRD in practice uses Householder reflections. These are elementary orthogonal transformations that zero out all elements below the diagonal of a column vector in a single step. This method is preferred over Gram-Schmidt for its superior numerical stability on finite-precision hardware.
- Block Operations: Householder vectors can be aggregated to apply transformations in matrix-matrix operations, maximizing cache efficiency on DSPs.
- Compact Storage: The reflection vectors can be stored in the lower triangular part of the original matrix, saving memory.
Givens Rotations for Adaptive Updates
Givens rotations provide an alternative method for computing QRD by zeroing out matrix elements one at a time. While less efficient for batch computation, they are the fundamental building block for the QR-RLS adaptive algorithm. Givens rotations allow the triangular factor R to be updated directly when new data rows arrive, without recomputing the entire decomposition.
- Selective Zeroing: Targets specific matrix elements for elimination.
- Pipelined Hardware: The regular, rotation-based structure is highly amenable to systolic array implementation on FPGAs.
Relationship to the Gram Matrix
The upper triangular matrix R in QRD is mathematically equivalent to the Cholesky factor of the Gram matrix AᵀA. This connection reveals why QRD is superior: it computes the Cholesky factor directly from A without explicitly forming the product AᵀA, an operation that squares the condition number and introduces numerical instability.
- AᵀA = RᵀR: The Gram matrix is the product of the transpose of R and R.
- Square-Root Algorithm: QRD is often called a "square-root" method because it works on the data matrix directly, analogous to taking the square root of the correlation matrix.
Rank Revelation and Regularization
Column pivoting can be integrated into the QRD process to handle rank-deficient or near-rank-deficient matrices. By reordering columns based on their norm, the algorithm produces a factorization where the diagonal elements of R are non-increasing. This reveals the numerical rank and allows for effective regularization by truncating small diagonal elements, preventing overfitting in coefficient extraction.
- Diagonal Inspection: The magnitude of diagonal entries of R indicates linear independence of basis functions.
- Truncated SVD Alternative: Provides a computationally cheaper alternative to full SVD for regularization.
QR Decomposition vs. Normal Equations for Least Squares
A comparison of two methods for solving the linear least squares problem for DPD coefficient extraction, highlighting trade-offs in numerical stability, computational cost, and conditioning.
| Feature | QR Decomposition | Normal Equations | SVD |
|---|---|---|---|
Methodology | Factorizes design matrix A into orthogonal Q and upper triangular R; solves Rx = Qᵀb | Solves AᵀAx = Aᵀb directly by forming and inverting the Gram matrix | Factorizes A into UΣVᵀ; solves using pseudoinverse |
Squares Condition Number | κ(A) | κ(A)² | κ(A) |
Numerical Stability | High | Low | Very High |
Handles Rank Deficiency | |||
Operation Count (m×n) | ~2mn² flops | ~mn² + n³/3 flops | ~4mn² + 8n³ flops |
Susceptibility to Round-off Error | Low | High | Very Low |
Preferred for Ill-Conditioned Matrices | |||
Typical DPD Application | Standard batch extraction with moderate condition numbers | Rapid prototyping; avoided in production | Diagnosing ill-conditioning and rank deficiency |
Frequently Asked Questions
Explore the core mechanics and practical applications of QR decomposition in solving linear least squares problems for digital predistortion coefficient estimation.
QR decomposition (QRD) is a matrix factorization technique that decomposes a matrix A into the product of an orthogonal matrix Q and an upper triangular matrix R. The 'orthogonal' property of Q means its transpose equals its inverse, which preserves the Euclidean norm of vectors. The algorithm works by applying a sequence of orthogonal transformations—typically Householder reflections or Givens rotations—to systematically zero out the elements below the main diagonal of A. This process effectively isolates the triangular structure in R while capturing the transformation history in Q. For a system Ax = b, this factorization allows the least squares solution to be computed by solving the triangular system Rx = Qᵀb via simple back-substitution, avoiding the numerical instability of directly inverting the normal equations.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
QR Decomposition is a foundational numerical tool in digital predistortion. The following concepts are essential for understanding its application in solving least squares problems for coefficient estimation.
Condition Number
The ratio of the largest to smallest singular value of a matrix, denoted κ(A) = σₘₐₓ / σₘᵢₙ. It quantifies how sensitive the solution of a linear system is to perturbations in the input data. In DPD coefficient estimation:
- κ ≈ 1: Well-conditioned, stable solution
- κ > 10⁴: Ill-conditioned, small measurement noise causes large coefficient errors QR decomposition with column pivoting helps mitigate ill-conditioning by reordering columns to keep R well-conditioned.
Normal Equation
The closed-form solution w = (XᵀX)⁻¹Xᵀy to the linear least squares problem. While conceptually simple, solving via the normal equation squares the condition number: κ(XᵀX) = κ(X)². This makes it dangerously unstable for DPD applications where data matrices are often ill-conditioned. QR decomposition avoids this squaring effect by operating directly on X, making it the standard approach for production DPD coefficient extraction.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us