## 3 Methods
### Normal Behavior Model  
The data sets were arranged as follows for the analysis. It should be intended that a sensitivity analysis has been conducted, in order to individuate the effect of the data set size and proximity to the fault on the obtained result. This aspect is discussed in some detail in Section 4. For the moment, the general arrangement of the data set is:  
* \(D_{train}\) is the data set employed for training the normal behavior model and describes the target wind turbine reasonably before the incipience of the fault. * \(D_{test}\) is the data set for testing the model and setting the standards of the residuals between measurements and model estimates. Therefore, this data set also describes the target wind turbine reasonably before the incipience of the fault. * \(D_{fault}\) describes the target wind turbine in proximity of the abrupt shutdown due to the fault. * \(D_{after}\) describes the target wind turbine after the replacement of the damaged generator. The same data set selection was done for the target wind turbine and for a reference healthy wind turbine. The normal behavior model was subsequently constructed by selecting a target. Three options were explored in this study, namely:  
* select the power \(P\) as the target of the model;
* select one phase current \(I\) as the target of the model;
* select one phase voltage \(V\) as the target of the model. For each target \(y\), the most appropriate input variables for the model were identified by constructing a cross-correlation map based on the Pearson correlation coefficient (Equation (13)) with each possible regressor \(x\):  
\[r_{xy}=\frac{\sum_{i=1}^{n}(x_{i}-\bar{x})(y_{i}-\bar{y})}{\sqrt{\sum_{i=1}^{ n}(x_{i}-\bar{x})^{2}}\sqrt{\sum_{i=1}^{n}(y_{i}-\bar{y})^{2}}}, \tag{13}\]  
where \(n\) is the number of observations in the \(D_{train}\) data set, and \(\bar{x}\) and \(\bar{y}\) are the averages of the output and of the regressor \(x\) in the \(D_{train}\) data set. For each target above indicated, the correlation coefficients were computed with respect to each variable indicated in Section 2. It should be clarified that, when the target was voltage or current, the voltages and currents of the other phases were excluded from the possible regressors because they basically contain the same information and the resulting model would not be explanatory. The criterion for including a regressor is a threshold on the Pearson coefficient \(r_{xy}\); a sensitivity study was performed and a lower threshold of 0.6 was set. The selected regressors and the Pearson coefficients \(r_{xy}\) with the target are reported in Table 1.  
After selecting the regressors, the principal component transform was performed (Equation (2)) and the first two principal components were fed as input to the support vector regression for the target. The hyperparameters of the support vector regression were then optimized based on an automatic cross validation. Subsequently the target was simulated for the data sets \(D_{test}\), \(D_{fault}\) and \(D_{after}\) and the behavior of the residuals between model estimates and measurements was analyzed qualitatively and quantitatively, by comparing the different periods of the target wind turbine and by comparing the target and the reference wind turbines. The selected metrics are the most commonly employed and are the normalized mean absolute error (NMAE), the mean absolute percentage error (MAPE) and the normalized root-mean-square error (NRMSE). The NMAE is defined in Equation  
\[NMAE=\frac{100}{\hat{y}M}\sum\lvert y-f(\mathbf{x})\rvert, \tag{14}\]  
where \(M\) is the number of observations in the data set of interest, \(y\) are the observations and \(f(\mathbf{x})\) are the model estimates, and \(\hat{y}\) is the nominal value of the target. The rationale for normalizing to the nominal value of the target is that in this study models were formulated for three different quantities (power, voltage, and current).