## 2 Data Exploration  
Prior to conducting a proper food authentication study, users might be interested in carrying out preliminary investigations to assess, for instance, whether a particular spectroscopic technique is capable of discerning products of distinct geographical origins or whether an instrumental response is sensitive enough to detect the presence of compounds or adulterants of interest in the specific samples at hand. In this regard, chemometric exploratory tools based on the reduction of the dimensionality of the original data collected are of crucial importance, as they dramatically ease the visualization of these data, allowing possible differences among specimens (related to one or multiple of the aforementioned aspects, like the presence of undesired/unexpected substances) to be spotted in a straightforward way. Given, in fact, the complex multidimensional and multivariate nature of spectroscopic measurements, such differences are very often undiscernible when simply plotting raw spectral profiles since they normally lie not in few scattered regions of the concerned wavelength domain, but in the correlation structure intrinsic to the recorded spectral variables or descriptors (this is the case especially for low-selectivity approaches as Near-InfraRed--NIR--spectroscopy). For this reason, one of the most commonly exploited tools in similar scenarios to facilitate and improve the identification of diverse groups of food samples is Principal Component Analysis (PCA) [3,4]. PCA makes it possible to compress, describe and interpret large sets of multidimensional data. Its basic principle can be summarized as follows: let **X** be a centered \(N\times J\) matrix with \(J\) denoting the number of variables(e.g., \(J\) wavelengths of light scanned in a spectroscopy experiment) registered, for instance, at \(N\) time instants or for \(N\) different objects. As specified, when \(J\) is very large, the useful and meaningful information in \(\mathbf{X}\) is usually intercorrelated among various of these variables over the whole set of recordings. Then, for a chosen degree of acceptable accuracy, it is possible to reduce the \(J\)-dimensional space of the original descriptors to an \(A_{\text{PCA}}\)-dimensional subspace in which data mostly vary and onto which all the \(N\) samples under study can be projected and represented as new points. Mathematically speaking, PCA is based on the bilinear structure model in Equation (1):  
\[\mathbf{X}=\mathbf{T}\mathbf{P}^{\text{T}}+\mathbf{E}_{\text{PCA}} \tag{1}\]  
where \(\mathbf{P}\) (\(J\times A_{\text{PCA}}\)) is an array of so-called _loadings_, which determine the \(A_{\text{PCA}}\) basis vectors (_principal components_ or _factors_) of the PCA subspace, \(\mathbf{T}\) (\(N\times A_{\text{PCA}}\)) defines the projection coordinates or _scores_ of all the \(N\) rows of \(\mathbf{X}\) on this lower-dimensional space and \(\mathbf{E}_{\text{PCA}}\) (\(N\times J\)) denotes the matrix of unmodelled residuals, i.e., the portion of \(\mathbf{X}\) not _explained_ at the chosen rank, \(A_{\text{PCA}}\)--in PCA, the optimal number of principal components to extract can be estimated by a wide range of approaches that, broadly speaking, can be classified into three distinct categories [5]: ad hoc rules (like [PERSON]'s eigenvalue-greater-than-1 rule [6], [PERSON]'s minimum average partial rule [7], and [PERSON]'s scree test [8]), statistical tests (like [PERSON]'s Chi-square test [9] and [PERSON]'s statistics-based test [10]) and computational criteria (like cross-validation [11; 12; 13] and permutation testing [14; 15; 16; 17; 18; 19; 20; 21]. The PCA solution may be formulated in many equivalent ways and attained by a variety of algorithms, among which the most widespread and popular is certainly Singular Value Decomposition (SVD [22]).