| ispca | R Documentation |
Performs IS-PCA
ispca(
X,
K = 1,
block.structure,
anp = "2",
covariance = TRUE,
method = "CDM",
orthogonal = FALSE,
standardize = FALSE,
verbose = TRUE
)
X |
Data matrix of dimension |
K |
Number of singular vectors (loadings) to be computed for each identified submatrix. This means that |
block.structure |
Underlying block structure. This parameter is optional as otherwise the functions runs |
anp |
Which regularization function should be used for the HBIC.
|
covariance |
Perform IS-PCA on the covariance ( |
method |
Which method should be used to calculate the eigenvectors (loadings) and eigenvalues. |
orthogonal |
The estimated eigenvectors (loadings) computed using |
standardize |
Standardize the data for block detection using BD-SVD. Default is |
verbose |
Print out progress for |
This function performs inherently sparse principal component analysis (IS-PCA) as introduced in Bauer (2026).
A list with the following components:
The first estimated eigenvectors of the identified block diagonal covariance matrix (i.e., the loadings) as an
object of type matrix. The eigenvectors are orthogonalized if orthogonal = TRUE.
The corresponding first estimated eigenvalues of the identified block diagonal covariance matrix.
The explained variance of the first estimated eigenvalues l.
The detected submatrices using bdsvd as a list object.
Either the block structure detected by bdsvd() or the user-supplied block.structure, depending on the input.
Bauer, J.O. (2025). High-dimensional block diagonal covariance structure detection using singular vectors, J. Comput. Graph. Stat., 34(3), 1005–1016
Bauer, J.O. (2026). Beyond regularization: inherently sparse principal component analysis. Stat. Comp.
Yata, K., Aoshima, M. (2009). PCA consistency for non-Gaussian data in high dimension, low sample size contex, Commun. Stat. - Theory Methods 38, 2634–2652.
Yata, K., Aoshima, M. (2010). Effective PCA for high-dimension, low-sample-size data with singular value decomposition of cross data matrix, J. Multivar. Anal. 101, 2060–2077.
bdsvd, bdsvd.structure
#Example 1: run IS-PCA on a gene expression data set with two tissue types
if (requireNamespace("dslabs", quietly = TRUE)) {
data("tissue_gene_expression", package = "dslabs")
#We only select the two tissue types kidney (6) and liver (7)
Y <- as.numeric(tissue_gene_expression$y)
X <- scale(tissue_gene_expression$x[Y %in% c(6, 7), ], scale = FALSE)
Y <- Y[Y %in% c(6, 7)]
# Run IS-PCA
ispca.obj <- ispca(X = X, anp = "1")
vhat <- ispca.obj$v[, 1:2]
ispc <- X %*% vhat
# Percentage of non-zero components in the first two loadings
round(colSums(vhat != 0)/ncol(X), 2)
# Plot the first two principal components
plot(ispc, pch = Y-5, xlab = "PC1", ylab = "PC2", main = "IS-PCA")
# Compare to CDM-PCA (see cdm.pca(...))
pca.obj <- cdm.pca(X = X, K = 2)
pc <- X %*% pca.obj$v
par(mfrow = c(1, 2))
plot(ispc, pch = Y-5, xlab = "PC1", ylab = "PC2", main = "IS-PCA")
plot(pc, pch = Y-5, xlab = "PC1", ylab = "PC2", main = "PCA")
par(mfrow = c(1, 1))
}
#Example 2: submit a block structure which was identified by any other approach. This can be
#done by transforming the block structure to an object of type 'blocks' using detect.blocks():
if (requireNamespace("glasso", quietly = TRUE)) {
#Simulate a data matrix X with a block diagonal population covariance matrix.
set.seed(1)
n <- 100
p <- 4
Sigma <- bdsvd.cov.sim(p = p, b = 2, design = "c")
X <- matrix(rnorm(n * p), n, p) %*% chol(Sigma)
S <- cov(X)
#Identify the block structure using glasso()
S.block <- glasso::glasso(S, 0.2)$w
#S.blocks is a block diagonal matrix:
print(S.block != 0)
#We know extract the block information to an object of class 'blocks' using detect.blocks()
block.structure <- detect.blocks(S.block)
class(block.structure)
#The block.structure of class 'blocks' can now be supplied to ispca()
ispca(X, block.structure = block.structure, verbose = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.