E.global.wt

14 views
Skip to first unread message

Jaiashre Sridhar

unread,
Jun 15, 2018, 12:51:52 PM6/15/18
to brainGraph-help
Hi Chris,

The global efficiency weighted values generated from  set_brainGraph_attr() is different from the 'original' values provided by the brainGraph_boot(). The values provided for other graph measures are always the same from both the functions. Are the E.global.wt measures calculated any different in these functions? 

From set_brainGraph_attr():

> g[[1]][[1]]$E.global.wt
[1] 0.3836899
> g[[2]][[1]]$E.global.wt
[1] 0.3267428
 
From brainGraph_boot():
> bootmod
$measure
[1] "E.global.wt"

$densities
[1] 0.26

$groups
[1] "Control" "Super"  

$conf
[1] 0.95

$boot
$boot$Control

ORDINARY NONPARAMETRIC BOOTSTRAP


Call:
boot(data = resids[x], statistic = intfun, R = R, measure = measure, 
    parallel = my.parallel, ncpus = ncpus, cl = cl)


Bootstrap Statistics :
     original     bias    std. error
t1* 0.7073765 0.01227263   0.1410508

$boot$Super

ORDINARY NONPARAMETRIC BOOTSTRAP


Call:
boot(data = resids[x], statistic = intfun, R = R, measure = measure, 
    parallel = my.parallel, ncpus = ncpus, cl = cl)


Bootstrap Statistics :
     original      bias    std. error
t1* 0.8916511 -0.03796329  0.08247457


attr(,"class")
[1] "brainGraph_boot" "list"           


Thank you very much,
Jaiashre.  

Chris Watson

unread,
Jun 15, 2018, 4:08:44 PM6/15/18
to brainGr...@googlegroups.com
Can you show me:

1. The exact function call you used to get that result.
2. The output of "summary(bootmod)"
3. If the result you showed is equal to "E.global" for the groups (i.e., the *un*weighted efficiency).

Thanks,
Chris

--
You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-help+unsubscribe@googlegroups.com.
To post to this group, send email to brainGraph-help@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/11ee9c11-3262-49e0-b85d-c29461dfd39c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jaiashre Sridhar

unread,
Jun 15, 2018, 4:41:11 PM6/15/18
to brainGraph-help
Hi Chris,


1. 
Set attributes:
g <- lapply(corrs, function(x) apply(x$r.thresh, 3, function(y) graph_from_adjacency_matrix(x$R * y, mode= 'undirected', diag=F, weighted=T)))

g <- Map(function(x, y) llply(x, set_brainGraph_attr, atlas=atlas, modality=modality, group=y, .progress='text'), g, as.list(groups))

Bootstrapping:
kNumBoot <- 1e3
bootmod <- brainGraph_boot(densities, resids.all, R=kNumBoot, measure='E.global.wt', .progress=FALSE)


2. Summary: 
>summary(bootmod)
Bootstrap analysis
-----------------------------------------------------------------------
Graph metric:  Global efficiency (weighted) 
Number of bootstrap samples generated:  1000 
95 % confidence intervals

     Group density  Observed         se    ci.low   ci.high
1: Control    0.26 0.7073765 0.14594472 0.4051170 0.9772098
2:   Super    0.26 0.8916511 0.08869413 0.7573587 1.1050333

______________________

>g[[1]][[1]]$E.global.wt
[1] 0.3836899

>g[[2]][[1]]$E.global.wt
[1] 0.3267428


3. The result is not equal to the unweighted E.global:
>bootmod <- brainGraph_boot(densities, resids.all, R=kNumBoot, measure='E.global', .progress=FALSE)
> summary(bootmod)
Bootstrap analysis
-----------------------------------------------------------------------
Graph metric:  Global efficiency 
Number of bootstrap samples generated:  1000 
95 % confidence intervals

     Group density  Observed         se    ci.low   ci.high
1: Control    0.26 0.5093649 0.03568912 0.4239520 0.5638508
2:   Super    0.26 0.5233611 0.02618197 0.4702517 0.5728831

______________________

> g[[1]][[1]]$E.global
[1] 0.5093649

> g[[2]][[1]]$E.global
[1] 0.5233611


Thanks,
Jaiashre. 
To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-he...@googlegroups.com.
To post to this group, send email to brainGr...@googlegroups.com.

Chris Watson

unread,
Jun 15, 2018, 6:12:33 PM6/15/18
to brainGr...@googlegroups.com
Hmm, that is strange. First, I assume that "g[[1]][[1]]" is the graph with density equal to 0.26? i.e., you are only looking at a single density?

Could you please send me the relevant variables so I can recreate and debug on my end? So you could do:

save(densities, corrs, resids.all, g, file='bug_boot.rda')

You can send this to me off-list if you prefer.
Chris

To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-help+unsubscribe@googlegroups.com.
To post to this group, send email to brainGraph-help@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/448b4f03-4212-4be6-bc22-e42c0966bdba%40googlegroups.com.

Chris Watson

unread,
Jun 18, 2018, 2:43:10 PM6/18/18
to brainGr...@googlegroups.com
Hi Jaiashre, I received your data and did some testing. The problem here occurred because calculating *weighted* global efficiency requires transforming the edge weights (e.g., by inverting them), since it is a distance-based metric. The edge weights are not transformed from within the bootstrapping function. I will fix this (and a few other minor bugs I found) in the coming week.

Chris

Jaiashre Sridhar

unread,
Jun 18, 2018, 4:11:05 PM6/18/18
to brainGraph-help
Thank you, Chris! 

Can bootstrapping be performed for measures that are not available by default? I would like to perform bootstrapping for weighted rich club coefficient (rich.wt).

Thank you,
Jaiashre. 

Chris Watson

unread,
Jun 18, 2018, 5:10:57 PM6/18/18
to brainGr...@googlegroups.com
1. Not using the current version of my function, no. But it shouldn't be difficult to extend it to accept custom functions.
2. Weighted rich club coefficient, on the other hand, would be tricky. This is because, for a given graph, there are multiple values for "phi": one for each vertex degree in the graph. So you would have to decide in some way how to return a single number for each graph. If you can figure that out, then I can give you some code to make it work.

To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-help+unsubscribe@googlegroups.com.
To post to this group, send email to brainGraph-help@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/9fcabbdd-7cc0-4ce7-b094-edabf2f09aae%40googlegroups.com.

Sean Ma

unread,
Jul 12, 2018, 10:19:35 AM7/12/18
to brainGraph-help
Hi Chris, 

I would like to follow up on your 1st point in your reply - extending custom functions.

Can provide some documentation regarding on howtos? Say there are some some functions in the `set_brainGraph_attr()` that I would like to change to another algorithm or function. What would be a better way to do that rather than doing it in the *debug* mode?

Sean

Chris Watson

unread,
Jul 12, 2018, 1:00:11 PM7/12/18
to brainGr...@googlegroups.com
For "set_brainGraph_attr", there probably isn't an easy way aside from either running "debug" mode, or editing the function yourself, saving it to disk, and loading it when you want. Really the best thing in this case is to calculate your metrics of interest in your own function/script. I am currently working on updating "set_brainGraph_attr" to allow for any community detection algorithm (not just Louvain, as it currently is). For other metrics/algorithms, there aren't alternatives in the same way.

To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-help+unsubscribe@googlegroups.com.
To post to this group, send email to brainGraph-help@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/607b3b79-8755-469b-bd1b-4789232a3eed%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages