## 3 The Recursive Estimation Algorithm
### Basic Concepts  
Consider the output-error auto-regressive (OEAR) system [31]:  
\[y(k)=y_{s}(k)+\eta(k) \tag{6}\]  
where \(y_{s}=\psi_{s}^{T}\theta_{s}\) is the noise-free output of the process (in the previous developments, it represents the noise-free performance index \(J\)) and  
\[\eta(k)=\frac{1}{C(z^{-1})}\
u(k) \tag{7}\]  
is the output of an Auto-Regressive (AR) process with \(\
u\), a white noise with zero mean and variance \(\sigma^{2}\), and \(C(z^{-1})=1+c_{1}\,z^{-1}+c_{2}\,z^{-2}+\cdots+c_{n_{c}}\,z^{-n_{c}}\) is a stable polynomial of order \(n_{c}\).  
Equation (6) can be rewritten as:  
\[y=\psi^{T}\theta=\begin{bmatrix}\psi_{s}&\psi_{n}\end{bmatrix}^{T}\begin{bmatrix} \theta_{s}\\ \theta_{n}\end{bmatrix}=\psi_{s}^{T}\theta_{s}+\psi_{n}^{T}\theta_{n} \tag{8}\]  
where \(w(k)=\psi_{n}^{T}\theta_{n}\) is the noise regression model, where  
\[\psi_{n}^{T} =\begin{bmatrix}\eta(k-1)&\eta(k-2)&\ldots&\eta(k-n_{c})\end{bmatrix} \tag{9a}\] \[\theta_{n} =\begin{bmatrix}c_{1}&c_{2}&\ldots&c_{n_{c}}\end{bmatrix}^{T} \tag{9b}\]  
In the following, it is assumed that \(n_{c}=2\).  
Given structure (8), the unknown parameters \(\theta\) can be estimated online using a RELS algorithm [31] in the form:  
\[e(k) =y_{meas}(k)-\psi(k-1)^{T}\widehat{\theta}(k-1) \tag{10a}\] \[P(k) =\frac{1}{\lambda}\Big{[}P(k-1)-\frac{P(k-1)\psi(k-1)\psi(k-1)^{ T}P(k-1)}{\lambda+\psi(k-1)^{T}P(k-1)\psi(k-1)}\Big{]}\] (10b) \[\widehat{\theta}(k) =\widehat{\theta}(k-1)+P(k)\psi(k-1)e(k) \tag{10c}\]  
where \(e(k)\) is the a priori estimation error, \(y_{meas}(k)\) the measured output, and \(P(k)\) the covariance matrix of the parameter estimation error \(\theta-\widehat{\theta}(k)\) at sample \(k\). As a result, the RELS computes online estimates of both the noise-free and noise model regression parameters contained, respectively, in \(\theta_{s}\) and \(\theta_{n}\). The forgetting factor \(\lambda\) determines how fast past data are disregarded, and typically \(0.85\leq\lambda\leq 0.99\). An estimation of \(\eta(k)\) is provided by the a posteriori estimation error \(\epsilon(k)=y_{meas}(k)-\psi(k-1)^{T}\widehat{\theta}(k)\).  
The RELS algorithm is generally coupled with a constant trace algorithm, ensuring a sufficient correction gain to track slowly time varying parameters. A regularization of the covariance matrix \(P(k)\) is obtained as:  
\[\tilde{P}(k)=\frac{k_{0}\,P(k)}{Trace(P(k))} \tag{11}\]In addition, a projection algorithm [32] can be added to enforce estimator stability by introducing prior knowledge about some parameter bounds:  
\[\widehat{\theta}=\left\{\begin{array}{ll}\widehat{\theta}&,if\quad\widehat{ \theta}\in\mathcal{D}\\ \widehat{\theta}_{\text{Proj}}&,if\quad\widehat{\theta}\
otin\mathcal{D}\end{array}\right. \tag{12}\]  
where :  
\[\widehat{\theta}_{\text{Proj}}=\left\{\begin{array}{ll}\widehat{\theta}- \frac{P(,i)}{P(,i)}\Big{[}\widehat{\theta}_{i}-\widehat{\theta}_{i}^{+} \Big{]}&,if\quad\widehat{\theta}_{i}>\widehat{\theta}_{i}^{+}\\ \widehat{\theta}+\frac{P(,i)}{P(,i)}\Big{[}\widehat{\theta}_{i}^{-}-\widehat{ \theta}_{i}\Big{]}&,if\quad\widehat{\theta}_{i}<\widehat{\theta}_{i}^{-}\end{array}\right. \tag{13}\]  
The domain \(\mathcal{D}\) is defined for \(i\in 1,\ldots,n_{\theta}\), \(n_{\theta}\) being the number of parameters such that:  
\[\mathcal{D}:=\{\widehat{\theta}\in\mathcal{D},\quad\widehat{\theta}_{i}^{-} <\widehat{\theta}_{i}\leq\widehat{\theta}_{i}^{+}\} \tag{14}\]