## 4 Results
Therefore, the mean value computed at each time stamp is stored and used as the HI for building the degradation model. In this way, online smoothing techniques \begin{table}
\begin{tabular}{c c c} \hline
**Time (Real)** & **Detection Time** & **Latency Time** \\
**(s)** & **(s)** & **(s)** \\ \hline
15.9999 & 16.7498 & 0.75 \\
27.6547 & 28.4079 & 0.808 \\ \hline \end{tabular}
\end{table} 
Table 1: Performance of the anomaly detection algorithm. Figure 10: Confusion matrix. Figure 9: (a) Anomaly detection. (b) Autonomous data partitioning results. for making the synthetic feature value monotonic are avoided and the algorithm is computationally faster and more efficient. The black crosses in Figure 9a show the evolution of HI values with time. A second dataset of the same system was used for testing the complete procedure and computing the RUL of the system in a completely online way. This time, pressure values in each condition were collected over a longer time period. In particular, as shown in Figure 11, a complete degradation process from the nominal condition to Fault 2 (that corresponds to the condition in which the component has to be fixed) was simulated. In this way, it was also possible to evaluate the sensitivity of the anomaly detection algorithm to slight variations of the monitored parameter, and identify the best time to start updating the degradation model and, thus, the RUL prediction. Indeed, based on the synthetic feature F, computed at each time stamp k, the first anomaly was detected after 32.8299 s (Figure 12a). However, the system entered the condition Fault 1 after t = 47.9997. This means that the detected anomalous data sample does not actually correspond to a real fault, but can correspond to an indication that something is happening. Indeed, based on the way the degradation dataset was built, we know that, at that time, a significative reduction of the pressure value occurred. Therefore, this can be named the anomaly threshold (AT), and it is considered to be the time at which to start updating the model degradation and RUL prediction for future implementations. When the second anomaly is detected at t = 48.9099 (Figure 12), a real fault has actually occurred. Subsequently, the HI value at the current time stamp represents the FT.  
At this point, the offline analysis can be conducted. Here, an SSM is implemented using the function for the state space model estimation, asset, as provided by the predictive maintenance toolbox  
Figure 11: Degradation dataset. Figure 12: (**a**) Anomaly detection until the anomaly threshold. (**b**) Anomaly detection until the failure threshold. in MATLAB, which initializes the parameter estimates while using a non-iterative subspace approach and refines the parameter values using the prediction error minimization approach. The obtained model fits the estimation data at 95.51% with the mean square error (MSE) equal to \(4.935\times 10^{-8}\). For the implementation to streaming data, the model should be updated as new data are available. For the model updating, three decisions have to be made, which strongly affect the prediction results. The first decision relates to the time interval, TI, or number of time stamps, between two model updates, when considering that, the higher the value of TI, the lower the prediction ability. The second decision regards the number of HI values that the model has to predict, named HI. A large number of predicted values lowers the performance of the prediction algorithm. However, a small number of predicted values may lead to estimating the achievement of the failure threshold too late to allow for a proper scheduling of the intervention. Finally, the number of past data samples used for updating the model has to be correctly defined, named the segment length (SL). A small number is preferred, so that the updates depend on the most recent data samples. However, in this case, even a small peak or drop in the HI trend could affect the prediction performance.