| prmats | R Documentation |
Identifies the principal (sub)matrices
prmats(X, block.structure, rule = "cumvar", value)
X |
Data matrix of dimension |
block.structure |
Underlying block structure. Must be a ' |
rule |
Which rule should be used to choose principal submatrices. |
value |
Numeric parameter used by |
This function selects the principal (sub)matrices as described in Bauer (2026).
A named list with the following components:
List of submatrices ordered by explained variance (rule = 'cumvar') or by factor (rule = 'enrich').
Each element prmats[[b]] is a named list with:
Proportion of total variance explained by block b.
Average variance of the variables in block b.
Enrichment factor expl.var / avg.var (see value argument of the function).
Column names (variables) that belong to block b.
Number of variables in block b.
The data matrix of the kept submatrices/variables.
Submatrices can be accessed with list indexing, e.g., res$prmats[[1]]$feature.names gives the variable names of the first submatrix.
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.
bdsvd, ispca
#Example: principal submatrices of 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)]
#First: run IS-PCA (or submit a identified block structure using bdsvd(...) or detect.blocks(...))
ispca.obj <- ispca(X = X, anp = "1")
#Second: extract the submatrices that explain at least 80% (default value) of the total variance
res <- prmats(X, block.structure = ispca.obj)
res
#One submatix is selected which contains 236 variables (out of 500) and explains
#81.67% of the total variance
length(res$prmats)
res$prmats[[1]]$p.b
round(res$prmats[[1]]$expl.var * 100, 2)
#Alternatively: extract the submatrices that explain five times more of the total variance
#than they should on average ('factor')
res <- prmats(X, block.structure = ispca.obj, rule = "enrich", value = 1.5)
res
#The highest 'factor' is 1.73
res <- prmats(X, block.structure = ispca.obj, rule = "enrich", value = 2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.