@@ -67,6 +67,9 @@ def maxT(diff_arr, nullmean=0, alpha=.05, tail=1, permutations=1000, nproc=1, pv
67
67
elif tail == - 1 :
68
68
topPercVal_maxT_inx = int (len (maxT_dist_sorted )* (alpha ))
69
69
maxT_thresh = maxT_dist_sorted [topPercVal_maxT_inx ]
70
+ elif tail == 0 :
71
+ topPercVal_maxT_inx = int (len (maxT_dist_sorted )* (1 - alpha ))
72
+ maxT_thresh = maxT_dist_sorted [topPercVal_maxT_inx ]
70
73
# elif tail == 0:
71
74
# topPercVal_maxT_inx = int(len(maxT_dist_sorted)*(alpha/2.0))
72
75
# botPercVal_maxT_inx = int(len(maxT_dist_sorted)*(1-alpha/2.0))
@@ -88,10 +91,10 @@ def maxT(diff_arr, nullmean=0, alpha=.05, tail=1, permutations=1000, nproc=1, pv
88
91
if tail == 1 :
89
92
p_fwe = 1.0 - p_fwe
90
93
91
- return t , ( topT_thresh , botT_thresh ) , p_fwe
94
+ return t , maxT_thresh , p_fwe
92
95
93
96
else :
94
- return t , ( topT_thresh , botT_thresh )
97
+ return t , maxT_thresh
95
98
96
99
97
100
def _maxTpermutation ((diff_arr ,nullmean ,tail ,seed )):
@@ -184,6 +187,9 @@ def maxR(diff_arr, behav_arr, alpha=.05, tail=0, permutations=1000, nproc=1, pva
184
187
elif tail == - 1 :
185
188
topPercVal_maxR_inx = int (len (maxR_dist_sorted )* (alpha ))
186
189
maxR_thresh = maxR_dist_sorted [topPercVal_maxR_inx ]
190
+ elif tail == 0 :
191
+ topPercVal_maxR_inx = int (len (maxR_dist_sorted )* (1 - alpha ))
192
+ maxR_thresh = maxR_dist_sorted [topPercVal_maxR_inx ]
187
193
# elif tail == 0:
188
194
# topPercVal_maxR_inx = int(len(maxR_dist_sorted)*(alpha/2.0))
189
195
# botPercVal_maxR_inx = int(len(maxR_dist_sorted)*(1-alpha/2.0))
@@ -221,7 +227,7 @@ def _maxRpermutation((data_normed,behav_normed,tail,seed)):
221
227
# Randomly permute behavioral data along 2nd dimension (subjects). Note: np.random.shuffle() requires transposes
222
228
np .take (behav_normed ,np .random .rand (behav_normed .shape [1 ]).argsort (),axis = 1 ,out = behav_normed )
223
229
# Randomly permute measurement data along 2nd dimension (subjects). Note: np.random.shuffle() requires transposes
224
- np .take (data_normed ,np .random .rand (data_normed .shape [1 ]).argsort (),axis = 1 ,out = data_normed )
230
+ # np.take(data_normed,np.random.rand(data_normed.shape[1]).argsort(),axis=1,out=data_normed)
225
231
# Calculating Pearson correlations in a vectorized format (increasing speed)
226
232
r_values = np .mean (np .multiply (behav_normed ,data_normed ),axis = 1 )
227
233
0 commit comments