## 2 Unified Algorithm of Finite Memory Structure Filter and Smoother
 \right], \tag{7}\]  
where  
\[\bar{Q}\stackrel{{\triangle}}{{=}}\Big{[}\mbox{diag}(\overbrace {Q\;Q\;\cdots\;Q}^{M})\Big{]},\;\;\bar{R}\stackrel{{\triangle}}{{=}} \Big{[}\mbox{diag}(\overbrace{R\;R\;\cdots\;R}^{M})\Big{]}. \tag{8}\]  
Based on the approach of _best linear unbiased estimation_ in [25], the unified algorithm of FMS filter and smoother is derived using the following series of equations. The unified algorithm of FMS filter and smoother \(\hat{X}_{i}\) is assumed to be obtained from a matrix form using only finite measurements \(\bar{Z}_{i}\) and inputs \(U_{i}\) on the most recent window \([i-M,i]\) as follows:  
\[\hat{X}_{i}\;=\;\left[ \begin{array}{c}\hat{x}_{i}\\ \hat{x}_{i-d}\end{array} \right]\;\stackrel{{\triangle}}{{=}}\; \mathcal{H}\Big{(}\bar{Z}_{i}-\bar{\Xi}U_{i}\Big{)}, \tag{9}\]  
where \(\mathcal{H}\) is the unified gain matrix. When taking the expectation both sides of (9) as follows:  
\[\mathbf{E}\big{[}\hat{X}_{i}\big{]}=\mathbf{E}\left[ \begin{array}{c}\hat{x }_{i}\\ \hat{x}_{i-d}\end{array} \right]=\mathbf{E}\Big{[}\mathcal{H}\Big{(}\bar{Z}_{i}- \bar{\Xi}U_{i}\Big{)}\Big{]}=\mathcal{H}\bar{\Gamma}\mathbf{E}\big{[}X_{i} \big{]}, \tag{10}\]  
\(\hat{X}_{i}\) is unbiased, i.e., \(\mathbf{E}\big{[}\hat{X}_{i}\big{]}=\mathbf{E}\big{[}X_{i}\big{]}\), with the following constraint:  
\[\mathcal{H}\bar{\Gamma} = I. \tag{11}\]Thus, the constraint (11) can be called the _unbiasedness constraint_ for the unified algorithm of FMS filter and smoother \(\hat{X}_{i}\). Subject to the unbiasedness constraint (11), the objective is now to obtain the gain matrix \(\mathcal{H}_{*}\) in order that the error of \(\hat{X}_{i}\) has a minimum variance as follows:  
\[\mathcal{H}_{*}=\arg\min_{\mathcal{H}}\mathbf{E}\Big{[}(X_{i}- \hat{X}_{i})^{T}(X_{i}-\hat{X}_{i})\Big{]}. \tag{12}\]  
Then, by solving the optimization problem directly with incorporation of the unbiasedness constraint, the unified algorithm of FMS filter and smoother \(\hat{X}_{i}\) is obtained by the solution of (12) as follows:  
\[\hat{X}_{i}=\left[ \begin{array}{c}\hat{x}_{i}\\ \hat{x}_{i-d}\end{array} \right]=\mathcal{H}_{*}\left(\bar{Z}_{i}-\bar{\Xi}U_{ i}\right), \tag{13}\]  
where  
\[\mathcal{H}_{*} = \left(\bar{\Gamma}^{T}\Pi^{-1}\bar{\Gamma}\right)^{-1}\bar{ \Gamma}^{T}\Pi^{-1}. \tag{14}\]  
The proposed unified algorithm (13) of FMS filtering and smoothing shows that there are some unique properties such as unbiasedness, deadbeat, time-invariance and intrinsic robustness. The gain matrix \(\left(\bar{\Gamma}^{T}\Pi^{-1}\bar{\Gamma}\right)^{-1}\bar{\Gamma}^{T}\Pi^{-1}\) in (14) of the unified algorithm requires only once computation on the interval \([0,M]\) and then is used for all windows, which means the time-invariance property. As shown in (10) and (11), the unified algorithm has the unbiasedness property _by design_. In addition, the proposed unified algorithm \(\hat{X}_{i}\) in (13) for both the current state estimate \(\hat{x}_{i}\) and the lagged state estimate \(\hat{x}_{i-d}\) has the deadbeat property as following theorem. **Theorem 1**. : _When \(M\geq n\), the proposed unified algorithm of FMS filter and smoother \(\hat{X}_{i}\) on the most recent window \([i-M,i]\) is exact for noise-free systems._  
Proof of Theorem 1.: When there are no noises on the most recent window \([i-M,i]\) for the discrete-time state-space model (1), \(\bar{Z}_{i}-\bar{\Xi}U_{i}\) (6) is represented by  
\[\bar{Z}_{i}-\bar{\Xi}U_{i} = \bar{\Gamma}X_{i}=\bar{\Gamma}\left[ \begin{array}{c}x_{i}\\ x_{i-d}\end{array} \right].\]  
Hence, the following is satisfied:  
\[\hat{X}_{i}=\left[ \begin{array}{c}\hat{x}_{i}\\ \hat{x}_{i-d}\end{array} \right] = \left(\bar{\Gamma}^{T}\Pi^{-1}\bar{\Gamma}\right)^{-1}\bar{ \Gamma}^{T}\Pi^{-1}\Big{(}\bar{Z}_{i}-\bar{\Xi}U_{i}\Big{)}\] \[= \left(\bar{\Gamma}^{T}\Pi^{-1}\bar{\Gamma}\right)^{-1}\bar{\Gamma }^{T}\Pi^{-1}\bar{\Gamma}\left[ \begin{array}{c}x_{i}\\ x_{i-d}\end{array} \right]\] \[= \left[ \begin{array}{c}x_{i}\\ x_{i-d}\end{array} \right].\]  
This completes the proof of the deadbeat property.