# Engineering Applications of Adaptive Kalman Filtering Based on Singular Value Decomposition (SVD)
## 3 Singular Value Decomposition
: _Using the matrix inversion lemma in the case where the inverse of a positive definite matrix \(A\) adds a rank-one matrix \(\mathrm{bb}^{T}\) yields:_  
\[\Big{(}A+bb^{T}\Big{)}^{-1}=A^{-1}-A^{-1}b\Big{(}1+b^{T}A^{-1}\Big{)}^{-1}b^{ \prime}A^{-1}, \tag{25}\]  
_where the superscript \(T\) denotes the complex conjugate transpose (or Hermitian) operation. It is well known in the literature that this formula is handy to develop a recursive least-squares algorithm for the recursive identification or design of an adaptive filter [21]._  
_The lemma on Equations (24) and (25) yields:_  
\[\Big{(}P_{k}^{+}\Big{)}^{-1}=P_{k}^{-1}+H_{k}^{T}R_{k}^{-1}H_{k}. \tag{26}\]  
Implementing the singular value decomposition of a symmetric positive definite matrix into \(P_{k+1}^{+}\) and \(P_{k}\) yields:  
\[\Big{(}U_{k}^{+}D_{k}^{+2}U_{k}^{+T}\Big{)}^{-1}=\Big{(}U_{k}D_{k}^{2}U_{k}^{T} \Big{)}^{-1}+H_{k}^{T}R_{k}^{-1}H_{k}, \tag{27}\]  
\[\Big{(}U_{k}^{+}D_{k}^{+2}U_{k}^{+T}\Big{)}^{-1}=\Big{(}U_{k}^{T}\Big{)}^{-1} \Big{(}D_{k}^{+2}+U_{k}^{T}H_{k}^{T}R_{k}^{-1}H_{k}U_{k}\Big{)}U_{k}^{-1}. \tag{28}\]To make the system adaptable to changes in sensor quality, the measurement noise is also estimated, which leads to a time-variant matrix. When the signal comes from different sensors, at each discrete time step \(k\) the noise covariance matrix is updated by appraising the standard deviation (std) of an arithmetically differentiated (diff) small-signal segment [14]:  
\[R_{k}=\left( \begin{array}{ccc}1&\ldots&0\\ \vdots&\ddots&0\\ 0&0&1\end{array} \right)*\sigma_{noise,k}^{i} \tag{29}\]  
\[\sigma_{noise,k}^{i}=\frac{std(diff(S_{i}))}{\sqrt{2}}. \tag{30}\]  
The adaptive computation of the KF and SVD-based (K-SVD) algorithm can be added independent of the SVD portion, as for some applications the measurement covariance matrix is known and can be pre-computed at the algorithm initiation. After computing Equations (29) and (30), let  
\[R_{k}^{-1}=L_{k}L_{k}^{T} \tag{31}\]  
be the Cholesky decomposition of the inverse of the covariance matrix. If covariance matrix \(R\) is known, but not the inverse, then the reverse Cholesky decomposition \(R^{1/2}R^{1/2T}=R_{0}\), \(R^{1/2}\)[8] upper triangular can be identified. It then follows that \(L_{k}=\left(R_{k}^{1/2T}\right)^{-1}\) is the necessary Cholesky decomposition [20] in Equation (31). Now, we consider the \((m+n)\times n\) matrix:  
\[\left[ \begin{array}{c}L_{k}^{T}H_{k}L_{k}\\ D_{k}^{-1}\end{array} \right], \tag{32}\]  
and compute its singular value decomposition:  
\[\underbrace{\left( \begin{array}{c}L_{k}^{T}H_{k}U_{k}\\ D_{k}^{-1}\end{array} \right)}_{Pre=array}=\underbrace{U_{k}^{T}\left( \begin{array} []{c}D_{k}^{*}\\ 0\end{array} \right)V_{k}^{*T}}_{Post-array}. \tag{33}\]  
Multiplying each term on the left by its transpose produces:  
\[D_{k}^{-2}+U_{k}^{T}H_{k}^{T}L_{k}^{T}H_{k}U_{k}=V_{k}^{*}D_{k}^{*2}V_{k}^{*T}. \tag{34}\]  
Then, Equation (28) can be written as follows:  
\[\left(U_{k}^{T}\right)^{-1}\!\!\left(D_{k}^{+}\right)^{-2}\!\!\left(U_{k}^{+} \right)^{-1}=\left(U_{k}^{T}\right)^{-1}\!\!V_{k}^{*}D_{k}^{*2}V_{k}^{*T}U_{k} ^{-1}, \tag{35}\]  
\[\left(U_{k}^{T}\right)^{-1}\!\!\left(D_{k}^{+}\right)^{-2}\!\!\left(U_{k}^{+} \right)^{-1}=\left[\left(U_{k}V_{k}^{*}\right)^{T}\right]^{-1}\!\!D_{k}^{*2} \!\!\left[U_{k}V_{k}^{*}\right]^{-1}. \tag{36}\]  
Comparing both sides of Equation (36):  
\[U_{k}^{+}=U_{k}V_{k}^{*}, \tag{37}\]  
\[D_{k}^{+}=\left(D_{k}^{*}\right)^{-1}. \tag{38}\]The update measurement formulation is obtained, which requires calculating the singular value decomposition of the nonsymmetrical matrix without specifically defining its left orthogonal component that has a larger dimension. The Kalman gain term can be derived as:  
\[K_{k}=P_{k}H_{k}^{T}\big{(}H_{k}P_{k}H_{k}^{T}+R_{k}\big{)}^{-1}. \tag{39}\]  
Inserting \(P_{k}^{+}\big{(}P_{k}^{+}\big{)}^{-1}\) and \((R_{k})^{-1}R_{k}\) will not alter the gain.