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 |
block.structure |
Output of |
output |
Should the output be the data matrix ordered according to the blocks ( |
block.order |
A vector that contains the order of the blocks detected by |
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
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]] )