# Design of Adaptive Kalman Consensus Filters (a-KCF)
## 4 Adaptive Kalman Consensus Filtering
Furthermore, by examining the disagreement dynamics of Equation (23), it is proved to converge to zero in finite time._Proof. : The measurement of disagreement can be transformed into the following expression:  
\[ \begin{split}\delta_{i}(t)&=\hat{x}_{i}(t)-\mu(t)\\ &=\frac{1}{n}\bigg{(}nx\hat{x}_{i}(t)-\sum_{j=1}^{n}\hat{x}_{j}(t)+ nx(t)-nx(t)\bigg{)}\\ &=\frac{1}{n}\bigg{(}-ne_{i}(t)-\sum_{j=1}^{n}e_{j}(t)\bigg{)}\\ &=\frac{1}{n}\big{[}I\quad\cdots\quad-(n-1)I\quad\cdots\quad I \big{]}\mathbb{E}(t).\end{split}  \tag{24}\]  
Then, we can write the collective dynamics of \(\delta_{i}(t)\) as follows:  
\[\delta(t)= \begin{bmatrix}\delta_{1}(t)\\ \vdots\\ \delta_{n}(t)\end{bmatrix} =\frac{1}{n}\mathcal{L}\mathbb{E}(t);\qquad\text{ where}\quad\mathcal{L}= \begin{bmatrix}-(n-1)I&I&\cdots\\ \vdots&\ddots&\vdots\\ I&\cdots&-(n-1)I\end{bmatrix} . \tag{25}\]  
It can instantly be recognized that the convergence of \(\delta(t)\) is related to the convergence of \(\mathbb{E}(t)\). We have proved that \(\mathbb{E}(t)\) converges to zero in finite time; however, due to the zero eigenvalue of the matrix \(\mathcal{L}\), Equation (24) does not simply imply that \(\delta(t)\) converges to zero in finite time. Therefore, we need to find an alternate approach to prove this lemma. Let us define \(\hat{x}_{ij}=\hat{x}_{i}-\hat{x}_{j}\) as the estimate difference between the \(i\)th and the \(j\)th agents and denote \(e_{ij}=e_{i}-e_{j}\) as the estimation error difference between the \(i\)th and the \(j\)th agents. It is immediately clear that \(e_{ij}=\hat{x}_{ij}\). Now, we can rewrite Equation (23) into the following form:  
\[\delta_{i}(t)=\hat{x}_{i}-\frac{1}{n}\sum_{j=1}^{n}\hat{x}_{j}=\frac{1}{n}\sum _{j=1}^{n}(\hat{x}_{i}-\hat{x}_{j})=\frac{1}{n}\sum_{j=1}^{n}\hat{x}_{ij}= \frac{1}{n}\sum_{j=1}^{n}e_{ij}. \tag{26}\]  
From Equation (26), it can be argued that if we are able to prove the convergence of the dynamics of \(\hat{x}_{ij}\) or \(e_{ij}\) to zero in finite time, we can conclude that \(\delta_{i}\) converges to zero, as \(t\to\infty\). For simplification, consider the special case when \(\gamma_{ij}=\gamma_{i}\). According to Equation (5), we can find the dynamics of \(e_{ij}\) as follows:  
\[ \begin{split}\dot{e}_{ij}&=(A-K_{i}C_{i})e_{i}-(A- K_{i}C_{j})e_{j}+\gamma_{i}W_{i}\sum_{k\in N_{i}}(e_{k}-e_{i})-\gamma_{j}W_{j} \sum_{j\in N_{j}}(e_{l}-e_{j})\\ &=(A-K_{i}C_{i})e_{i}-(A-K_{j}C_{j})e_{j}+K_{i}C_{i}e_{j}-K_{i}C_{ i}e_{j}+\gamma_{i}W_{i}\sum_{k\in N_{i}}e_{ki}-\gamma_{j}W_{j}\sum_{l\in N_{j}}e_{lj} \\ &=(A-K_{i}C_{i})e_{ij}+(K_{j}C_{j}-K_{i}C_{i})e_{j}+\gamma_{i}W_{i} \sum_{k\in N_{i}}e_{ki}-\gamma_{j}W_{j}\sum_{j\in N_{j}}e_{lj}.\end{split}  \tag{27}\]  
In Section 4, we showed that \(A-K_{i}C_{i}\) generates an exponentially stable linear dynamic system for the \(i\)th agent, while both \(\gamma_{i}W_{i}\) and \(\gamma_{j}W_{j}\), along with \(K_{j}C_{j}-K_{i}C_{i}\), are bounded quantities. In the proof of Theorem 1, we concluded that \(\mathbb{E}\in L_{2}\cap L_{\infty}\); hence, \(e_{j}\in L_{2}\cap L_{\infty}\). To complete this proof, we need to prove that both \(e_{ki}\) and \(e_{lj}\) are \(L_{2}\) bounded. We now proceed to study the \(L_{2}\) norm of \(e_{ij}\), which is denoted as \(\int_{0}^{\infty}|e_{j}-e_{i}|^{2}d\tau\); then,  
\[ \begin{split}&\int_{0}^{\infty}|e_{ij}|^{2}d\tau=\int_{0}^{\infty}|e_{i }-e_{j}|^{2}d\tau\\ &=\int_{0}^{\infty}(e_{i}-e_{j})^{T}(e_{i}-e_{j})d\tau\\ &=\int_{0}^{\infty}(e_{i}^{T}e_{i}-e_{j}^{T}e_{i}-e_{i}^{T}e_{j}+ e_{j}^{T}e_{j})d\tau\\ &=\int_{0}^{\infty}|e_{j}|^{2}d\tau+\int_{0}^{\infty}|e_{i}|^{2}d \tau-\int_{0}^{\infty}(e_{j}^{T}e_{i}+e_{i}^{T}e_{j})d\tau\\ &\leq\int_{0}^{\infty}|e_{j}|^{2}d\tau+\int_{0}^{\infty}|e_{i}|^{2 }d\tau+\int_{0}^{\infty}|e_{j}^{T}e_{i}|+|e_{i}^{T}e_{j}|d\tau\\ &\leq\int_{0}^{\infty}|e_{j}|^{2}d\tau+\int_{0}^{\infty}|e_{i}|^{ 2}d\tau+\int_{0}^{\infty}\frac{|e_{j}|^{2}+|e_{i}|^{2}}{2}d\tau+\int_{0}^{ \infty}\frac{|e_{i}|^{2}+|e_{j}|^{2}}{2}d\tau\\ &\leq 2\int_{0}^{\infty}|e_{j}|^{2}d\tau+2\int_{0}^{\infty}|e_{i}|^{ 2}d\tau.\end{split}