bdsvd.structure {bdsvd}R Documentation

Data Matrix Structure According to the Detected Block Structure.

Description

Either sorts the data matrix X according to the detected block structure X_1 , ... , X_b, ordered by the number of variables that the blocks contain. Or returns the detected submatrices each individually in a list object.

Usage

bdsvd.structure(X, block.structure, output = "matrix", block.order)

Arguments

X

Data matrix of dimension n x p with possibly p >> n.

block.structure

Output of bdsvd() or single.bdsvd() which identified the block structure.

output

Should the output be the data matrix ordered according to the blocks ("matrix"), or a list containing the submatrices ("submatrices"). Default is "matrix".

block.order

A vector that contains the order of the blocks detected by bdsvd() or single.bdsvd(). The vector must contain the index of each blocks exactly once. Default is 1:b where b is the total number of blocks.

Value

Either the data matrix X with columns sorted according to the detected blocks, or a list containing the detected submatrices.

References

Bauer, J.O. (202Xa). High-dimensional block diagonal covariance structure detection using singular vectors.

See Also

bdsvd, single.bdsvd

Examples

#Toying with the illustrative example from Bauer (202Xa).


p <- 150 #Number of variables. In Bauer (202Xa), p = 3000.
n <- 500 #Number of observations
b <- 3   #Number of blocks
design <- "c"

#Simulate data matrix X
set.seed(1)
Sigma <- bdsvd.cov.sim(p = p, b = b, design = design)
X <- mvtnorm::rmvnorm(n, mean=rep(0, p), sigma=Sigma)
colnames(X) <- seq_len(p)

#Compute iterative BD-SVD
bdsvd.obj <- bdsvd(X, standardize = FALSE)

#Obtain the data matrix X, sorted by the detected blocks
colnames(bdsvd.structure(X, bdsvd.obj, output = "matrix") )
colnames(bdsvd.structure(X, bdsvd.obj, output = "matrix", block.order = c(2,1,3)) )

#Obtain the detected submatrices X_1, X_2, and X_3
colnames(bdsvd.structure(X, bdsvd.obj, output = "submatrices")[[1]] )
colnames(bdsvd.structure(X, bdsvd.obj, output = "submatrices")[[2]] )
colnames(bdsvd.structure(X, bdsvd.obj, output = "submatrices")[[3]] )


[Package bdsvd version 0.2.0 Index]