View source: R/utility_functions.R
boot_pca_sample.prcomp | R Documentation |
This function is passed to the statistic argument of the boot function from the boot package. It generates a bootstrapped PCA sample, extracting the standardized loadings using linear PCA (prcomp()).
## S3 method for class 'prcomp' boot_pca_sample( data, indices, pca, original_loadings, ndim, pb = NULL, center, .scale, ... )
data |
The data argument passed from the boot function |
indices |
The indices of the rows for the bootstrapped sample passed from the boot function |
pca |
Object of class prcomp. |
original_loadings |
The data.frame containing the standardized loadings of the original sample. |
ndim |
Numeric. Number of PCs to save (1 to ndim). |
pb |
Object of class "Progress_bar" "R6" generated by progess::progress_bar$new(). Not required. |
center |
Logical. Whether pca is conducted on the centered data. |
.scale |
Logical. Whether pca is conducted on the scaled data. |
... |
Not in use |
A major problem of performing bootstrapping procedures in PCA is what is known as sign reflection: the change of the sign (positive/negative) on the component loadings in a PC given slight variations in the data. In addition, component/factor translocation can occur, meaning that the position of one component can change in a particular PCA solution, especially when two components have similar VAF. Another problem on performing PCAs with variations in the data is the possibility of rotation indeterminacy when the PCA solution of a resampled data presents with a different rotation of the original PCA solution. These issues generate artificially biased bootstrapped distributions, reducing the performance of the procedure. We have implemented a step of procrustes rotation between the original loadings (target) and the bootstrapped sample, which has previously been demonstrated to be a reasonable method to deal with such issues. The procrustes rotation is obtained by the pracma::procrustes() function.
A matrix with one sample bootstrapped standardized loadings. This will be returned to the boot function when pc_stability function is called.
Abel Torres Espin
Linting M, Meulman JJ, Groenen PJF, van der Kooij AJ. Stability of nonlinear principal components analysis: An empirical study using the balanced bootstrap. Psychol Methods. 2007;12(3):359–79.
Babamoradi H, van den Berg F, Rinnan Å. Bootstrap based confidence limits in principal component analysis — A case study. Chemom Intell Lab Syst. 2013 Jan 15;120:97–105.
Timmerman ME, Kiers HAL, Smilde AK. Estimating confidence intervals for principal component loadings: a comparison between the bootstrap and asymptotic results. Br J Math Stat Psychol. 2007 Nov;60(Pt 2):295–314
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.