## 3 The Proposed Methodology
In addition, both global and local parameters are initialized (see Sections 2.1 and 2.2). Therefore, the cloud \(c1\) is created, which only contains the feature vector \(F(t_{1})\). At the second cycle, when the feature vector \(F(t_{2})\) corresponding to the second signal segment is available, at the time instant \(t_{2}\), the anomaly detection algorithm can be activated. Actually, because since the current mean density and the global density of the last \(n\) data samples are usually compared for establishing whether a data point is an anomaly, the algorithm can be triggered after \(n\) feature vectors are collected. Now, suppose that we are at the j (j \(>\) n) data point; an anomaly is detected if the mean data density is greater than the density of the last \(n\) points [34]:  
\[\text{IF D(j)}<\mu_{\text{D}}\quad\text{j}=\text{j}-\text{n},\ldots,\text{j} \quad\text{THEN j is an anomaly} \tag{17}\]  
where:  
\[\mu_{\text{D}}=\Big{(}\frac{\text{ks}-1}{\text{ks}}\mu_{\text{D}}+\frac{1}{ \text{ks}}\text{D}(\text{x}_{\text{k}})\Big{)}(1-\Delta_{\text{D}})+\text{D}( \text{x}_{\text{k}})\Delta_{\text{D}} \tag{18}\]  
\[\Delta_{\text{D}}=\big{|}\text{D}(\text{x}_{\text{k}})-\text{D}(\text{x}_{ \text{k}-1})\big{|} \tag{19}\]  
ks represents the number of data samples that belong to the same condition. It can be seen as a forgetting factor. Indeed, it is incremented by 1 until a new condition is detected. When the system enters the fault condition, then \(\text{ks}=0\). In this case, \(F(t_{2})\) belongs to the same condition as \(F(t_{1})\): no anomaly is detected, the data point is assigned to the cloud \(c_{1}\), and its parameters are updated, based on the rules of the ADP algorithm (see Section 2.2). This operation is repeated each \(t\), until the condition of Equation (17) is satisfied. When the feature vector \(F(T+t)\) is available, the algorithm recognizes the corresponding data sample as an anomaly and a new cluster \(c2\) is created. At this point, the offline analysis can be conducted. Suppose that a real fault exists. Hence, the HI value that corresponds to the data samples that triggered the generation of the new cloud is set as FT; data points of clouds \(c1\) and \(c2\) are used to build the training set, which is finally used for building the data-driven degradation model corresponding to the identified fault. Because a fault has occurred, the correct operating condition must be restored. Therefore, the procedure described thus far is applied again to the system in the healthy condition, with the difference that, this time, the local parameters of the identified clouds (e.g., number of clouds, cloud prototypes, cloud mean densities) are given as inputs to the algorithm. In addition, at a certain  
Figure 5: Example of the implementation of the proposed methodology for the first data. time, the HI values will be predicted in the future according to both the model built during the offline analysis and the new available data points. The RUL is computed as the difference between the moment at which the HI value is supposed to reach the prefixed failure threshold and the current time. If an anomaly value not exceeding the FT has been detected, then the corresponding HI value can be considered as the time to start RUL prediction (Figure 6). When an anomaly is detected, but a fault has not actually occurred, then the algorithm must continue. Therefore, it is necessary that the current anomalous condition is considered to be normal to detect eventual other anomalies. To do so, when the status of the system is declared anomalous, the following condition is checked [34]:  
\[IF\;D(j)>\mu_{D}\quad j=j-\mathrm{m},\ldots,j\quad THEN\;j\;\text{is not anymore an anomaly} \tag{20}\]  
That is, if the current global density is greater than the mean density for m data samples, then the status of the system can be declared normal. From this point, the joint anomaly detection and ADP can be triggered again each time that a feature vector is available.