# Recursive Optimal Finite Impulse Response Filter and Its Application to Adaptive Estimation
## 2 Recursive Optimal FIR Filter and Adaptive FIR Filter  
### Recursive Optimal FIR Filter with Optimally Estimated Initial Conditions  
Consider the following discrete time-varying state-space model:  
\[x_{k+1} = A_{k}x_{k}+w_{k}, \tag{1}\] \[y_{k} = C_{k}x_{k}+v_{k}, \tag{2}\]  
where \(x_{k}\) is the state vector, \(y_{k}\) is the measurement, \(w_{k}\) and \(v_{k}\) are the process noise and measurement noise, respectivley. We assume that \(w_{k}\) and \(v_{k}\) are zero-mean white Gaussian and mutually uncorrelated. These noises are uncorrelated with the initial state \(x_{k_{0}}\) and \(Q_{k}\) and \(R_{k}\) denote the covariance matrices of \(w_{k}\) and \(v_{k}\), respectively. The pair \((A_{k},C_{k})\) of the system (1) and (2) is assumed to be observable so that all modes are observed at the output and stabilized observers can be constructed. On the horizon \([k-N\;\;k]\), the finite number of measurements is expressed as a batch form as follows:  
\[Y_{N,k-1}\;=\;\tilde{C}_{k-1}x_{k-N}+\tilde{G}_{k-1}W_{k-1}+V_{k-1}. \tag{3}\]  
\(Y_{N,k-1}\) is the finite number of measurements defined as:  
\[Y_{i,k-j}\;\;\;\stackrel{{\triangle}}{{=}}\;\;\;[\;y_{k-i}^{T}\;y _{k-i+1}^{T}\;\;\cdots\;\;y_{k-j}^{T}\;]^{T}\;\;(i\geq j). \tag{4}\]  
The finite measurement noise vector \(V_{k-1}\) and the finite process noise vector \(W_{k-1}\) are defined by replacing \(y\). in (4) with \(v\). and \(w\)., respectively, and \(\tilde{C}_{k-1}\) and \(\tilde{G}_{k-1}\) are defined as:  
\[\tilde{C}_{k-i}\stackrel{{\triangle}}{{=}}\left[ \begin{array}{ c}C_{k-N}\\ C_{k-N+1}\Phi_{N,N}\\ \vdots\\ C_{k-i}\Phi_{i+1,N}\end{array} \right], \tag{5}\]  
From (3) and (16), the estimation error \(e_{k-N}\) can be represented as  
\[ \begin{array}{rcl}e_{k-N}&=&x_{k-N}-\hat{x}_{k-N|k}\\ &=&(I-(\zeta_{k-1}^{T}\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{k-1})^{-1}\zeta_{k-1}^{T }\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{k-1})x_{k-N}\\ &&-(\zeta_{k-1}^{T}\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{k-1})^{-1}\zeta_{k-1}^{T} \Pi_{k-1}^{-1}(\hat{\mathcal{G}}_{k-1}W_{k-1}+V_{k-1})\\ &=&-(\zeta_{k-1}^{T}\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{k-1})^{-1}\hat{\mathcal{C} }_{k-1}^{T}\Pi_{k-1}^{-1}(\hat{\mathcal{G}}_{k-1}W_{k-1}+V_{k-1}).\end{array}  \tag{17}\]  
By taking the expectation on estimation error \(e_{k-N}\), we have  
\[ \begin{array}{rcl}\mathrm{E}[e_{k-N}]&=&(\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1 }^{-1}\hat{\mathcal{C}}_{k-1})^{-1}\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1}^{-1}( \hat{\mathcal{G}}_{k-1}\mathrm{E}[W_{k-1}]+\mathrm{E}[V_{k-1}])=0,\end{array}  \tag{18}\]  
which shows that the maximum likelihood estimate of the initial state on the horizon is unbiased. Furthermore, the initial error covariance \(P_{k-N}\) can be obtained with the aid of (11) as  
\[ \begin{array}{rcl}P_{k-N}&=&\mathrm{E}\{e_{k-N}\}\\ &=&\Big{\{}(\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{k-1}) ^{-1}\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1}^{-1}\Big{\}}\Pi_{k-1}\\ &&\times\Big{\{}(\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{ k-1})^{-1}\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1}^{-1}\Big{\}}^{T}\\ &=&(\hat{\mathcal{C}}_{k-1}^{T}\Pi_{k-1}^{-1}\hat{\mathcal{C}}_{k-1})^{-1}. \end{array}  \tag{19}\]  
In order to obtain recursive form of the optimally estimated initial conditions, define the following matrices:  
\[\hat{\mathcal{C}}_{i,k-1}\stackrel{{\triangle}}{{=}}\left[ \begin{array}{c}\mathcal{C}_{k-i+1}\Phi_{i,i}\\ \mathcal{C}_{k-i+2}\Phi_{i-1,i}\\ \vdots\\ \mathcal{C}_{k-2}\Phi_{3,i}\\ \mathcal{C}_{k-1}\Phi_{2,i}\end{array} \right]=\left[ \begin{array}{c}\mathcal{ C}_{k-i+1}\\ \hat{\mathcal{C}}_{i-1,k-1}\end{array} \right]A_{k-i}, \tag{20}\]  
\[\hat{G}_{i,k-1}\stackrel{{\triangle}}{{=}}\left[ \begin{array}{ cccc}\mathcal{C}_{k-i+1}&0&\cdots&0\\ \mathcal{C}_{k-i+2}\[PERSON]_{i-1,i-1}&\mathcal{C}_{k-i+2}&\cdots&0\\ \mathcal{C}_{k-i+3}\[PERSON]_{i-2,i-1}&\mathcal{C}_{k-i+3}\[PERSON]_{i-2,i-2}&\cdots&0\\ \vdots&\vdots&\vdots&\vdots\\ \mathcal{C}_{k-1}\[PERSON]_{2,i-1}&\mathcal{C}_{k-1}\Phi_{2,i-2}&\cdots&\mathcal{C} _{k-1}\end{array}