Skip to content

Recursive Least Squares Filter

A sequential linear-model estimator that maintains least-squares matrix state and uses each new prediction error to update its coefficients.

Version
v2 · 2026-10-03 · History
Domain-specific #
13560
Aliases
RLS Filter, Recursive Least Squares Algorithm

Core Idea

A recursive least squares (RLS) filter updates a linear model's coefficients after each input–response observation while maintaining matrix information from earlier observations. The new prediction error is multiplied by a gain shaped by that matrix and input, and both coefficients and matrix state are corrected. Under declared initialization and ideal arithmetic, conventional updates follow a cumulative weighted squared-error objective without re-solving the entire past batch.[1][2]

How would you explain it like I'm…

The Learn-As-You-Go Guesser

Imagine you're learning to guess how far a ball will roll when you push it. Each time you push and watch, you check how wrong your guess was and fix your rule a little. A recursive least squares filter is a computer doing that: it improves its guessing rule with every new example, without starting over.

Learning Guesser That Updates

A recursive least squares filter is a method a computer uses to keep improving a prediction rule as new data comes in. Each time a new example arrives, it makes a prediction, sees how far off it was, and adjusts its rule. It also keeps a summary of everything it has seen so far, which tells it how big each adjustment should be. That way it never has to redo the whole calculation from scratch. It can also be set to slowly forget old data, which helps when things change over time.

Adaptive Least-Squares Updating

A recursive least squares (RLS) filter adapts the coefficients of a linear predictor as new input–output pairs arrive. Rather than re-solving a full least-squares problem after every sample, it keeps a current coefficient estimate and a matrix that summarizes the earlier data. For each new pair, it predicts the output, computes the error before updating (the a priori error), calculates a gain from the matrix and the current input, and uses it to update both the coefficients and the matrix. It minimizes total squared error, with older errors weighted equally or decaying exponentially through a forgetting factor. A forgetting factor below one helps track changing systems; exactly one means no forgetting.

 

A recursive least squares filter adaptively estimates the coefficients of a linear predictor from a stream of input–response pairs. Rather than solving a new batch least-squares problem after each sample, it maintains a coefficient estimate together with matrix information representing the accumulated prior data. For each new pair, it computes a prediction, forms the a priori error between the observed response and that prediction, calculates a gain vector shaped by the stored matrix and the current input, and then corrects both the coefficients and the matrix state. The underlying objective is a cumulative squared-error criterion, with historical errors weighted equally or decayed exponentially by a forgetting factor. A forgetting factor below one helps track changing systems, while a value of one is the valid no-forgetting case. The recurring identity is the relation linear residual → data-adaptive gain → coefficient and matrix correction. Specific inverse-matrix implementations, guaranteed superiority over LMS, and exactness under finite-precision arithmetic are not part of the definition; results hold subject to stated initialization and arithmetic assumptions.

Scope of Application

An adaptive FIR filter can estimate unknown taps from input windows and observed output; an online valve model can update gain and offset in its above-dead-band line-fit segment, not across its entire piecewise response. In both, a sequential linear residual, maintained least-squares state and gain-weighted correction fill the same roles. Forgetting factors below one can help track changing parameters, but \(\lambda=1\) is also a valid RLS setting.[3][4][2]

Clarity

RLS is not every recursive parameter update. Batch least squares lacks the sequential matrix update, LMS uses a gradient-style correction, and generic Bayesian filtering updates a posterior under a different model. “Exact” describes the specified algebraic objective under assumptions, not guaranteed finite-precision results or universally superior convergence.[1][2]

Manages Complexity

To recognize RLS, identify the linear prediction and new residual, the persistent inverse-correlation or equivalent factorized state, and the data-dependent gain correcting both coefficients and state. Only then examine tuning choices such as forgetting and numerical realization. This separates identity from tracking and speed claims.[1][2]

Abstract Reasoning

For real regressors, a common objective is \(J_t(w)=\sum_{i=1}^{t}\lambda^{t-i}(d_i-u_i^Tw)^2\) plus any declared initialization term, \(0<\lambda\leq1\). A conventional gain uses the prior matrix \(P_{t-1}\) and new regressor: \(k_t=P_{t-1}u_t/(\lambda+u_t^TP_{t-1}u_t)\). The coefficient update is \(w_t=w_{t-1}+k_t(d_t-u_t^Tw_{t-1})\), with a coupled matrix update. The gain therefore reflects accumulated input geometry, not one fixed learning rate.[1][2]

Knowledge Transfer

The regressor can be a FIR sample window or \([u(t),1]\) for the active line-fit segment of a valve response. These applications share the least-squares update relation but not a physical interpretation. Similar-looking Kalman gains or LMS error steps require their own objective and assumptions before they are treated as equivalent.[3][4][2]

Neighborhood in Abstraction Space

Recursive Least Squares Filter sits in a sparse region of the domain-specific corpus (74th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Statistical Learning & Model Failure Modes (44 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] MathWorks, “dsp.RLSFilter”, Algorithms and initialization, directly checked. ↩a ↩b ↩c ↩d

[2] MathWorks, “Recursive Algorithms for Online Parameter Estimation”, forgetting-factor and comparison equations, directly checked. ↩a ↩b ↩c ↩d ↩e ↩f

[3] MathWorks, “System Identification Using RLS Adaptive Filtering”, FIR worked example, directly checked. ↩a ↩b

[4] MathWorks, “Line Fitting with Online Recursive Least Squares Estimation”, valve model, directly checked. ↩a ↩b