# Detection of Wind Turbine Failures through Cross-Information between Neighbouring Turbines
## 3 Materials and Methods
### Filtering of Outliers  
Another sensitive issue in the preprocessing steps is the outliers handling. In [25] a study was made on the different filtering methods in the context of WTs. What is clear is that it is not possible to use methods that assume a given statistic of the signal to be filtered without having determined the characteristics of the signals.  
In the present work, only two configurations have been used: (i) the one applied to Figure 2, which is widely used but does not work correctly in our problem, and (ii) the one applied to Figure 3, which is taken as general, since it works very well on the whole set of available signals.  
In this sense, the effect of using a typical filtering method consisting of eliminating values that exceed three times the scaled median absolute deviation (MAD) [26] is shown in Figure 2 The particularity of this filtering method is that it works on the entire signal. Let us consider that the samples are organized in the vector \(\mathbf{x}\). The scaled MAD is computed as \(K\cdot median(|\mathbf{x}-median(\mathbf{x})|)\) where the \(median()\) represents the function that calculates the median of its input, \(|\mid\) stands for the module, and \(K\) is the scale factor taken by default as 1.4826 (the value taken when assuming Gaussian statistics). In this plot, in which the temperature _wgen_avg_GnTmp_plhsA_ is depicted, it can be observed that the method captures values close to zero as outliers. The outliers are marked with a black cross. These detections are consistent with the laws of physics, as temperature values are subject to high inertia and cannot undergo such sharp variations. However, the method visibly fails when values corresponding to high amplitudes are removed, even though it is known that these values correspond to well-functioning states of the WT. After the application of this method, they would no longer be well represented.  
Figure 2: Plot of the set of samples that the algorithm detects as outliers when it uses one of the most common rules to detect them, which is to consider a value to be an outlier if the value is more than three scaled median absolute deviations (MAD) away from the median. In this case, the algorithm would incorrectly remove the values of high signal amplitudes. The values of the outliers are indicated with a cross.  
Optimally, the filtering method for each signal should be determined according to the characteristics of each particular signal. For that, a method that works acceptably well for all recorded signals is proposed. It consists in determining that a value will be an outlier if it is more than 3.2 local standard deviations from the local mean calculated over a 25-sample moving window, which roughly correspond to 2 h of data. The fact of performing the operations on a moving window means that the filtering criteria are applied locally and not considering the whole range of values that the signal takes in the entire period of the recording. In Figure 3, the points detected as outliers according to this second method are shown, for the same signals and period as those shown in Figure 2. In this second case, the method does not clip the higher amplitude values of the signal. In order to generalise the process, this filter has been applied in the same way to all the signals.