-
Notifications
You must be signed in to change notification settings - Fork 0
MSNR
cedricx edited this page Sep 16, 2019
·
5 revisions
/cbica/projects/GURLAB/projects/xia_MSNR/data/original_data.RData
- Organization:
-
As.all
: adjacency matrices for n=1051 subjects -
Xs.all
: covariates for n=1051 subjects -
Ks
: community assignment (p=236 Power264 without unassigned nodes) -
list.not.valid
: combined training and testing sample (n = 813) -
list.valid
: combined training and testing sample (n = 202) -
lists.train
: a list of five vectors, each contains a training vector for 5-fold cross-validation -
lists.test
:a list of five vectors, each contains a testing vector for 5-fold cross-validation
/cbica/projects/GURLAB/projects/xia_MSNR/script/script
- Organization:
-
functions.R
: script that contains the actual code for MSNR
-
org_par_fold.R
: script performs one five-fold cross-validation of MSNR on the data. Here you need to changeserverDir
,workingdir
,outdir
, andsave the result
section as appropriate to your project.lam1.vals
andlam2.vals
control the search parameter space. Additionally, to select n=150, set this up in the code blocksassemble data
andgenerate sets
. See an example below. - 'org_par_fold_job_submit.sh': _Here you need to change
logFile
,codeDir
as appropriate to your project.
-
perm_par_fold.R
: script performs one five-fold cross-validation of MSNR on the data. Here you need to changeserverDir
,workingdir
,outdir
, andsave the result
section as appropriate to your project.lam1.vals
andlam2.vals
control the search parameter space. Additionally, to select n=150, set this up in the code blockassemble data
andgenerate sets
. - 'perm_par_fold_job_submit.sh': _Here you need to change
logFile
,codeDir
as appropriate to your projlsect.
As.train = As.not.valid[lists.train[[f]][1:100],,]
As.test = As.not.valid[lists.test[[f]][1:50],,]
Once you have everything set up as above (appropriate paths and variables have been named and changed), you can just execute org_par_fold_job_submit.sh
to get the model of MSNR on the original data, and perm_par_fold_job_submit.sh
to get the permuted models of MSNR on the permutated data. I will add the analysis code later as well as you work through generate these results.
Note, the run time is long since it's 5 fold over 1001 runs. On CBICA
, it took me 2-3 days when everything ran perfectly.
The key outputs are model_out
, best_lam1
, best_lam2
, As.valid.error
, and As.test.matrix
.
-
As.test.matrix
: this is the cross-validation error matrix averaged across five folds. -
best_lam1
andbest_lam2
are the penalities gave the best (lowest) error in the 5-fold cross-validation. -
As.valid.error
is the error in the true validation set, which should be comparable to the lowest in theAs.test.matrix
. This is also the value to which all permutation runs should be compared to. -
model_out
contains all the meat! And the most important one isgamma
, which contains the coefficient matrix for each covariate ran. Specifically,gamma
is a 3d matrix, x * p * p, where x is the number of covariates and p is the number of community. For example,gamma[1,:,:]
denotes the community-level relationship between covariate 1 and all the community connectivities.theta
is the low-rank mean connectivity matrix across subjects.