Inferensys

Glossary

Recursive Least Squares (RLS)

An adaptive filtering algorithm that recursively finds the filter 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 ALGORITHM

What is Recursive Least Squares (RLS)?

An adaptive filtering algorithm that recursively finds the filter 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 algorithm that recursively updates filter coefficients to minimize a weighted linear least squares cost function of the error signal. Unlike gradient-descent methods, RLS computes the exact minimizer of the deterministic normal equations at each iteration, leveraging all available input data from the initialization point to the current sample.

The algorithm achieves significantly faster convergence than the Least Mean Squares (LMS) algorithm, particularly for highly correlated input signals, by maintaining and updating an inverse correlation matrix. This superior tracking performance comes at the expense of O(N²) computational complexity per iteration, where N is the filter length, making it suitable for applications like fast channel estimation where rapid adaptation is critical.

ADAPTIVE FILTERING ALGORITHMS

RLS vs. LMS: A Technical Comparison

A direct technical comparison of Recursive Least Squares and Least Mean Squares for channel estimation and equalization tasks.

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

Cost Function

Weighted least squares sum

Instantaneous squared error

Instantaneous squared error with normalized step size

Convergence Speed

Fast (order of 2N iterations)

Slow (order of 10N iterations)

Moderate (order of 5N iterations)

Computational Complexity per Iteration

O(N²)

O(N)

O(N)

Memory Requirement

O(N²) for inverse correlation matrix

O(N) for weight vector only

O(N) for weight vector only

Sensitivity to Eigenvalue Spread

Insensitive

Highly sensitive

Reduced sensitivity

Steady-State Misadjustment

Low

Higher

Moderate

Numerical Stability

Prone to instability with finite precision

Stable

Stable

Tracking of Non-Stationary Channels

Excellent with appropriate forgetting factor

Adequate

Adequate

ALGORITHM FUNDAMENTALS

Core Properties of RLS

The defining characteristics that distinguish the Recursive Least Squares algorithm from simpler gradient-based adaptive filters, making it suitable for fast-converging channel compensation tasks.

01

Weighted Least Squares Cost Function

RLS minimizes a deterministic cost function consisting of the exponentially weighted sum of squared errors. Unlike LMS, which minimizes the instantaneous squared error, RLS considers all past errors from the moment the algorithm was initialized. The forgetting factor (λ), typically between 0.95 and 0.999, assigns exponentially less weight to older data, enabling the filter to track time-varying channel statistics. This formulation provides the exact least squares solution for the finite data record available at each time step.

0.95–0.999
Typical Forgetting Factor Range
02

Recursive Inverse Covariance Update

The computational core of RLS is the recursive update of the inverse of the input signal's autocorrelation matrix. Using the Woodbury matrix identity (also known as the matrix inversion lemma), RLS avoids explicitly inverting a large matrix at each iteration. Instead, it computes a rank-1 update to the inverse correlation matrix with O(N²) complexity, where N is the filter length. This recursive formulation is what gives the algorithm its name and enables its fast convergence properties.

03

Kalman Gain Vector

At each iteration, RLS computes a Kalman gain vector that determines the optimal step size for updating filter coefficients. This gain vector is data-dependent and adjusts automatically based on the statistical properties of the input signal. Unlike the fixed step-size parameter in LMS, the Kalman gain provides an optimal variable learning rate for each filter tap, ensuring rapid convergence without manual tuning. The gain vector is computed from the inverse correlation matrix and the current input regressor.

04

Convergence Rate Independence

A critical property of RLS is that its convergence rate is independent of the eigenvalue spread of the input signal's autocorrelation matrix. In LMS, a wide eigenvalue spread—common in signals with strong spectral dynamics—causes dramatically slow convergence. RLS whitens the input data implicitly through its inverse correlation matrix, achieving convergence within approximately 2N iterations, where N is the filter order. This makes RLS ideal for channel estimation in frequency-selective fading environments.

~2N
Iterations to Convergence
05

Computational Complexity Trade-off

The superior convergence performance of RLS comes at a significant computational cost. Standard RLS requires O(N²) operations per iteration due to the matrix-vector multiplications in the gain vector and inverse correlation matrix updates. In contrast, LMS requires only O(N) operations. For a 32-tap equalizer, RLS may require over 1,000 multiply-accumulate operations per sample. Fast RLS variants, such as the QR-decomposition-based RLS and lattice RLS, reduce complexity to O(N) while preserving numerical stability.

O(N²)
Standard RLS Complexity
O(N)
Fast RLS Variant Complexity
06

Numerical Stability and Regularization

RLS is susceptible to numerical instability due to the accumulation of round-off errors in the recursive inverse correlation matrix update. The matrix may lose symmetry or positive definiteness over time, causing algorithm divergence. To mitigate this, regularization is applied by initializing the inverse correlation matrix as δ⁻¹I, where δ is a small positive constant. Additionally, square-root formulations—such as QR-RLS—propagate the Cholesky factor of the inverse correlation matrix, guaranteeing positive definiteness and improving numerical robustness in fixed-point implementations.

RECURSIVE LEAST SQUARES

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the Recursive Least Squares algorithm and its role in adaptive filtering and channel compensation.

The Recursive Least Squares (RLS) algorithm is an adaptive filtering technique that recursively computes the filter coefficients which minimize a weighted linear least squares cost function of the error signal. Unlike the simpler Least Mean Squares (LMS) algorithm, which uses a stochastic gradient descent based on the instantaneous error, RLS considers all past input data from the moment the algorithm was initialized. It achieves this by recursively updating the inverse of the input signal's autocorrelation matrix, effectively whitening the input data. This provides RLS with an order-of-magnitude faster convergence speed compared to LMS, making it highly effective in non-stationary environments where the underlying statistics change rapidly. The trade-off is a significantly higher computational complexity, scaling with O(N^2) arithmetic operations per iteration, where N is the filter length.

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.