Title: | Low-Rank Decomposition of Brain Connectivity Matrices with Uniform Sparsity |
---|---|
Description: | To decompose symmetric matrices such as brain connectivity matrices so that one can extract sparse latent component matrices and also estimate mixing coefficients, a blind source separation (BSS) method named LOCUS was proposed in Wang and Guo (2023) <arXiv:2008.08915>. For brain connectivity matrices, the outputs correspond to sparse latent connectivity traits and individual-level trait loadings. |
Authors: | Yikai Wang [aut, cph], Jialu Ran [aut, cre], Ying Guo [aut, ths] |
Maintainer: | Jialu Ran <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2024-11-11 06:52:52 UTC |
Source: | CRAN |
This is the main function in the package. It conducts the LOCUS approach for decomposing brain connectivity data into subnetworks.
LOCUS(Y, q, V, MaxIteration=100, penalty="SCAD", phi = 0.9, approximation=TRUE, preprocess=TRUE, espli1=0.001, espli2=0.001, rho=0.95, silent=FALSE)
LOCUS(Y, q, V, MaxIteration=100, penalty="SCAD", phi = 0.9, approximation=TRUE, preprocess=TRUE, espli1=0.001, espli2=0.001, rho=0.95, silent=FALSE)
Y |
Group-level connectivity data from N subjects, which is of dimension N x p, where p is number of edges. Each row of Y represents a subject's vectorized connectivity matrix by |
q |
Number of ICs/subnetworks to extract. |
V |
Number of nodes in the network. Note: p should be equal to V(V-1)/2. |
MaxIteration |
Maximum number of iteractions. |
penalty |
The penalization approach for uniform sparsity, which can be |
phi |
|
approximation |
Whether to use an approximated algorithm to speed up the algorithm. |
preprocess |
Whether to preprocess the data, which reduces the data dimension to |
espli1 |
Toleration for convergence on mixing coefficient matrix, i.e. A. |
espli2 |
Toleration for convergence on latent sources, i.e. S. |
rho |
|
silent |
Whether to print intermediate steps. |
This is the main function for LOCUS decomposition of brain connectivity matrices, which is to minimize the following objective function:
where is the transpose of
th row in
,
represents the
th vectorized latent source/subnetwork with low-rank decomposition,
is
Ltrans
function, represents the penalty which can either be NULL, L1, or SCAD (Fan & Li, 2001).
If user want to do BIC parameter selection of before calling LOCUS main function, one can use
LOCUS_BIC_selection
to find the best parameter set. Further details can be found in the LOCUS paper.
An R list from Locus containing the following terms:
Conver |
Whether the algorithm is converaged. |
A |
Mixing matrix |
S |
Subnetworks of dimension q by p, where each row represents a vectorized subnetwork based on |
theta |
A list of length q, where |
Wang, Y. and Guo, Y. (2023). LOCUS: A novel signal decomposition method for brain network connectivity matrices using low-rank structure with uniform sparsity. Annals of Applied Statistics.
Fan, J., & Li, R. (2001). Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American statistical Association, 96(456), 1348-1360.
## Simulated the data to use. V = 50 S1 = S2 = S3 = matrix(0,ncol = V,nrow = V) S1[5:20,5:20] = 4;S1[23:37,23:37] = 3;S1[40:48,40:48] = 3 S2[15:20,] = -3;S2[,15:20] = -3 S3[15:25,36:45] = 3; S3[36:45,15:25] = 3 Struth = rbind(Ltrans(S1,FALSE) , Ltrans(S2,FALSE), Ltrans(S3,FALSE)) set.seed(100) Atruth = matrix(rnorm(100*3),nrow=100,ncol=3) Residual = matrix(rnorm(100*dim(Struth)[2]),nrow=100) Yraw = Atruth%*%Struth + Residual ##### Run Locus on the data ##### Locus_result = LOCUS(Yraw,3,V) oldpar = par(mfrow=c(2,3)) for(i in 1:dim(Struth)[1]){image(Ltrinv(Struth[i,],V,FALSE))} for(i in 1:dim(Locus_result$S)[1]){image(Ltrinv(Locus_result$S[i,],V,FALSE))} par(oldpar)
## Simulated the data to use. V = 50 S1 = S2 = S3 = matrix(0,ncol = V,nrow = V) S1[5:20,5:20] = 4;S1[23:37,23:37] = 3;S1[40:48,40:48] = 3 S2[15:20,] = -3;S2[,15:20] = -3 S3[15:25,36:45] = 3; S3[36:45,15:25] = 3 Struth = rbind(Ltrans(S1,FALSE) , Ltrans(S2,FALSE), Ltrans(S3,FALSE)) set.seed(100) Atruth = matrix(rnorm(100*3),nrow=100,ncol=3) Residual = matrix(rnorm(100*dim(Struth)[2]),nrow=100) Yraw = Atruth%*%Struth + Residual ##### Run Locus on the data ##### Locus_result = LOCUS(Yraw,3,V) oldpar = par(mfrow=c(2,3)) for(i in 1:dim(Struth)[1]){image(Ltrinv(Struth[i,],V,FALSE))} for(i in 1:dim(Locus_result$S)[1]){image(Ltrinv(Locus_result$S[i,],V,FALSE))} par(oldpar)
This function is to conduct the BIC-based hyper-parameters selection for LOCUS.
LOCUS_BIC_selection(Y, q, V, MaxIteration=50, penalty="SCAD", phi_grid_search=seq(0.2, 1, 0.2), rho_grid_search=c(0.95), espli1=0.001, espli2=0.001, save_LOCUS_output=TRUE, preprocess=TRUE)
LOCUS_BIC_selection(Y, q, V, MaxIteration=50, penalty="SCAD", phi_grid_search=seq(0.2, 1, 0.2), rho_grid_search=c(0.95), espli1=0.001, espli2=0.001, save_LOCUS_output=TRUE, preprocess=TRUE)
Y |
Group-level connectivity data from N subjects, which is of dimension N x p, where p is number of edges. Each row of Y represents a subject's vectorized connectivity matrix by |
q |
Number of ICs/subnetworks to extract. |
V |
Number of nodes in the network. Note: p should be equal to V(V-1)/2. |
MaxIteration |
Maximum number of iteractions. |
penalty |
The penalization approach for uniform sparsity, which can be |
phi_grid_search |
Grid search candidates for tuning parameter of uniform sparse penalty. |
espli1 |
Toleration for convergence on mixing coefficient matrix, i.e. A. |
espli2 |
Toleration for convergence on latent sources, i.e. S. |
rho_grid_search |
Grid search candidates for tuning parameter for selecting number of ranks in each subnetwork's decomposition. |
save_LOCUS_output |
Whether to save LOCUS output from each grid search. |
preprocess |
Whether to preprocess the data, which reduces the data dimension to |
In Wang, Y. and Guo, Y. (2023), the tuning parameters for learning the LOCUS model include . The BIC-type criterion is proposed to select those parameters.
where denotes the pdf of a multivariate Gaussian distribution,
,
denotes the
norm . This criterion balances between model fitting and model sparsity.
bic_tab |
BIC values per phi and rho. |
LOCUS_results |
LOCUS output, if save_LOCUS_output is TRUE. |
## Simulated the data to use. V = 50 S1 = S2 = S3 = matrix(0,ncol = V,nrow = V) S1[5:20,5:20] = 4;S1[23:37,23:37] = 3;S1[40:48,40:48] = 3 S2[15:20,] = -3;S2[,15:20] = -3 S3[15:25,36:45] = 3; S3[36:45,15:25] = 3 Struth = rbind(Ltrans(S1,FALSE) , Ltrans(S2,FALSE), Ltrans(S3,FALSE)) set.seed(100) Atruth = matrix(rnorm(100*3),nrow=100,ncol=3) Residual = matrix(rnorm(100*dim(Struth)[2]),nrow=100) Yraw = Atruth%*%Struth + Residual ##### Run Locus on the data ##### Locus_bic_result = LOCUS_BIC_selection(Yraw,3,V) print(Locus_bic_result$bic_tab) # line plot plot(Locus_bic_result$bic_tab[,2], Locus_bic_result$bic_tab[,3], type = "b", xlab = "phi", ylab = "BIC") # visualize the best result based on BIC idx = which.min(Locus_bic_result$bic_tab[,3]) oldpar = par(mfrow=c(2,3)) for(i in 1:3){image(Ltrinv(Struth[i,], V, FALSE))} for(i in 1:3){image(Ltrinv(Locus_bic_result$LOCUS_results[[idx]]$LOCUS$S[i,], V, FALSE))} par(oldpar)
## Simulated the data to use. V = 50 S1 = S2 = S3 = matrix(0,ncol = V,nrow = V) S1[5:20,5:20] = 4;S1[23:37,23:37] = 3;S1[40:48,40:48] = 3 S2[15:20,] = -3;S2[,15:20] = -3 S3[15:25,36:45] = 3; S3[36:45,15:25] = 3 Struth = rbind(Ltrans(S1,FALSE) , Ltrans(S2,FALSE), Ltrans(S3,FALSE)) set.seed(100) Atruth = matrix(rnorm(100*3),nrow=100,ncol=3) Residual = matrix(rnorm(100*dim(Struth)[2]),nrow=100) Yraw = Atruth%*%Struth + Residual ##### Run Locus on the data ##### Locus_bic_result = LOCUS_BIC_selection(Yraw,3,V) print(Locus_bic_result$bic_tab) # line plot plot(Locus_bic_result$bic_tab[,2], Locus_bic_result$bic_tab[,3], type = "b", xlab = "phi", ylab = "BIC") # visualize the best result based on BIC idx = which.min(Locus_bic_result$bic_tab[,3]) oldpar = par(mfrow=c(2,3)) for(i in 1:3){image(Ltrinv(Struth[i,], V, FALSE))} for(i in 1:3){image(Ltrinv(Locus_bic_result$LOCUS_results[[idx]]$LOCUS$S[i,], V, FALSE))} par(oldpar)
This function is to map the upper triganle part of a symmetric matrix into a vector.
Ltrans(X, d = TRUE)
Ltrans(X, d = TRUE)
X |
A symmetric matrix of dimentional V by V. |
d |
Whether to include the diagonal part of |
A vector containing the upper triganle part of X
.
Ltrans
to map back a vector into a symmetric matrix. This function is the inverse function of Ltrans
, which is to map a vector back to a symmetric matrix.
Ltrinv(x, V, d = TRUE)
Ltrinv(x, V, d = TRUE)
x |
A vector to convert to a matrix, which is of length p. |
V |
Dimension of the matrix which |
d |
Whether diagonal is kept in |
A symmetric matrix whose upper triangle part is x
.