## 2 Materials and Methods
### Fisher Discriminant Analysis  
Fisher discriminant analysis is a pattern categorization approach that features a very efficient classification potential. FDA's main goal is to determine the Fisher optimal discriminant vector that maximizes the Fisher criterion function. The higher-dimensional feature space of process measurements can be projected onto the obtained optimal discriminant vector space for constructing a lower-dimensional feature space. Let \(X\in R^{n\times m}\) be the matrix that contains the training data for all classes. The total set of \(n\) observations for the \(m\) measured variables that build the \(X\) matrix contains the submatrix \(X_{i}\) as the subset of measurements consisting of \(n_{i}\) rows and corresponding to the class \(i\) of samples. \(\overline{x_{i}}\) denotes the \(m\)-dimensional sample mean vector for the class \(i\) and is given by:  
\[\overline{x_{i}}=\frac{1}{n_{i}}\sum_{x_{j}\in X_{i}}x_{j} \tag{1}\]  
with \(x_{j}\) the set of vectors that belong to class \(j\), then the within-class scatter matrix is defined by:  
\[S_{w}=\sum_{i=1}^{c}S_{i} \tag{2}\]  
where \(c\) is the number of classes, and  
\[S_{i}=\sum_{x_{j}\in X_{i}}(x_{j}-\overline{x_{i}})\big{(}x_{j}-\overline{x_{ i}}\big{)}^{T} \tag{3}\]  
is the within-scatter matrix for class \(i\).  
The between-class scatter matrix is then defined by:  
\[S_{b}=\sum_{i=1}^{c}n_{i}\ (\overline{x_{i}}-\overline{x})(\overline{x_{i}}- \overline{x})^{T} \tag{4}\]  
where \(\overline{x}\) is the total mean vector of all means of the columns of \(X\).  
The optimal discriminant direction is found by maximizing the Fisher criterion:  
\[J(\varphi)=\frac{\varphi^{T}S_{b}\varphi}{\varphi^{T}S_{w}\varphi} \tag{5}\]  
where the maximizer \(\varphi\) is the Fisher optimal discriminant direction that maximizes the ratio of the between-class scatter to the within-class scatter. It may be shown that a vector \(\varphi\) that maximizes \(J(\cdot)\) must satisfy the equation:  
\[S_{b}\varphi=\lambda S_{w}\varphi \tag{6}\]  
for some constants, \(\lambda\) indicates the separability between classes. If \(S_{w}\) is nonsingular, it is obtained as a conventional eigenvalue problem, described by the following expression:  
\[S_{w}^{-1}S_{b}\varphi=\lambda\varphi \tag{7}\]  
The total-scatter matrix is given by the sum of \(S_{b}\) and \(S_{w}\):  
\[S_{t}{=}\ S_{b}{+}S_{w} \tag{8}\]  
If data vector \(x_{j}\) from the \(m\)-dimensional space is reduced to the \(a\)-dimensional space of the FDA vectors, then its linear transformation is given by:  
\[z_{i}{=}\ W_{a}^{T}x_{j} \tag{9}\]  
where \(W_{a}^{T}\) has the \(a\) FDA vectors as columns and \(z_{i}\in R^{a}\).  
To diagnose the faults, FDA examines observed data collected under various faults and uses a discriminant function that assesses the similarity between the current data and the data belonging to each class. When the maximum discriminant function value, \(g_{i}\), satisfies the following conditions, the observation is allocated to the class \(i\):  
\[g_{i}(x)>g_{j}(x),\ \forall\ j\
eq i \tag{10}\]  
\(g_{i}(x)\) is the discriminant function given by a measured vector \(x\) for class \(i\), and \(g_{j}(x)\) is the discriminant function given by the measured vector \(x\) for class \(j\). The discriminant function can be calculated, for each class \(i\), with the following equations:  
\[g_{i}(x)=-\ \frac{1}{2}(x-\overline{x_{i}})^{T}W_{a}\bigg{(}\frac{1}{n_{i}-1}W_{ a}^{T}S_{i}W_{a}\bigg{)}^{-1}W_{a}^{T}(x-\overline{x_{i}}\ )+lnP_{i}-\frac{1}{2}\ ln\bigg{[}det\bigg{(}\frac{1}{n_{i}-1}W_{a}^{T}S_{i}W_{ a}\bigg{)}\bigg{]} \tag{11}\]  
where \(P_{i}\) is the a posteriori probability of \(x\) to belong to class \(i\), and it is computed by the ratio between the number of observations from a class and the total number of observations for all classes. FDA was implemented using the Statistics and Machine Learning Toolbox version 10.0 of Matlab.