Permutation testing on Brain_Data ("randomise")#286
Permutation testing on Brain_Data ("randomise")#286ljchang merged 13 commits intocosanlab:masterfrom ejolly:master
Conversation
…parallelized currently.
ljchang
left a comment
There was a problem hiding this comment.
Nice!, Might be nice to also add an option for thresholding like we do in .ttest(). 'thr_t'. FDR is easy. I have a separate branch I've been working on with TFCE
nltools/stats.py
Outdated
|
|
||
| for i in range(n_permute): | ||
| _, _t = regress(func(X.values), Y, stats='tstats', **kwargs) | ||
| p += np.abs(_t) >= np.abs(t) |
There was a problem hiding this comment.
Does this mean this method can only do one-sided permutation tests?
There was a problem hiding this comment.
Just changed this so we can do both 1 and 2 tailed
There was a problem hiding this comment.
Also added thresholding
…er than resolution of current Brain_Data object. Also fixed bug where iplot would fail to render background image.
|
Added some fixes to plotting. Sometimes if the image resolution was different than the MNI_Template preferences setting, the template prefences would override resulting in the wrong background image being visualized (e.g. 3mm data on 2mm anatomical). Also fixed the bug in iplot that would fail to render the anatomical sometimes. |
…rom stats or ttest() from Brain_Data.
|
@ejolly: is this ready to be merged? |
…th flag coerce_nan
…th flag coerce_nan Forgot to add argument.
Added a stats function and method for permutation testing. Works in the and 2 samples cases. Currently not parallelized because we'd have to share memory in joblib and not sure if that's super efficient/best way to do that. 1 sample sign-flip t-test with ~30 subjects takes about 1 minute without parallelization.