- Source: Recursive least squares filter
Recursive least squares (RLS) is an adaptive filter algorithm that recursively finds the coefficients that minimize a weighted linear least squares cost function relating to the input signals. This approach is in contrast to other algorithms such as the least mean squares (LMS) that aim to reduce the mean square error. In the derivation of the RLS, the input signals are considered deterministic, while for the LMS and similar algorithms they are considered stochastic. Compared to most of its competitors, the RLS exhibits extremely fast convergence. However, this benefit comes at the cost of high computational complexity.
Motivation
RLS was discovered by Gauss but lay unused or ignored until 1950 when Plackett rediscovered the original work of Gauss from 1821. In general, the RLS can be used to solve any problem that can be solved by adaptive filters. For example, suppose that a signal
d
(
n
)
{\displaystyle d(n)}
is transmitted over an echoey, noisy channel that causes it to be received as
x
(
n
)
=
∑
k
=
0
q
b
n
(
k
)
d
(
n
−
k
)
+
v
(
n
)
{\displaystyle x(n)=\sum _{k=0}^{q}b_{n}(k)d(n-k)+v(n)}
where
v
(
n
)
{\displaystyle v(n)}
represents additive noise. The intent of the RLS filter is to recover the desired signal
d
(
n
)
{\displaystyle d(n)}
by use of a
p
+
1
{\displaystyle p+1}
-tap FIR filter,
w
{\displaystyle \mathbf {w} }
:
d
(
n
)
≈
∑
k
=
0
p
w
(
k
)
x
(
n
−
k
)
=
w
T
x
n
{\displaystyle d(n)\approx \sum _{k=0}^{p}w(k)x(n-k)=\mathbf {w} ^{\mathit {T}}\mathbf {x} _{n}}
where
x
n
=
[
x
(
n
)
x
(
n
−
1
)
…
x
(
n
−
p
)
]
T
{\displaystyle \mathbf {x} _{n}=[x(n)\quad x(n-1)\quad \ldots \quad x(n-p)]^{T}}
is the column vector containing the
p
+
1
{\displaystyle p+1}
most recent samples of
x
(
n
)
{\displaystyle x(n)}
. The estimate of the recovered desired signal is
d
^
(
n
)
=
∑
k
=
0
p
w
n
(
k
)
x
(
n
−
k
)
=
w
n
T
x
n
{\displaystyle {\hat {d}}(n)=\sum _{k=0}^{p}w_{n}(k)x(n-k)=\mathbf {w} _{n}^{\mathit {T}}\mathbf {x} _{n}}
The goal is to estimate the parameters of the filter
w
{\displaystyle \mathbf {w} }
, and at each time
n
{\displaystyle n}
we refer to the current estimate as
w
n
{\displaystyle \mathbf {w} _{n}}
and the adapted least-squares estimate by
w
n
+
1
{\displaystyle \mathbf {w} _{n+1}}
.
w
n
{\displaystyle \mathbf {w} _{n}}
is also a column vector, as shown below, and the transpose,
w
n
T
{\displaystyle \mathbf {w} _{n}^{\mathit {T}}}
, is a row vector. The matrix product
w
n
T
x
n
{\displaystyle \mathbf {w} _{n}^{\mathit {T}}\mathbf {x} _{n}}
(which is the dot product of
w
n
{\displaystyle \mathbf {w} _{n}}
and
x
n
{\displaystyle \mathbf {x} _{n}}
) is
d
^
(
n
)
{\displaystyle {\hat {d}}(n)}
, a scalar. The estimate is "good" if
d
^
(
n
)
−
d
(
n
)
{\displaystyle {\hat {d}}(n)-d(n)}
is small in magnitude in some least squares sense.
As time evolves, it is desired to avoid completely redoing the least squares algorithm to find the new estimate for
w
n
+
1
{\displaystyle \mathbf {w} _{n+1}}
, in terms of
w
n
{\displaystyle \mathbf {w} _{n}}
.
The benefit of the RLS algorithm is that there is no need to invert matrices, thereby saving computational cost. Another advantage is that it provides intuition behind such results as the Kalman filter.
Discussion
The idea behind RLS filters is to minimize a cost function
C
{\displaystyle C}
by appropriately selecting the filter coefficients
w
n
{\displaystyle \mathbf {w} _{n}}
, updating the filter as new data arrives. The error signal
e
(
n
)
{\displaystyle e(n)}
and desired signal
d
(
n
)
{\displaystyle d(n)}
are defined in the negative feedback diagram below:
The error implicitly depends on the filter coefficients through the estimate
d
^
(
n
)
{\displaystyle {\hat {d}}(n)}
:
e
(
n
)
=
d
(
n
)
−
d
^
(
n
)
{\displaystyle e(n)=d(n)-{\hat {d}}(n)}
The weighted least squares error function
C
{\displaystyle C}
—the cost function we desire to minimize—being a function of
e
(
n
)
{\displaystyle e(n)}
is therefore also dependent on the filter coefficients:
C
(
w
n
)
=
∑
i
=
0
n
λ
n
−
i
e
2
(
i
)
{\displaystyle C(\mathbf {w} _{n})=\sum _{i=0}^{n}\lambda ^{n-i}e^{2}(i)}
where
0
<
λ
≤
1
{\displaystyle 0<\lambda \leq 1}
is the "forgetting factor" which gives exponentially less weight to older error samples.
The cost function is minimized by taking the partial derivatives for all entries
k
{\displaystyle k}
of the coefficient vector
w
n
{\displaystyle \mathbf {w} _{n}}
and setting the results to zero
∂
C
(
w
n
)
∂
w
n
(
k
)
=
∑
i
=
0
n
2
λ
n
−
i
e
(
i
)
⋅
∂
e
(
i
)
∂
w
n
(
k
)
=
−
∑
i
=
0
n
2
λ
n
−
i
e
(
i
)
x
(
i
−
k
)
=
0
k
=
0
,
1
,
…
,
p
{\displaystyle {\frac {\partial C(\mathbf {w} _{n})}{\partial w_{n}(k)}}=\sum _{i=0}^{n}2\lambda ^{n-i}e(i)\cdot {\frac {\partial e(i)}{\partial w_{n}(k)}}=-\sum _{i=0}^{n}2\lambda ^{n-i}e(i)\,x(i-k)=0\qquad k=0,1,\ldots ,p}
Next, replace
e
(
n
)
{\displaystyle e(n)}
with the definition of the error signal
∑
i
=
0
n
λ
n
−
i
[
d
(
i
)
−
∑
ℓ
=
0
p
w
n
(
ℓ
)
x
(
i
−
ℓ
)
]
x
(
i
−
k
)
=
0
k
=
0
,
1
,
…
,
p
{\displaystyle \sum _{i=0}^{n}\lambda ^{n-i}\left[d(i)-\sum _{\ell =0}^{p}w_{n}(\ell )x(i-\ell )\right]x(i-k)=0\qquad k=0,1,\ldots ,p}
Rearranging the equation yields
∑
ℓ
=
0
p
w
n
(
ℓ
)
[
∑
i
=
0
n
λ
n
−
i
x
(
i
−
ℓ
)
x
(
i
−
k
)
]
=
∑
i
=
0
n
λ
n
−
i
d
(
i
)
x
(
i
−
k
)
k
=
0
,
1
,
…
,
p
{\displaystyle \sum _{\ell =0}^{p}w_{n}(\ell )\left[\sum _{i=0}^{n}\lambda ^{n-i}\,x(i-\ell )x(i-k)\right]=\sum _{i=0}^{n}\lambda ^{n-i}d(i)x(i-k)\qquad k=0,1,\ldots ,p}
This form can be expressed in terms of matrices
R
x
(
n
)
w
n
=
r
d
x
(
n
)
{\displaystyle \mathbf {R} _{x}(n)\,\mathbf {w} _{n}=\mathbf {r} _{dx}(n)}
where
R
x
(
n
)
{\displaystyle \mathbf {R} _{x}(n)}
is the weighted sample covariance matrix for
x
(
n
)
{\displaystyle x(n)}
, and
r
d
x
(
n
)
{\displaystyle \mathbf {r} _{dx}(n)}
is the equivalent estimate for the cross-covariance between
d
(
n
)
{\displaystyle d(n)}
and
x
(
n
)
{\displaystyle x(n)}
. Based on this expression we find the coefficients which minimize the cost function as
w
n
=
R
x
−
1
(
n
)
r
d
x
(
n
)
{\displaystyle \mathbf {w} _{n}=\mathbf {R} _{x}^{-1}(n)\,\mathbf {r} _{dx}(n)}
This is the main result of the discussion.
= Choosing λ
=The smaller
λ
{\displaystyle \lambda }
is, the smaller is the contribution of previous samples to the covariance matrix. This makes the filter more sensitive to recent samples, which means more fluctuations in the filter co-efficients. The
λ
=
1
{\displaystyle \lambda =1}
case is referred to as the growing window RLS algorithm. In practice,
λ
{\displaystyle \lambda }
is usually chosen between 0.98 and 1. By using type-II maximum likelihood estimation the optimal
λ
{\displaystyle \lambda }
can be estimated from a set of data.
Recursive algorithm
The discussion resulted in a single equation to determine a coefficient vector which minimizes the cost function. In this section we want to derive a recursive solution of the form
w
n
=
w
n
−
1
+
Δ
w
n
−
1
{\displaystyle \mathbf {w} _{n}=\mathbf {w} _{n-1}+\Delta \mathbf {w} _{n-1}}
where
Δ
w
n
−
1
{\displaystyle \Delta \mathbf {w} _{n-1}}
is a correction factor at time
n
−
1
{\displaystyle {n-1}}
. We start the derivation of the recursive algorithm by expressing the cross covariance
r
d
x
(
n
)
{\displaystyle \mathbf {r} _{dx}(n)}
in terms of
r
d
x
(
n
−
1
)
{\displaystyle \mathbf {r} _{dx}(n-1)}
where
x
(
i
)
{\displaystyle \mathbf {x} (i)}
is the
p
+
1
{\displaystyle {p+1}}
dimensional data vector
x
(
i
)
=
[
x
(
i
)
,
x
(
i
−
1
)
,
…
,
x
(
i
−
p
)
]
T
{\displaystyle \mathbf {x} (i)=[x(i),x(i-1),\dots ,x(i-p)]^{T}}
Similarly we express
R
x
(
n
)
{\displaystyle \mathbf {R} _{x}(n)}
in terms of
R
x
(
n
−
1
)
{\displaystyle \mathbf {R} _{x}(n-1)}
by
In order to generate the coefficient vector we are interested in the inverse of the deterministic auto-covariance matrix. For that task the Woodbury matrix identity comes in handy. With
The Woodbury matrix identity follows
To come in line with the standard literature, we define
where the gain vector
g
(
n
)
{\displaystyle g(n)}
is
Before we move on, it is necessary to bring
g
(
n
)
{\displaystyle \mathbf {g} (n)}
into another form
Subtracting the second term on the left side yields
With the recursive definition of
P
(
n
)
{\displaystyle \mathbf {P} (n)}
the desired form follows
g
(
n
)
=
P
(
n
)
x
(
n
)
{\displaystyle \mathbf {g} (n)=\mathbf {P} (n)\mathbf {x} (n)}
Now we are ready to complete the recursion. As discussed
The second step follows from the recursive definition of
r
d
x
(
n
)
{\displaystyle \mathbf {r} _{dx}(n)}
. Next we incorporate the recursive definition of
P
(
n
)
{\displaystyle \mathbf {P} (n)}
together with the alternate form of
g
(
n
)
{\displaystyle \mathbf {g} (n)}
and get
With
w
n
−
1
=
P
(
n
−
1
)
r
d
x
(
n
−
1
)
{\displaystyle \mathbf {w} _{n-1}=\mathbf {P} (n-1)\mathbf {r} _{dx}(n-1)}
we arrive at the update equation
where
α
(
n
)
=
d
(
n
)
−
x
T
(
n
)
w
n
−
1
{\displaystyle \alpha (n)=d(n)-\mathbf {x} ^{T}(n)\mathbf {w} _{n-1}}
is the a priori error. Compare this with the a posteriori error; the error calculated after the filter is updated:
e
(
n
)
=
d
(
n
)
−
x
T
(
n
)
w
n
{\displaystyle e(n)=d(n)-\mathbf {x} ^{T}(n)\mathbf {w} _{n}}
That means we found the correction factor
Δ
w
n
−
1
=
g
(
n
)
α
(
n
)
{\displaystyle \Delta \mathbf {w} _{n-1}=\mathbf {g} (n)\alpha (n)}
This intuitively satisfying result indicates that the correction factor is directly proportional to both the error and the gain vector, which controls how much sensitivity is desired, through the weighting factor,
λ
{\displaystyle \lambda }
.
RLS algorithm summary
The RLS algorithm for a p-th order RLS filter can be summarized as
The recursion for
P
{\displaystyle P}
follows an algebraic Riccati equation and thus draws parallels to the Kalman filter.
Lattice recursive least squares filter (LRLS)
The lattice recursive least squares adaptive filter is related to the standard RLS except that it requires fewer arithmetic operations (order N). It offers additional advantages over conventional LMS algorithms such as faster convergence rates, modular structure, and insensitivity to variations in eigenvalue spread of the input correlation matrix. The LRLS algorithm described is based on a posteriori errors and includes the normalized form. The derivation is similar to the standard RLS algorithm and is based on the definition of
d
(
k
)
{\displaystyle d(k)\,\!}
. In the forward prediction case, we have
d
(
k
)
=
x
(
k
)
{\displaystyle d(k)=x(k)\,\!}
with the input signal
x
(
k
−
1
)
{\displaystyle x(k-1)\,\!}
as the most up to date sample. The backward prediction case is
d
(
k
)
=
x
(
k
−
i
−
1
)
{\displaystyle d(k)=x(k-i-1)\,\!}
, where i is the index of the sample in the past we want to predict, and the input signal
x
(
k
)
{\displaystyle x(k)\,\!}
is the most recent sample.
= Parameter summary
=κ
f
(
k
,
i
)
{\displaystyle \kappa _{f}(k,i)\,\!}
is the forward reflection coefficient
κ
b
(
k
,
i
)
{\displaystyle \kappa _{b}(k,i)\,\!}
is the backward reflection coefficient
e
f
(
k
,
i
)
{\displaystyle e_{f}(k,i)\,\!}
represents the instantaneous a posteriori forward prediction error
e
b
(
k
,
i
)
{\displaystyle e_{b}(k,i)\,\!}
represents the instantaneous a posteriori backward prediction error
ξ
b
min
d
(
k
,
i
)
{\displaystyle \xi _{b_{\min }}^{d}(k,i)\,\!}
is the minimum least-squares backward prediction error
ξ
f
min
d
(
k
,
i
)
{\displaystyle \xi _{f_{\min }}^{d}(k,i)\,\!}
is the minimum least-squares forward prediction error
γ
(
k
,
i
)
{\displaystyle \gamma (k,i)\,\!}
is a conversion factor between a priori and a posteriori errors
v
i
(
k
)
{\displaystyle v_{i}(k)\,\!}
are the feedforward multiplier coefficients.
ε
{\displaystyle \varepsilon \,\!}
is a small positive constant that can be 0.01
= LRLS algorithm summary
=The algorithm for a LRLS filter can be summarized as
Normalized lattice recursive least squares filter (NLRLS)
The normalized form of the LRLS has fewer recursions and variables. It can be calculated by applying a normalization to the internal variables of the algorithm which will keep their magnitude bounded by one. This is generally not used in real-time applications because of the number of division and square-root operations which comes with a high computational load.
= NLRLS algorithm summary
=The algorithm for a NLRLS filter can be summarized as
See also
Adaptive filter
Kernel adaptive filter
Least mean squares filter
Zero-forcing equalizer
References
Hayes, Monson H. (1996). "9.4: Recursive Least Squares". Statistical Digital Signal Processing and Modeling. Wiley. p. 541. ISBN 0-471-59431-8.
Simon Haykin, Adaptive Filter Theory, Prentice Hall, 2002, ISBN 0-13-048434-2
M.H.A Davis, R.B. Vinter, Stochastic Modelling and Control, Springer, 1985, ISBN 0-412-16200-8
Weifeng Liu, Jose Principe and Simon Haykin, Kernel Adaptive Filtering: A Comprehensive Introduction, John Wiley, 2010, ISBN 0-470-44753-2
R.L.Plackett, Some Theorems in Least Squares, Biometrika, 1950, 37, 149–157, ISSN 0006-3444
C.F.Gauss, Theoria combinationis observationum erroribus minimis obnoxiae, 1821, Werke, 4. Gottinge
Notes
Kata Kunci Pencarian:
- Pemelajaran mesin daring
- Recursive least squares filter
- Least mean squares filter
- Kalman filter
- Adaptive equalizer
- Kernel adaptive filter
- RLS
- 2D adaptive filters
- Minimum mean square error
- Adaptive filter
- Ensemble Kalman filter