Inferensys

Glossary

Recursive Least Squares (RLS)

An adaptive filtering algorithm that recursively finds the coefficients minimizing a weighted linear least squares cost function, offering faster convergence than LMS at the cost of higher computational complexity.
Developer reviewing LLM cost optimization spreadsheet on laptop, calculator and coffee on desk, casual finance-technical moment.
ADAPTIVE FILTERING

What is Recursive Least Squares (RLS)?

An adaptive algorithm that recursively finds the coefficients minimizing a weighted linear least squares cost function, offering faster convergence than LMS at the cost of higher computational complexity.

Recursive Least Squares (RLS) is an adaptive filtering algorithm that recursively updates coefficient estimates to minimize a weighted linear least squares cost function. Unlike gradient-based methods, RLS computes the exact solution to the least-squares problem at each iteration by recursively updating the inverse of the input signal's correlation matrix, resulting in an order-of-magnitude faster convergence rate than the Least Mean Squares (LMS) algorithm.

The algorithm's rapid convergence is achieved through a forgetting factor (λ), which exponentially discounts older data to track non-stationary systems like a power amplifier's changing thermal characteristics. This computational advantage comes at the cost of O(N²) complexity per iteration due to the required matrix inversion, making RLS significantly more demanding on FPGA resources than simpler stochastic gradient methods, though numerically stable implementations using QR decomposition mitigate ill-conditioning in fixed-point hardware.

ALGORITHM CHARACTERISTICS

Key Features of RLS

Recursive Least Squares (RLS) is defined by a set of distinct mathematical properties that differentiate it from simpler gradient-based algorithms like LMS. These features dictate its suitability for high-performance Digital Pre-Distortion (DPD) applications where rapid tracking of power amplifier nonlinearities is critical.

01

Exponential Forgetting Factor

The forgetting factor (λ, typically 0.95 < λ < 0.999) is a weighting parameter that exponentially discounts the influence of older data on the current coefficient estimate. This mechanism is essential for tracking non-stationary environments, such as a power amplifier whose characteristics drift due to thermal memory effects or changing signal statistics.

  • A smaller λ provides faster tracking but increases steady-state misadjustment.
  • A λ closer to 1 yields better steady-state performance but slower adaptation to change.
  • The effective memory of the algorithm is approximately 1/(1-λ) samples.
1/(1-λ)
Effective Memory Window
02

Direct Matrix Inversion Avoidance

RLS recursively updates the inverse of the correlation matrix using the Matrix Inversion Lemma (Woodbury matrix identity), avoiding the O(N³) computational cost of direct inversion at each iteration. This recursive formulation reduces the per-iteration complexity to O(N²), where N is the number of basis function coefficients.

  • The gain vector is computed by applying the existing inverse matrix to the new data vector.
  • This enables real-time coefficient updates in closed-loop DPD systems without block-based processing delays.
03

Optimal Convergence Rate

Unlike LMS, whose convergence is governed by the eigenvalue spread of the input correlation matrix, RLS converges at a rate independent of the input signal's statistical conditioning. This is because RLS effectively whitens the input data by inverting the correlation matrix.

  • RLS typically converges in approximately 2N iterations, where N is the filter order.
  • This is orders of magnitude faster than LMS for signals with high eigenvalue disparity.
  • Critical for DPD applications where the predistorter must lock rapidly after a change in carrier frequency or average power.
04

Regularization for Numerical Stability

A regularization parameter (δ) is added to the diagonal of the initial correlation matrix estimate to prevent ill-conditioning during the early stages of adaptation or during periods of low input excitation. This is mathematically equivalent to initializing the inverse correlation matrix as P(0) = δ⁻¹I.

  • Prevents large coefficient transients at startup.
  • Mitigates the effects of finite-precision arithmetic in fixed-point FPGA implementations.
  • A typical value for δ is a small positive constant relative to the signal power.
05

Weighted Least Squares Cost Function

RLS minimizes a weighted sum of squared errors over all past observations, rather than the instantaneous squared error used by LMS. The cost function is: J(n) = Σᵢ₌₁ⁿ λⁿ⁻ⁱ |e(i)|² where e(i) is the error signal at time i. This deterministic, batch-like objective gives RLS its superior steady-state performance and immunity to gradient noise.

  • Produces the exact least-squares solution for stationary signals when λ=1.
  • The recursive formulation computes this sum without storing the entire history.
06

Computational Complexity Trade-off

The primary drawback of RLS is its O(N²) computational complexity per iteration, compared to O(N) for LMS. For a DPD system with hundreds of basis function coefficients, this can strain real-time processing budgets.

  • Fast RLS variants (e.g., lattice-based, QR-decomposition RLS) reduce complexity to O(N) while preserving convergence properties.
  • QR-RLS is particularly valued in DPD for its superior numerical stability in fixed-point hardware.
  • The choice between RLS and LMS variants is a direct trade-off between convergence speed and implementation cost.
ADAPTIVE FILTER ALGORITHM SELECTION

RLS vs. LMS: A Technical Comparison

A detailed comparison of Recursive Least Squares (RLS) and Least Mean Squares (LMS) for online coefficient estimation in digital predistortion systems.

FeatureRecursive Least Squares (RLS)Least Mean Squares (LMS)Normalized LMS (NLMS)

Optimization Criterion

Weighted least squares (minimizes sum of squared errors over all time)

Stochastic gradient descent (minimizes instantaneous squared error)

Stochastic gradient descent with input-normalized step size

Convergence Rate

Fast (typically < 50 iterations)

Slow (100-1000+ iterations)

Moderate (50-200 iterations)

Computational Complexity per Iteration

O(N²) where N is number of coefficients

O(N)

O(N)

Memory Requirement

High (stores N×N correlation matrix)

Low (stores coefficient vector only)

Low (stores coefficient vector plus input power estimate)

Steady-State Misadjustment

Low (asymptotically zero for stationary signals)

Non-zero (proportional to step size)

Non-zero (proportional to normalized step size)

Tracking of Non-Stationary Systems

Excellent with tuned forgetting factor

Good with fixed step size

Good with adaptive step size

Numerical Stability on Fixed-Point Hardware

Sensitivity to Ill-Conditioned Inputs

High (requires regularization parameter)

Low (inherently robust)

Low (normalization mitigates eigenvalue spread)

RLS IN DEPTH

Frequently Asked Questions

Explore the mechanics, trade-offs, and implementation details of the Recursive Least Squares algorithm for adaptive digital predistortion.

The Recursive Least Squares (RLS) algorithm is an adaptive filter that recursively finds the coefficients minimizing a weighted linear least squares cost function. Unlike gradient-descent methods like LMS, RLS computes the exact solution to the least-squares problem at each iteration by recursively updating the inverse of the input signal's correlation matrix. It works by maintaining an estimate of the inverse correlation matrix, P(n), and a weight vector, w(n). At each time step n, it computes a gain vector k(n) = P(n-1)u(n) / (λ + u^H(n)P(n-1)u(n)), where u(n) is the input regressor vector and λ is the forgetting factor. The weights are then updated using the a priori estimation error: w(n) = w(n-1) + k(n)ξ*(n). Finally, the inverse correlation matrix is updated: P(n) = λ⁻¹[P(n-1) - k(n)u^H(n)P(n-1)]. This exact minimization provides an order-of-magnitude faster convergence rate than LMS, making it ideal for tracking rapid changes in power amplifier nonlinearity.

Prasad Kumkar

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.