makto-toruk / FC_geodesic

code for NIMG paper
7 stars 3 forks source link

P vals for geo distance: permutation #8

Open ajdneuro12 opened 4 years ago

ajdneuro12 commented 4 years ago

Hello,

I have two question. I saw somewhere that there is matlab code for the geodesic distance procedure. Would you be able to put me in touch with who I can contact for that? Also, do you have an example of the code (that you would be willing to share) about how to calculate the p values. I have code to do so for pearson based ID via permutation testing but wondering if you had it for geodesic distance. Thanks again!

Best, Alex

makto-toruk commented 4 years ago

Hi Alex,

I'm attaching the Matlab code here. It's an early version so I recommend cross-checking it with the python code on this repository. distFC_geo.zip

Regarding the p-values, I'm not sure what you mean by you have a code for Pearson but not for geodesic. We've described the procedure in detail in Section 2.8 in [0]. The implementation to obtain bootstrapped accuracy is at [1].

Once you have the bootstrapped accuracy for both geodesic and Pearson, comparisons were done as follows: diff_score = (np.array(acc['geodesic']) - np.array(acc['pearson'])) /# acc['geodesic'] array of size number of bootstrap permutations ''' fischer transform to compute actual tvalue ''' dof = len(diff_score) - 1 diff_z_score = np.arctanh(diff_score) null = 0 t = (np.mean(diff_z_score) - null)/np.std(diff_z_score) p = 1 - stats.t.cdf(t, dof)

Best, Manasij

[0] https://www.sciencedirect.com/science/article/pii/S1053811919309899 [1] https://github.com/makto-toruk/FC_geodesic/blob/3762981256a044855b1d6a3803a7673795cd2c04/utils/FC_analyzer/whole_brain_FC_analyzer.py#L290

ajdneuro12 commented 4 years ago

Dear Manasij,

Thanks so much, this is so helpful. I have used the code to get the accuracies, get_accuracy.py, could you show me an example of what command can be used to compute and get the bootstrap accuracy. Thanks!

Best, Alex

On Wed, Sep 16, 2020 at 7:31 PM makto-toruk notifications@github.com wrote:

Hi Alex,

I'm attaching the Matlab code here. It's an early version so I recommend cross-checking it with the python code on this repository. distFC_geo.zip https://urldefense.com/v3/__https://github.com/makto-toruk/FC_geodesic/files/5235348/distFC_geo.zip__;!!NCZxaNi9jForCP_SxBKJCA!E2aAWiiHKdP6wZ5v73lS3heP4r4d27hwczovAHTQ_jFv1vZTzFknHf_7uvzRSHmn-geEfA$

Regarding the p-values, I'm not sure what you mean by you have a code for Pearson but not for geodesic. We've described the procedure in detail in Section 2.8 in [0]. The implementation to obtain bootstrapped accuracy is at [1].

Once you have the bootstrapped accuracy for both geodesic and Pearson, comparisons were done as follows: diff_score = (np.array(acc['geodesic']) - np.array(acc['pearson'])) acc['geodesic'] array of size number of bootstrap permutations

''' fischer transform to compute actual tvalue ''' dof = len(diff_score) - 1 diff_z_score = np.arctanh(diff_score) null = 0 t = (np.mean(diff_z_score) - null)/np.std(diff_z_score) p[cond] = 1 - stats.t.cdf(t, dof)

Best, Manasij

[0] https://www.sciencedirect.com/science/article/pii/S1053811919309899 https://urldefense.com/v3/__https://www.sciencedirect.com/science/article/pii/S1053811919309899__;!!NCZxaNi9jForCP_SxBKJCA!E2aAWiiHKdP6wZ5v73lS3heP4r4d27hwczovAHTQ_jFv1vZTzFknHf_7uvzRSHl1o6vskA$ [1] https://github.com/makto-toruk/FC_geodesic/blob/3762981256a044855b1d6a3803a7673795cd2c04/utils/FC_analyzer/whole_brain_FC_analyzer.py#L290 https://urldefense.com/v3/__https://github.com/makto-toruk/FC_geodesic/blob/3762981256a044855b1d6a3803a7673795cd2c04/utils/FC_analyzer/whole_brain_FC_analyzer.py*L290__;Iw!!NCZxaNi9jForCP_SxBKJCA!E2aAWiiHKdP6wZ5v73lS3heP4r4d27hwczovAHTQ_jFv1vZTzFknHf_7uvzRSHnCfJHxdQ$

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/makto-toruk/FC_geodesic/issues/8*issuecomment-693720203__;Iw!!NCZxaNi9jForCP_SxBKJCA!E2aAWiiHKdP6wZ5v73lS3heP4r4d27hwczovAHTQ_jFv1vZTzFknHf_7uvzRSHnoAd_Prg$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AJT2YLY3MATBFUBJGEL4TJDSGFDGHANCNFSM4RPMXE6A__;!!NCZxaNi9jForCP_SxBKJCA!E2aAWiiHKdP6wZ5v73lS3heP4r4d27hwczovAHTQ_jFv1vZTzFknHf_7uvzRSHmdwJK7QQ$ .

-- Alexander Dufford, Ph.D. Postdoctoral Fellow Yale Child Study Center Yale School of Medicine He/Him/His