## 3 Fully Decoupled Extended Kalman Filter
### Extended Kalman Filter  
Following the introduction of the Kalman filter (KF) in 1960, applicable to linear systems exposed to random noise, for smoothing, filtering, or prediction [32], the EKF emerged in 1961 [33]. The EKF was developed for nonlinear systems, and despite not ensuring an optimal estimate, the EKF consistently delivers remarkable results [13]. In our context, the EKF is implemented in a neural model for the estimation of the system state, which contains the synaptic weights and the biases. Consequently, it deals with a discrete-time nonlinear dynamic system where the output is given by a nonlinear function of the state vector \(\mathbf{y}\) at the entrances. In general, the nonlinear model in discrete time is represented by the following equations:  
\[\mathbf{x}_{k+1}=\mathbf{f}(k,\mathbf{x}_{k})+\mathbf{w}_{k}, \tag{2}\]  
\[\mathbf{y}_{k}=\mathbf{h}(k,\mathbf{x}_{k})+\mathbf{v}_{k}, \tag{3}\]  
where \(\mathbf{x}_{k+1}\) is the state at instant \(k+1\), \(\mathbf{x}_{k}\) is the current state, \(\mathbf{y}_{k}\) is the measurable output, \(\mathbf{f}(\cdot)\) is the state transition function, and \(\mathbf{h}(\cdot)\) is the measurement nonlinear function, with \(\mathbf{w}_{k}\) and \(\mathbf{v}_{k}\) representing additive white noise in the process and in the measurement, respectively.  
The process begins with the initialization of the filter:  
\[\hat{\mathbf{x}}_{0}=E[\mathbf{x}_{0}], \tag{4}\]  
\[\mathbf{P}_{0}=E[(\hat{\mathbf{x}}_{0}-E[\mathbf{x}_{0}])(\hat{\mathbf{x}}_{0 }-E[\mathbf{x}_{0}])^{T}], \tag{5}\]  
where \(E[\cdot]\) denotes expected value, and for the initial instant: \(\mathbf{x}_{0}\) is the state, \(\hat{\mathbf{x}}_{0}\) is the estimated state, and \(\mathbf{P}_{0}\) is the error covariance matrix.  
Then the same iterative operations of the KF are performed, incorporating the pair of linearization operations additionally required by the EKF:  
\[\mathbf{F}_{k+1,k}=\frac{\partial\mathbf{f}(k,x_{k})}{\partial x}\bigg{|}_{ \mathbf{x}=\hat{\mathbf{x}}} \tag{6}\]  
\[\mathbf{H}_{k+1,k}=\frac{\partial\mathbf{h}(k,x_{k})}{\partial x}\bigg{|}_{ \mathbf{x}=\hat{\mathbf{x}}} \tag{7}\]The iterative computation continues with the propagation of the state estimator to obtain \(\hat{\mathbf{x}}_{k}^{-}\), a priori state estimate:  
\[\hat{\mathbf{x}}_{k}^{-}=\mathbf{f}(k,\hat{\mathbf{x}}_{k-1}^{-}), \tag{8}\]  
the propagation of the covariance of the estimation error to obtain \(\mathbf{P}_{k}^{-}\), a priori estimation error covariance matrix:  
\[\mathbf{P}_{k}^{-}=\mathbf{F}_{k,k-1}\mathbf{P}_{k-1}\mathbf{F}_{k,k-1}^{T}+ \mathbf{Q}_{k-1}, \tag{9}\]  
where \(\mathbf{Q}_{k-1}\) is the covariance matrix of the noise in the process at \(k-1\), then the computation of the Kalman gain matrix \(\mathbf{K}_{k}\):  
\[\mathbf{K}_{k}=\mathbf{P}_{k}^{-}\mathbf{H}_{k}^{T}[\mathbf{H}_{k}\mathbf{P}_ {k}^{-}\mathbf{H}_{k}^{T}+\mathbf{R}_{k}]^{-1}, \tag{10}\]  
where \(\mathbf{R}_{k}\) is the covariance matrix of the noise in the measurement at \(k\), then the state estimate correction:  
\[\hat{\mathbf{x}}_{k}=\hat{\mathbf{x}}_{k}^{-}+\mathbf{K}_{k}(\mathbf{y}_{k}- \mathbf{h}(k,\hat{\mathbf{x}}_{k-1}^{-})), \tag{11}\]  
and finally, with \(\mathbf{I}\) being the identity matrix of the same size as \(\mathbf{P}_{k}^{-}\), the error covariance correction:  
\[\mathbf{P}_{k}=(\mathbf{I}-\mathbf{K}_{k}\mathbf{H}_{k})\mathbf{P}_{k}^{-}. \tag{12}\]  
In this way, the EKF recursive procedure serves as the basis for a second-order neural network training approach. The estimation error covariance matrix, which evolves throughout the process, is essential to the performance of the EKF, as it encodes second-order information about the training problem [15].  
The EKF as a training algorithm was initially proposed for multilayer perceptron-type neural models, proving to be more effective in terms of the number of training epochs than standard backpropagation for a series of pattern classification problems.