For different linear dimension reduction methods like principal components analysis (PCA), independent components analysis (ICA) and supervised linear dimension reduction tests and estimates for the number of interesting components (ICs) are provided.
In linear dimension reduction the data are transformed into components of which only a few are assumed to carry the information of interest, while the remaining ones are considered noise. What makes a component interesting depends on the method. In principal component analysis (PCA) these are the components with large variances, in independent component analysis (ICA) and non-Gaussian component analysis (NGCA) the non-Gaussian components, and in supervised dimension reduction such as sliced inverse regression (SIR) the components which carry information about the response. The package ICtest provides tests and estimates for the number of these interesting, or informative, components, which also explains its name.
PCAasymp(), PCAlrt() and PCAschott(),
the latter also for p > n), for NGCA and ICA (FOBIasymp()) and for
SIR (SIRasymp()).PCAboot(), FOBIboot(),
ICSboot() and SIRboot()) and a simulation-based test using
non-Gaussian projection pursuit (NGPPsim()).kSearch(), which turns any of the tests into an estimate of the
dimension using a forward, backward or binary search.PCAladle(), FOBIladle(), SIRladle() and the
general ladle()) and predictor augmentation estimators (PCAaug(),
FOBIaug() and SIRaug()), including the high-dimensional version
PCAaugHD().rorth() for random orthogonal matrices that are uniformly
distributed with respect to the Haar measure.Note that PCAlrt(), PCAaugHD(), FOBIaug() and SIRaug() are so
far available only in the development version.
The released version can be installed from CRAN:
install.packages("ICtest")
The development version can be installed from GitHub:
# install.packages("remotes")
remotes::install_github("klauschN/ICtest")
As an example we consider simulated data with three components whose variances are larger than those of the remaining seven, rotated by a random orthogonal matrix.
library(ICtest)
set.seed(1)
n <- 200
p <- 10
Z <- matrix(rnorm(n * p), ncol = p) %*% diag(c(3, 2.5, 2, rep(1, 7)))
X <- Z %*% t(rorth(p))
A forward search with the asymptotic test for subsphericity estimates the number of interesting components.
kSearch(X, PCAasymp)
#> Results for estimated k = 3:
#>
#> PCA subsphericity test using cov
#>
#> data: X
#> T = 27.921, df = 27, p-value = 0.415
#> alternative hypothesis: the last 7 eigenvalues are not equal
#>
#> Tested k values and respective p-values:
#> k = 0, p-value = < 2.2e-16
#> k = 1, p-value = < 2.2e-16
#> k = 2, p-value = < 2.2e-16
#> k = 3, p-value = 0.415
The ladle estimator gives the same answer, and its criterion can be plotted with ggplot2.
pcaLadle <- PCAladle(X)
pcaLadle$k
#> [1] 3
ggladleplot(pcaLadle, main = "", xlab = "k") +
geom_vline(xintercept = pcaLadle$k, linetype = "dashed") +
scale_x_continuous(breaks = 0:(p - 1)) + theme_bw()
More examples are given in the vignettes, see
vignette(package = "ICtest").
The methods are described in the following papers, among others:
To cite the package itself, see citation("ICtest"). Bug reports and
suggestions are welcome as
issues.