Number of spikes in PCA
Estimate the number of distant spikes based on the histogram of eigenvalues.
pca_nspike(eigval, breaks = "FD", nboot = 100)
eigval |
Eigenvalues (squared singular values). |
breaks |
Same parameter as for |
nboot |
Number of bootstrap replicates to estimate limits more robustly.
Default is |
The estimated number of distant spikes.
N <- 400; M <- 2000; K <- 8 U <- matrix(0, N, K); U[] <- rnorm(length(U)) V <- matrix(0, M, K); V[] <- rnorm(length(V)) # X = U V^T + E X <- tcrossprod(U, V) + 15 * rnorm(N * M) pca <- prcomp(X) eigval <- pca$sdev^2 plot(head(eigval, -1), log = "xy", pch = 20) pca_nspike(eigval)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.