## 3 Data-Driven Adaptive Sampling Algorithm
As \(t\) increases from 0.112, the number of samples decreases correspondingly, which is, however, not as many as the case when t increases from 0.110. Thus, it is reasonable to believe that setting the threshold value as 0.112 is relatively a suitable choice, while choosing a value of 0.115, 0.120 or 0.140 for \(t\) is also acceptable considering their corresponding NME. Since only 422 or less data values are sampled with the DDASA, which is less than quarter the original data values, it is believed that the energy consumed for data acquisition, storage and transmission will be significantly reduced. Thus, the lifetime of the battery will be prolonged while maintaining a high level of accuracy within the sampled data compared to the original ones. A comparison of algorithm performance is presented in Figures 7 and 8, and Table 3. Using the same sequence of DO data, a traditional ASA is implemented as well. A set of parameter values are chosen as empirically suggested in paper [10]. Figure 7 shows the reconstructed signal using ASA can still indicate the fluctuation of the DO compared to the original signal in Figure 2a. The NME for the results is 5.31% with a number of 637 samples. The performance is similar when \(t\) = 0.115 for analyzing DO data in the proposed DDASA. However, to achieve a similar result, the ASA uses 637 samples in total, which proves to be more energy-consuming in contrast to the proposed DDASA, where only a number of 320 is needed. Figure 8 presents the comparison of energy consumption over time for ASA and for different values of predetermined thresholds of DDASA. Considering the fact that a more frequent sampling process will equivalently increase the energy consumption for storing and transmitting data, to simplify the comparison process, only the energy consumed for keeping a node active and for data acquisition is considered. Moreover, the active time of the node in each case will be equivalent, which means it should be equal to the total length of time for a fixed rate sampling process. The specific number of energy consumption for different sensing activities can be found in [20], which is the basis for obtaining the simulation results in Figure 8. In Table 3, a performance comparison is provided, in which the DDASA outperforms the ASA when \(t\) = 0.115 and \(t\) = 0.112 with respect to the remaining battery level. \begin{table}
\begin{tabular}{c c c c c c} \hline  & \(t\) = 0.110 & \(t\) = 0.112 & \(t\) = 0.115 & \(t\) = 0.120 & \(t\) = 0.140 \\ \hline Number of Samples & 1591 & 422 & 320 & 244 & 172 \\ NME & 1.14\% & 4.26\% & 5.33\% & 5.39\% & 6.16\% \\ \hline \end{tabular}
\end{table} 
Table 2: Turbidity data sampling results for different threshold values. Figure 7: Reconstructed DO signal based on adaptive sampling algorithm (ASA). ## 6 Model Validation

In the developed scheme above, finding an appropriate value for the threshold plays a key role in determining the performance of the proposed algorithm. Considering that the value of \(D\) in Equation (2) is highly related to not only the absolute value between the newest sample data and its former one, but also the mean value of a set of window-based data. Thus, the function for looking for a suitable threshold value should be in a similar way, which is defined as:

\[t\ =\ \frac{\frac{1}{k-1}\sum\limits_{i=\ 2}^{k}|x_{i}-x_{i-1}|}{\sum\limits_{i \ =\ 1}^{k}x_{i}}\ =\ \frac{k}{k-1}\cdot\frac{i\sum\limits_{i=\ 2}^{k}|x_{i}-x_{i-1}|}{\sum\limits_{i \ =\ 1}^{k}x_{i}} \tag{5}\]

To validate the proposed model, a k-fold cross-validation has been conducted based on Equation (5). To simplify the cross-validation process, a 5 five-fold cross-validation has been selected in regard to the total number of data. Meanwhile, the whole set of data has been divided into five equal sized subsets, four of which are utilized as training sets while the remaining subset functions as a testing set. In each cross-validation process, a threshold value will be given depending on Equation (5), in which \(X_{i}\) is the sensed data amongst the training set.