## Classification
### Modelling Techniques
Briefly, UNEQ defines the class model by the centroid of the concerned category, while the class space is represented by the multidimensional ellipsoid (_hyperellipsoid_) corresponding to a user-defined confidence level, i.e., to a certain probability of finding samples of that category within its boundary. Mathematically speaking, in its initial formulation UNEQ calculates for each investigated object (\(\mathbf{x}_{n}\ -\ J\times 1\)) its squared Mahalanobis distance from the \(z\)-th class centroid (\(\mathbf{m}_{z}\ -\ J\times 1\)) as:  
\[d_{n}^{2}=(\mathbf{x}_{n}-\mathbf{m}_{z})^{\mathrm{T}}\mathbf{S}_{z}^{-1}( \mathbf{x}_{n}-\mathbf{m}_{z}) \tag{27}\]  
where \(\mathbf{S}_{z}\) (\(J\times J\)) denotes an estimate of the \(z\)-th class covariance matrix. Once again, \(\mathbf{m}_{z}\) and \(\mathbf{S}_{z}\) are computed from training objects. If \(d_{n}^{2}\) is found to be larger than a critical distance value, the respective sample is rejected by the class model as an outlier. Such a critical value can be retrieved as detailed in [137; 138; 141]. Variants of both the distance statistic and the way its corresponding threshold is determined have been proposed over the years; an alternative UNEQ framework based on the principles of the Hotelling's \(\mathrm{T}^{2}\) statistic was, for instance, developed by [PERSON] et al. in 1995 [142]. Despite its relative simplicity, as for MLR and LDA, UNEQ encompasses the inversion of a covariance matrix, which is seldom attainable in case the registered variables show a high degree of intercorrelation [51]--as a solution, UNEQ can be applied to the scores resulting from a preliminary PCA modelling of the data at hand. In addition, UNEQ requires such variables to follow a multivariate Gaussian distribution, an assumption that is rarely met when distinct sources of variability are present in the data at hand (e.g., in the case of the traceability of a designated food product, these sources of variability may be associated with different cultivars, harvesting years, producers, etc.) [133]. On the other hand, in SIMCA, the data associated with the \(z\)-th category of samples (\(\mathbf{x}_{z}\ -\ N_{z}\times J\), with \(N_{z}\) equal to the number of training objects belonging to the \(z\)-th class) are modelled by PCA as:  
\[\mathbf{X}_{z}=\mathbf{T}_{z}\mathbf{P}_{z}^{\mathrm{T}}+\mathbf{E}_{z} \tag{28}\]  
Every object to be classified (\(\mathbf{x}_{n}\ -\ J\times 1\)) is afterwards projected onto the class principal component subspace as:  
\[\mathbf{t}_{n,z}^{\mathrm{T}}=\mathbf{x}_{n}^{\mathrm{T}}\mathbf{P}_{z} \tag{29}\]and its distance from such a subspace (of dimensionality \(A_{z}\)) is calculated as:  
\[s_{n}^{2}=\frac{\mathbf{e}_{n,z}^{\mathrm{T}}\mathbf{e}_{n,z}}{(J-A_{z})} \tag{30}\]  
with \(\mathbf{e}_{n,z}^{\mathrm{T}}=\mathbf{x}_{n}^{\mathrm{T}}-\mathbf{t}_{n,z}^{ \mathrm{T}}\mathbf{P}_{z}^{\mathrm{T}}\). This distance value is compared with the average distance to the model subspace of the \(N_{z}\) training samples (computed as \(s_{z}^{2}=\sum_{n_{z}=1}^{N_{z}}\sum_{j=1}^{J}\frac{e_{n_{z},j,z}^{2}}{(J-A_{z} )(N_{z}-A_{z}-1)}\), where \(e_{n_{z},j,z}^{2}\) results from the projection of the \(n_{z}\)-th training object onto the PCA class model subspace) by means of an \(F\) test with \((J-A_{z})\) and \((N_{z}-A_{z}-1)\) degrees of freedom. If the null-hypothesis of the test is rejected, the corresponding sample is labelled as an outlier and rejected by the class model. This first implementation of SIMCA was proposed by [PERSON] et al. in 1976 and was almost immediately amended in order to additionally account for the sample distance within the principal component subspace and not only from the principal component subspace [140]. In addition, together with this alternative formulation, many others have been reported in literature generally based on diverse ways of defining the class space and/or the classification rule (see, e.g., [143]).