## 4 Gain Correction
### Full-Consensus Algorithm  
Starting from the approach in [44], we define \(\Delta y_{t}^{i}=y_{t+1}^{i}-y_{t}^{i}\) and \(\Delta x_{t}=x_{t+1}-x_{t}\), after replacing in (1), we obtain the following expression for the sensor output increments:  
\[\Delta y_{t}^{i}=\alpha^{i}\Delta x_{t}+\Delta v^{i}(x_{t}), \tag{13}\]  
where \(\Delta v^{i}(x_{t})=v^{i}(x_{t+1})-v^{i}(x_{t})\). Let the calibration function be again given by (2). The calibration goal is to find such calibration parameters \(a^{i}\) which ensure asymptotical equality of the corrected gains \(g^{i}=\alpha^{i}a^{i}\), \(i=1,\ldots,n\), as in the case of offset calibration. Obviously, we now have  
\[\Delta z^{i}=z^{i}_{t+1}-z^{i}_{t}=a^{i}a^{i}\Delta x_{t}+a^{i}\Delta v^{i}(x_{t }). \tag{14}\]  
We start from the following local criterion functions, formally expressing the basic calibration goal, i.e., the minimal squared difference between the sensor output increments:  
\[J^{i}_{a}(a^{i})=\sum_{j\in\mathcal{N}^{in}_{i}}\gamma_{ij}(\Delta z^{j}_{t}- \Delta z^{i}_{t})^{2}. \tag{15}\]  
The criterion (15) generates the following _distributed-gradient-type recursions_ for estimating \(a^{i}\), \(i=1,\ldots,n\):  
\[\hat{a}^{i}_{t+1}=\hat{a}^{i}_{t}+\delta^{i}_{t}\sum_{j\in\mathcal{N}^{in}_{i} }\gamma_{ij}\epsilon^{\Delta,ij}_{t}\Delta y^{i}_{t}, \tag{16}\]  
where \(\hat{a}^{i}_{t}\) is an estimate of \(a^{i}\); meanwhile, \(\epsilon^{\Delta,ij}_{t}=\Delta\hat{z}^{j}-\Delta\hat{z}^{i}\), with \(\Delta\hat{z}^{i}=\hat{a}^{i}_{t}\Delta y^{i}_{t}\)[49]. Initial conditions can be chosen arbitrarily; it is natural to adopt \(a^{i}_{0}=1\)[44]. As in the case of offset correction, it is possible to obtain the following recursions of the corrected gains, \(\hat{g}^{i}=\alpha^{i}\hat{a}^{i}_{t}\):  
\[\hat{g}^{i}_{t+1}=\hat{g}^{i}_{t}+\delta^{i}_{t}\Delta x^{2}_{t}\sum_{j} \gamma_{ij}\alpha^{i2}[\hat{g}^{j}_{t}(1+w^{j}_{t})-\hat{g}^{i}_{t}((1+w^{j}_ {t})](1+w^{i}_{t}), \tag{17}\]  
where we define \(w^{i}_{t}=\frac{\Delta v^{i}_{t}(x_{t})}{\alpha^{i}\Delta x_{t}}\). The following global model can be readily derived from (17):  
\[\hat{g}_{t+1}=\hat{g}_{t}+\delta\Delta x^{2}_{t}\alpha^{2}\Gamma^{w}_{t}\hat {g}_{t} \tag{18}\]  
where  
\[\Gamma^{w}_{t}=\Gamma+\Gamma W_{t}+W_{t}\Gamma W_{t},\]  
\(g_{t}=[g^{1}_{t}\cdots g^{m}_{t}]^{T}\), \(\alpha=\text{diag}\{\alpha^{1},\ldots,\alpha^{n}\}\), \(W_{t}=\text{diag}\{w^{1}_{t},\ldots,w^{n}_{t}\}\) (it is adopted, as above, that \(\delta^{i}=\delta>0\)). **Remark 6**. : _Due to the fact that the corrected gain is estimated by using the increments of the measurement signal, the quantity \(w^{i}_{t}\) represents the one-step increment (in time) of the nonlinear term in the sensor output, normalized by the increment of the measured signal itself multiplied by the gain from the sensor model._  
**Remark 7**. : _Notice that only the recursions (16) and (4) are implemented in practice in relation with the calibration parameters \(a^{i}\) and \(b^{i}\). The recursions for the corrected parameters \(g^{i}\) and \(f^{i}\), depending on the signals and parameters not available in practice, serve only as a tool for theoretical analysis._  
Obviously, the above gain-correction algorithm (17) does not depend on the sensor offsets, and can be applied independently [44; 45]. However, its convergence remains an open question under the influence of sensor nonlinearities, keeping the structure of the global model in mind (18). **Remark 8**: _Recall that, in the case of the nonexistence of sensor nonlinearities (when \(w_{t}=0\)), the calibration algorithm converges exponentially to consensus under nonrestrictive conditions on the signal, \(x_{t}\), itself [45].