Journal of Chemometrics - IN PRESS On the use of the observation-wise k -fold operation in PCA cross-validation Edoardo Saccenti 1, ∗ Wageningen University and Research Center José Camacho 2, ∗ University of Granada Abstract Cross-validation (CV) is a common approach for determining the optimal number of components in a principal component analysis model. To guarantee the independence between model testing and calibration, the observation-wise k -fold operation is commonly implemented in each cross-validation step. This operation renders the CV algorithm computationally intensive and it is the main limitation to apply CV on very large data sets. In this paper we carry out an empirical and theoretical investigation of the use of this operation in the element wise k -fold ( ekf ) algorithm, the state-of-the-art CV algorithm. We show that when very large data sets need to be cross-validated and the computational time is a matter of concern, the observation-wise k -fold operation can be skipped. The theoretical properties of the resulting modied algorithm, referred to as column wise k -fold ( ckf ) algorithm, are derived. Also, its performance is evaluated with several articial and real data sets. We suggest the ckf algorithm to be a valid alternative to the standard ekf to reduce the computational time needed to cross-validate a data set. Keywords: Cross-validation, Principal component analysis, dimensionality assessment ∗ Corresponding author Email addresses:
[email protected] (Edoardo Saccenti),
[email protected] (José Camacho) 1 Laboratory of Systems and Synthetic Biology, Wageningen University and Research Centre, Dreijenplein 10, 6703 HB Wageningen, The Netherlands. 2 Network Engineering and Security Group, Signal Theory, Networking and Communications Department, University of Granada, C/ Periodista Daniel Saucedo Aranda s/n 18071, Granada, Spain Preprint submitted to Journal of Chemometrics June 3, 2015
Journal of Chemometrics - IN PRESS 1. Introduction In chemometrics and related disciplines, cross-validation (CV) is probably the most commonly used method to determine the optimal number of components (PC) to retain in a principal component analysis (PCA) model. Several cross-validatory algorithms have been proposed [1, 2] after the pioneering works of Wold [3] and Eastment and Krzanowski [4]. The simplest version of CV is the so-called row wise k -fold ( rkf ) method [5, 6], where groups of rows (observations) of the data set are left-out to build the model. The rkf has been criticized because the estimation of the left-out observations is not independent from the observations themselves [2]. An alternative, proposed by Wold himself (see page 401 in [3]: An alternative scheme ), is the the so called element wise k -fold ( ekf ) cross-validation. This method is based on the capability of PCA to recover missing data [7, 8, 9, 10, 11, 12, 13]: some of the elements of the data matrix X are set to be missing and are subsequently recovered using a missing data imputation strategy and the model built on the remaining data. An estimation error is then derived by comparing the true values with their reconstruction, which is, in this case, independent from the left-out elements [2]. The ekf was found to outperform other CV methods (among them the rkf ) in a comparative study [2] (where it was referred to as the Eigenvector algorithm, see also [14] for historical reasons), and recently it has beneted of an in-depth analysis at both the theoretical and practical levels [14, 15]. The ekf is especially suited to select the number of components when the PCA model is going to be used for future missing data recovery [14] or when a model is derived for Multivariate Exploratory Data Analysis (MEDA) with the goal of nding groups of related variables. The biggest drawback of ekf is its computational cost, which prevents the use on very large data sets, like for instance omics data, and this limitation is common to other CV methods. For this task a number of alternative and faster methods have been proposed to determine the optimal number of components either considering numerical approximation of the cross-validation procedure [16] or statistical approaches [17, 18]. Despite this limitation ekf is one of the most used CV methods in chemometrics [2]. The most computationally intensive operation within ekf , if the ecient algorithm proposed in [15] is used, is the observation-wise k -fold operation. In this paper a thorough study on the convenience of this operation is performed. It is shown that the observation-wise k -fold operation does not provide the ekf algorithm with any relevant property. Thus, we claim that if computational time is a matter of concern, this operation can be skipped. The mathematical properties of the resulting algorithm, referred to as column wise k -fold ( ckf ) algorithm, are studied and its performance is compared with that of ekf in order to show its suitability to select the number of components in very large data sets. We suggest the ckf algorithm to be a valid alternative to the standard ekf to reduce the computational time needed to cross-validate a data set. The paper is organized as follows. Section 2 presents the rkf , ekf and ckf 2
Journal of Chemometrics - IN PRESS algorithms. Section 3 is dedicated to the mathematical characterization of the ckf algorithm. In Sections 4 and 5 the performance of the two algorithms is compared on simulated and real data, respectively. Section 6 oers some conclusions and recommendations for the use of the ckf algorithm. 2. Description of the rkf , ekf and ckf algorithms Let the PCA model for a N×M data matrix X be dened as: X=TA(PA)t+ (RA)t (1) where TA is the N×A score matrix, PA is the M×A loading matrix, and RA is the N×M matrix of residuals. Consistently with [14, 15], the principal components used in a model is indicated with A . 2.1. The rkf algorithm The rkf algorithm is presented in Box 1. Here the outer loop iterates through the observations rather than trough the components as in the formulation in [15]: this change reduces the number of PCA models to be tted. The observations (rows) are arranged in G disjoint groups. Thus, if a leave-one-out scheme is employed, each group contains a single observation. In each iteration, one group of observations is left out and a PCA model is tted from the rest of the groups. This model is tted with the maximum number of PCs considered in the crossvalidation. The inner loop iterates through the PCs. It starts with a model using the rst PC, then using the rst two PCs, and so on. In each iteration, the reconstruction error for the left-out group of observations is computed. The output of the algorithm is the matrix of reconstruction errors RA from which the corresponding sum of squares of the prediction error ( PRESSA ) can be computed as follows: PRESSA rkf =||RA||2 F (2) where ||x||F indicates the Frobenius norm of x . The rkf method yields strictly decreasing PRESS curves since the error computed within the algorithm is the reconstruction error. In the rkf , the estimation of the left-out observations is not independent from the observations themselves: the rst equation of the inner loop shows that the scores of the left-out samples are computed from the actual observations. One controversial point is to decide whether the preprocessing information, i.e. the average and weight of the variables, should be estimated either from the entire calibration data X or else from X∗ (data from all groups but G ) and then applied to X# (data from G ). Under the assumption that the model will be applied to future observations the second option is preferred. For the sake of simplicity, the parameters relating to preprocessing are here omitted. 3
Journal of Chemometrics - IN PRESS For each group of observations ( G=1...Gtot ) Form X∗ with data from all groups but G Form X# with data from G Fit the PCA model: X∗=TAmax ∗(PAmax ∗)t+RAmax ∗ For each PC ( A= 1...Amax ) TA #=X#·PA ∗ ˆ X#=TA #·(PA ∗)t RA G=X#−ˆ X# end Combine matrices RA G in RA end Algorithm box 1: Row-wise k -fold ( rkf ) algorithm. X , T , P , R represent the data, scores, loading and reconstruction error matrices. The superscript A indicates the components used in the model. G indicates the disjoint groups in which the observations (rows) are arranged and the columns selected. 2.2. The ekf algorithm In comparison to rkf , the ekf can be seen as a combination of a k -fold operation in both the rows and the columns of the data matrix. It should be noted, however, that the two k -fold operations are not identical: the k -fold operation in the observations discards complete observations to construct the model, while this is not the case in the k -fold operation in the variables. The ekf method is outlined in Algorithm box 2. The outer and the intermediate loops reproduce the rkf algorithm. The dierence with rkf is the inner loop that iterates through the variables, arranged in H disjoint groups. Again, a leave-one-out scheme can be used in the groups of variables if desired. The loop computes the CV error by using the missing data method referred to as trimmed score imputation (TRI) [19]. Very briey, the scores of incomplete observations are estimated by imputing missing values with their unconditional means ( i.e. zero value for mean-centered data). In this way a so called trimmed-score, which is a least square estimator, is obtained. See [15] and [20] for a thorough analysis on the use of this and other imputation methods. The inner loop yields the corresponding error for the elements which belong to the rows in G and the columns in H . The output of the algorithm is the matrix of prediction errors EA (with elements eA n,m in the n -th row and m -th column) from which the corresponding PRESSA can be computed as follows: PRESSA ekf =||EA||2 F (3) The PRESS curves computed in this way typically show a U-valley shape where the minimum identies the optimal number of components. 4
Journal of Chemometrics - IN PRESS For each group of observations ( G=1...Gtot ) Form X∗ with data from all groups but G Form X# with data from G Fit the PCA model: X∗=TAmax ∗(PAmax ∗)t+RAmax ∗ For each PC ( A= 1...Amax ) TA #=X#PA ∗ ˆ X#=TA #(PA ∗)t RA #=X#−ˆ X# For each group of variables ( H=1...Htot ) Select the rows of PA ∗ in H yielding PA ∗,H Select the columns of RA # in H yielding RA #,H QA ∗,H=PA ∗,H(PA ∗,H)t EA G,H=X#,HQA ∗,H+RA #,H end Combine matrices EA G,H in EA end end Algorithm box 2: Element-wise k -fold ( ekf ) algorithm. X , T , P , R , E represent the data, scores, loading and reconstruction and prediction error matrices. The superscript A indicates the components used in the model. G and H indicate the disjoint groups in which the observations (rows) are arranged and the columns selected. The steps followed in the intermediate and inner loops to compute the ekf error were proposed in [15], providing a much more ecient way to iterate through the variables than in the traditional, more intuitive version of [2]. It should also be noted that [2] makes use of the Projection to Model Plane (PMP) imputation method [19] instead of TRI, a procedure that was demonstrated to introduce instability in the ekf algorithm. The reader is referred to [14] for more information on the application of dierent imputation algorithms to ekf . The properties of ekf descend from the use of the Trimmed Score Imputation (TRI) [9] in the algorithm. Although the ekf may not be well suited to separate structure from noise (as the variance in one original variable is neither treated as structure nor as noise) it may be indicated to use ekf with typical chemometrics data sets, like spectroscopy data, where independent variables are uncommon [15]. 2.3. The ckf algorithm If the observation k -fold operation in ekf is skipped, the algorithm greatly simplies since the outer loop disappears. The resulting algorithm is outlined in Algorithm box 3. As this algorithm only iterates through the columns, we propose the name of column-wise k -fold ( ckf ) algorithm. It should be noted that, following [15], if a leave-one-out (loo) operation is done in the columns 5
Journal of Chemometrics - IN PRESS Fit the PCA model: X=TAmax (PAmax )t+RAmax For each PC ( A= 1...Amax ) RA=X−TA(PA)t For each group of variables ( H=1...Htot ) Select the rows of PA in H yielding PA H Select the columns of RA in H yielding RA H QA H=PA H(PA H)t EA H=XHQA H+RA H end Combine matrices EA H in EA end Algorithm box 3: Column-wise k -fold ( ckf ) algorithm. X , T , P , R , E represent the data, scores, loading and reconstruction and prediction error matrices. The superscript A indicates the components used in the model. H indicates the columns selected. within the ckf , the inner loop is transformed to a single matrix operation. This leads to an algorithm that is particularly fast in computational environments designed for matrix operations, like Matlab [21] or Octave [22, 23]. Likewise the ekf , ckf makes use of the TRI procedure but in one single step, so that only one PCA model is tted. The idea of skipping the k -fold operation in the observations is also substantiated by the fact that the properties of PRESS curve of the ekf do not depend on the k -fold operation in the observations [15] but only in the properties of the error by TRI. Thus, the PRESS by ckf retains all properties highlighted in the introduction, including the convenient valleyshape where the minimum value identies the number of PCs. 3. Mathematical characterization of the ckf algorithm As shown in [24], very dierent data distributions can lead to the same covariance matrix. Thus, the function that links a data matrix with its corresponding covariance matrix is one to many; the covariance matrix can be seen as a summary of the data where the information about data distribution is lost. We now set to demonstrate that the output of ckf depends on the covariance matrix, and we dene a kernel version of the algorithm. For any group H of variables (without any particular order) the corresponding reconstruction error RA H is given by RA H=XH−XPA(PA H)t (4) The loading vectors PA of a PCA model for a N×M data matrix X can be also obtained using the eigendecomposition of the cross-product matrix: Ψ=XtX. (5) 6
Journal of Chemometrics - IN PRESS The cross-product matrix for any group H of variables of X can be obtained as sub-matrix of the full cross-product matrix Ψ . We set ΨH,H= (XH)tXH (6) and ΨM,H=XtXH (7) Both ekf and ckf use the TRI procedure: it can be shown (see [15]) that the error by TRI EA H for a group of variables H in a PCA model tted with A components is given by EA H=XHQA H+RA H (8) with: QA H=PA H(PA H)t (9) The PRESS for the model computed with A components can be computed as: PRESSA=X HEA H2=X H tr (EA H)tEA H (10) Substituting Equation (8) in the third member of Equation (10), with some basic matrix algebra manipulation and using the properties of the trace operator it is immediate to arrive at tr (EA H)tEA H= tr (QA H)t(XH)tXHQA H)+ tr (RA H)tRA H+ (11) +2 tr (RA H)tXHQA H By plugging Equation (11) in (10) and re-arranging the sum over H , the PRESS is given by PRESSA=X H tr (RA H)tRA H+X H tr (QA H)t(XH)tXHQA H)+ (12) +X H 2 tr (RA H)tXHQA H For the rst term, it holds that: X H tr (RA H)tRA H= tr (RA)tRA (13) with QA=PA(PA)t . However, the same simplication cannot be performed on the other two terms of Equation (12) due to the QA H terms. It is now easy to show that the three terms of Equation (12) can be expressed in terms of the elements of the data cross-product matrix Ψ . The rst term 7
Journal of Chemometrics - IN PRESS in Equation (12) is just the trace of the cross-product matrix of the residual matrix RA and can be computed from the data cross product matrix Ψ tr (RA)tRA= tr Ψ−QAΨ(QA)t (14) Using denition (6) the second term of Equation (12) is X H tr (QA H)t(XH)tXHQA H=X H tr (QA H)tΨH,HQA H (15) By making use of formula (4) and denitions (6) and (7) the last term of expression (12) becomes X H 2 tr (RA H)tXHQA H=X H 2 tr (XH−XPA(PA H)t)tXHQA H= (16) =X H 2 tr ΨH,HQA H−PA H(PA)tΨM,HQA H Thus PRESSA can be re-written as PRESSA= tr Ψ−QAΨ(QA)t+X H tr (QA H)tΨH,HQA H+ (17) 2X H tr ΨH,HQA H−PA H(PA)tΨM,HQA H This ends the proof. The resulting kernel algorithm is presented in Algorithm box 4. This kernel algorithm is expected to be more suitable than the one given in Algorithm box 3 when the number of observations is large enough so that matrix Ψ can only be iteratively computed [25]. It should be noted that dierent data sets can yield the same covariance matrix: this would yield dierent PRESS curves according to ekf but equal PRESS curves according to ckf . Thus, the ckf is much faster but less specic to the tting data set than ekf . Therefore, by comparing both algorithms, we can conclude whether the k -fold operation in ekf is convenient from a practical point of view or not. 4. Comparison of ekf and ckf with simulated data In this section we discuss the practical implication of using ckf instead of ekf . A rst and obvious consequence of using ckf in place of ekf is the dierent computational time required. In Table 1 the computational times of both algorithms on matrices of dierent sizes in a specic setup are compared. The ekf is used in two modes: observation-wise leave-one-out (loo) and with a 7-fold split. When the number of observations is large, a common approach is to use a reduced number of folds to perform CV, instead of the loo operation. As expected, the ckf is much faster than any version of ekf . This result is especially relevant for very large matrices, in the observations and/or in the variables, since the 8
Journal of Chemometrics - IN PRESS Fit a PCA model with Amax PCs from XX , obtaining PAmax For each PC ( A= 1...Amax ) QA=PA(PA)t RA=Ψ−QAΨ(QA)t PRESSA= tr(RA ) For each group of variables ( H=1...Htot ) Select the rows of PA in H yielding PA H QA H=PA H(PA H)t PRESSA H= PRESSA H+ tr((QA H)tΨH,HQA H) + 2 tr(ΨH,HQA H) PRESSA H= PRESSA H−2 tr(PA H(PA)tΨM,HQA H) end end Algorithm box 4: Column-wise k -fold ( ckf ) kernel algorithm. computational time of ekf is too large to be used in those circumstances. This makes ckf an interesting and attractive alternative to ekf for large data sets. Also, the kernel ckf is suitable for data sets in which the number of observations is much larger than that of variables. Other aspects to be evaluated are the price to pay for this improvement in computational eciency and the actual benet of using the observation-wise k - fold operation within the cross-validation. As already discussed in Section 3, the ekf takes as input the original data matrix while ckf takes only the covariance matrix. When the covariance matrix is obtained from the original data matrix, the original distribution of the observations is lost. Indeed, as shown in [24], very dierent data distributions can lead to the same covariance matrix. For this reason, the ekf is expected to be more specic to the actual data set than the ckf : an expected advantage of the former could be that the PRESS curve depends, to some extent, on the data distribution. To check whether this is the case, the ADICOV algorithm [24] is used to create three dierent data sets for the same, exact, covariance matrix. These distributions are a multinormal distribution, a distribution with one outlier and a distribution with two multinormal clusters. This experiment is repeated twice for two dierent covariance matrices. The rst one presents equally separated eigenvalues, so that each eigenvalue is one order of magnitude higher that the following. In the second one, this dierence was only present between the rst and second eigenvalues, while the remaining were of a similar to the second one. Results are shown in Figures 1 and 2, respectively. From Figure 1 a clear conclusion can be derived: there are circumstances where the observation-wise k -fold operation does not provide any hint about data distribution. This can be seen from the leave-one out ekf cross-validation PRESS curves which are the indistinguishable although the three data sets show dierent variable distributions (random multinormal, with 1 outlier and a two clusters multinormal distribution). Moreover, the PRESS curves are the 9
Journal of Chemometrics - IN PRESS [13] V. Audigier, F. Husson, and J. Josse, A principal component method to impute missing values for mixed data, Advances in Data Analysis and Classication , pp. 122, 2013. [14] J. Camacho and A. Ferrer, Cross-validation in pca models with the element-wise ekf algorithm: Practical aspects, Chemometrics and Intelligent Laboratory Systems , vol. 131, pp. 3750, 2014. [15] J. Camacho and A. Ferrer, Cross-validation in pca models with the element-wise k-fold (ekf) algorithm: theoretical aspects, Journal of Chemometrics , vol. 26, no. 7, pp. 361373, 2012. [16] J. Josse and F. Husson, Selecting the number of components in principal component analysis using cross-validation approximations, Computational Statistics & Data Analysis , vol. 56, no. 6, pp. 18691879, 2012. [17] S. Kritchman and B. Nadler, Determining the number of components in a factor model from limited noisy data, Chemometrics and Intelligent Laboratory Systems , vol. 94, no. 1, pp. 1932, 2008. [18] E. Saccenti and J. Camacho, A comparison of methods for determining the number of components in principal components analysis based on random matrix theory, cross-validation and numerical approximation, Submitted , 2014. [19] F. Arteaga and A. Ferrer, Dealing with missing data in mspc: several methods, dierent interpretations, some examples, Journal of Chemometrics , vol. 16, pp. 408418, 2002. [20] J. Camacho, J. Picó, and A. Ferrer, Data understanding with pca: structural and variance information plots, Chemometrics and Intelligent Laboratory Systems , vol. 100, no. 1, pp. 4856, 2010. [21] MATLAB, version 8.10.0 (R2012b) . Natick, Massachusetts: The Math- Works Inc., 2012. [22] J. W. Eaton, D. Bateman, and S. Hauberg, GNU Octave version 3.0.1 manual: a high-level interactive language for numerical computations . CreateSpace Independent Publishing Platform, 2009. ISBN 1441413006. [23] Octave community, GNU Octave 3.8.1, 2014. [24] J. Camacho, P. Padilla, J. Díaz-Verdejo, K. Smith, and D. Lovett, Leastsquares approximation of a space distribution for a given covariance and latent sub-space, Chemometrics and Intelligent Laboratory Systems , vol. 105, no. 2, pp. 171180, 2011. [25] J. Camacho Páez, Visualizing Big data with Compressed Score Plots: Approach and Research Challenges., Chemometrics and Intelligent Laboratory Systems , vol. 135, pp. 110125, 2014. 16
Journal of Chemometrics - IN PRESS [26] I. Jollie, Principal component analysis . Wiley Online Library, 2005. [27] S. Dray, On the number of principal components: A test of dimensionality based on measurements of similarity between matrices, Computational Statistics & Data Analysis , vol. 52, no. 4, pp. 22282237, 2008. [28] J. Camacho, A. Pérez-Villegas, R. A. Rodríguez-Gómez, and E. Jiménez- Mañas, Multivariate exploratory data analysis (meda) toolbox for matlab, Chemometrics and Intelligent Laboratory Systems , vol. 143, pp. 4957, 2015. [29] E. Saccenti and L. Tenori, Multivariate modeling of the collaboration between luigi illica and giuseppe giacosa for the librettos of three operas by giacomo puccini, Literary and Linguistic Computing , p. fqu006, 2014. [30] E. Saccenti, M. Suarez-Diez, C. Luchinat, C. Santucci, and L. Tenori, Probabilistic networks of blood metabolites in healthy subjects as indicators of latent cardiovascular risk, Journal of proteome research , 2014. [31] L. Tenori, X. Hu, P. Pantaleo, B. Alterini, G. Castelli, I. Olivotto, I. Bertini, C. Luchinat, and G. F. Gensini, Metabolomic ngerprint of heart failure in humans: a nuclear magnetic resonance spectroscopy analysis, International journal of cardiology , vol. 168, no. 4, pp. e113e115, 2013. [32] E. Saccenti, J. A. Westerhuis, A. K. Smilde, M. J. van der Werf, J. A. Hageman, and M. M. Hendriks, Simplivariate models: uncovering the underlying biology in functional genomics data, PloS one , vol. 6, no. 6, p. e20747, 2011. [33] P. Bernini, I. Bertini, C. Luchinat, S. Nepi, E. Saccenti, H. Schaefer, B. Schuetz, M. Spraul, and L. Tenori, Individual human phenotypes in metabolic space and time, Journal of proteome research , vol. 8, no. 9, pp. 42644271, 2009. [34] Retrieved at wwww.metaboanalyst.ca, [35] Matlab, the mathworks inc, Natick, MA , 2015. [36] R. A. Fisher, The use of multiple measurements in taxonomic problems, Annals of eugenics , vol. 7, no. 2, pp. 179188, 1936. [37] S. Aeberhard, D. Coomans, and O. De Vel, Comparative analysis of statistical pattern recognition methods in high dimensional settings, Pattern Recognition , vol. 27, no. 8, pp. 10651077, 1994. [38] C. Q. Fang Zhou and R. D. King, Predicting the geographical origin of music, ICDM , 2014. 17
Journal of Chemometrics - IN PRESS [39] J. Christensen, L. Nørgaard, H. Heimdal, J. G. Pedersen, and S. B. Engelsen, Rapid spectroscopic analysis of marzipanâcomparative instrumentation, Journal of near infrared spectroscopy , vol. 12, no. 1, pp. 6375, 2004. [40] J. Christensen, E. M. Becker, and C. Frederiksen, Fluorescence spectroscopy and parafac in the analysis of yogurt, Chemometrics and Intelligent Laboratory Systems , vol. 75, no. 2, pp. 201208, 2005. [41] C. M. Andersen and R. Bro, Quantication and handling of sampling errors in instrumental measurements: a case study, Chemometrics and intelligent laboratory systems , vol. 72, no. 1, pp. 4350, 2004. [42] M. Hubert, P. J. Rousseeuw, and K. Vanden Branden, Robpca: a new approach to robust principal component analysis, Technometrics , vol. 47, no. 1, pp. 6479, 2005. [43] W. McReynolds, Characterization of some liquid phases, Journal of Chromatographic Science , vol. 8, no. 12, pp. 685691, 1970. [44] I. Bertini, A. Calabro, V. De Carli, C. Luchinat, S. Nepi, B. Porrio, D. Renzi, E. Saccenti, and L. Tenori, The metabonomic signature of celiac disease, Journal of proteome research , vol. 8, no. 1, pp. 170177, 2008. [45] M. Imielinski, R. N. Baldassano, A. Griths, R. K. Russell, V. Annese, M. Dubinsky, S. Kugathasan, J. P. Bradeld, T. D. Walters, P. Sleiman, et al. , Common variants at ve new loci associated with early-onset in- ammatory bowel disease, Nature genetics , vol. 41, no. 12, pp. 13351340, 2009. Figures 18
Journal of Chemometrics - IN PRESS Figure 1: Score plots for of three dierent data distributions that provide the same PCA loadings, computed using ADICOV [24]: a multinormal distribution (A), a distribution with one outlier (B) and a distribution with two clusters (C). Panels D, E and F show the CV PRESS curves for the 3 data sets with observation-wise leave-one-out ( ekf -loo) ekf , 7-fold ekf and ckf . 19
Journal of Chemometrics - IN PRESS Figure 2: Score plots for of three dierent data distributions that provide the same PCA loadings, computed using ADICOV [24]: a multinormal distribution (A), a distribution with one outlier (B) and a distribution with two clusters (C). Panels D, E and F show the CV PRESS curves for the 3 data sets with observation-wise leave-one-out ( ekf -loo) ekf , 7-fold ekf and ckf . 20
Journal of Chemometrics - IN PRESS Figure 3: Decomposition in the three terms of PRESS (see Equation (17) and Equations (18)-(20)) of the PRESS curves corresponding to the multinormal distribution (Data set 1), the distribution with one outlier(Data set 2) and the distribution with two clusters (Data set 3) shown in Figure 2 (Panels A, B and C). 21
Journal of Chemometrics - IN PRESS Figure 4: PRESS curve for the cross-validation of data set D.3 of the simulation study (panel A). Plot of the three terms (term1, term2 and term3, Equations (18), (19), and (20), respectively) summing up to make the PRESS. 22
Journal of Chemometrics - IN PRESS Figure 5: Score plot and PRESS cross-validation curves for four dierent data sets. From left to right: A-E) chemometrics (NIR data); B-F) chemometrics (McReynolds data), C-G) metabolomics data (NMR data) and D-H) genomics (microarray) MA. Cross=validation results for these data sets are reported also in Table 3 (data sets number 16 to 19)). Data sets have been cross-validated using the ekf algorithm with both leave-one (loo) out and 7-fold procedure for the observation-wise CV step and with the new ckf algorithm. 23
Journal of Chemometrics - IN PRESS Tables Computational time Data set size ekf-loo ekf-7fold ckf ckf-kernel 10 ×10 <0.1 s <0.1 s <0.1 s <0.1 s 100 ×10 <0.1 s <0.1 s <0.1 s <0.1 s 100 ×100 2.0 s 0.2 s 0.1 s 0.4 s 100 ×1000 1.1 m 5.0 s 2.2 s 47.4 s 1000 ×100 46.0 s 0.7 s 0.8 s 0.4 s 1000 ×200 3.0 m 4.0 s 4.7 s 2.5 s 1000 ×500 1.0 h 59.2 s 37.7 s 58.9 s 1000 ×1000 7.4 h 7.4 m 3.6 m 3.7 h Table 1: Computational time for the three dierent CV algorithms: ekf with leave-one out (loo), ekf with 7 fold CV (7fold) and ckf . The maximum number of components for which dierent models are tted is set equal to the rank of the data matrix. Calculation has been performed on a Intel CPU Dual-Core Pentium E5200, running Windows 7 Enterprise equipped with 4 GB ram. PCA is performed via SVD. 24
Journal of Chemometrics - IN PRESS Data set D.1 (4/8) Noise level (%) ckf ekf-loo ekf-7fold 0 3.8 (0.4) 3.8 (0.4) 3.9 (0.3) 5 3.7 (0.5) 4.0 (0.0) 4.0 (0.0) 10 3.7 (0.5) 3.9 (0.3) 3.9 (0.3) 15 3.6 (0.5) 3.7 (0.5) 3.8 (0.4) 20 3.6 (0.5) 4.0 (0.0) 4.0 (0.0) 25 3.8 (0.4) 3.9 (0.3) 3.9 (0.3) 50 3.6 (0.5) 3.8 (0.4) 3.8 (0.4) Data set D.2 (8/10) Noise level (%) ckf ekf-loo ekf-7fold 0 5.9 (0.3) 5.9 (0.3) 6.0 (0.5) 5 5.9 (0.3) 6.0 (0.5) 6.0 (0.5) 10 5.9 (0.3) 6.1 (0.6) 6.3 (0.8) 15 6.0 (0.0) 6.0 (0.0) 6.1 (0.3) 20 6.0 (0.0) 6.1 (0.3) 6.1 (0.3) 25 5.9 (0.3) 6.1 (0.6) 6.2 (0.6) 50 5.9 (0.3) 6.1 (0.6) 6.1 (0.6) Data set D.3 (12/27) Noise level (%) ckf ekf-loo ekf-7fold 0 9.1 (1.7) 12.0 (0.0) 12.0 (0.0) 5 9.5 (1.4) 11.9 (0.3) 12.0 (0.0) 10 10.0 (1.9) 12.0 (0.0) 11.9 (0.3) 15 9.9 (1.3) 12.0 (0.0) 12.0 (0.0) 20 8.9 (1.7) 12.0 (0.0) 12.0 (0.0) 25 9.6 (2.0) 12.0 (0.0) 11.9 (0.3) 50 9.2 (2.0) 12.0 (0.0) 12.0 (0.0) Data set D.4 (15/50) Noise level (%) ckf ekf-loo ekf-7fold 0 12.4 (0.5) 13.0 (0.0) 13.0 (0.0) 5 12.3 (0.5) 13.0 (0.0) 13.0 (0.0) 10 12.4 (0.5) 13.0 (0.0) 13.0 (0.0) 15 12.5 (0.5) 13.0 (0.0) 13.0 (0.0) 20 12.6 (0.5) 13.0 (0.0) 13.0 (0.0) 25 12.5 (0.5) 13.0 (0.0) 13.0 (0.0) 50 12.5 (0.5) 13.0 (0.0) 13.0 (0.0) Table 2: Estimation of the number of component for four data sets: D.1 (4/8 signicant components), D.2 (8/10), D.3 (12/27) and D.4 (15/50) obtained using the three dierent CV algorithms: ekf with leave-one out (loo), ekf with 7 fold CV (7fold) and ckf . 25