def computeSplitHalf_dprime(self, pair_trial_data, boot, starttrial, verbose=False, correct=True, plot_=False, trial_data=None):
    import scipy.stats
    count = [len(trial) for trial in pair_trial_data]
    corr_dprime = []
    for i in range(boot):
        temp = []
        for w in range(((min(count) - starttrial) + 1)):
            a = [random.sample(trial, (w + starttrial)) for trial in pair_trial_data]
            subsample = len(a[0])
            Rs = []
            for b in range(boot):
                half1 = []
                half2 = []
                for t in a:
                    np.random.shuffle(t)
                if ((int(subsample) % 2) == 0):
                    half1.extend(t[0:(subsample / 2)])
                    half2.extend(t[((- subsample) / 2):])
                else:
                    half1.extend(t[0:((subsample / 2) + 1)])
                    half2.extend(t[((- subsample) / 2):])
                (CM1, combs) = self.getPopCM2x2fast(half1)
                (CM2, combs) = self.getPopCM2x2fast(half2)
                half1_dprime = []
                half2_dprime = []
                for mat in range(0, len(CM1)):
                    half1_dprime.append(d_prime2x2(CM1[mat]))
                    half2_dprime.append(d_prime2x2(CM2[mat]))
                Rs.append(scipy.stats.spearmanr(half1_dprime, half2_dprime)[0])
            temp.append(np.ma.masked_invalid(Rs).mean(0))
        corr_dprime.append(temp)
        return corr_dprime
def computeSplitHalf_dprime(self, pair_trial_data, boot, starttrial, verbose=False, correct=True, plot_=False, trial_data=None):
    import scipy.stats
    count = [len(trial) for trial in pair_trial_data]
    corr_dprime = []
    for i in range(boot):
        temp = []
        for w in range(((min(count) - starttrial) + 1)):
            a = [random.sample(trial, (w + starttrial)) for trial in pair_trial_data]
            subsample = len(a[0])
            Rs = []
            for b in range(boot):
                half1 = []
                half2 = []
                for t in a:
                    np.random.shuffle(t)
                if ((int(subsample) % 2) == 0):
                    half1.extend(t[0:(subsample / 2)])
                    half2.extend(t[((- subsample) / 2):])
                else:
                    half1.extend(t[0:((subsample / 2) + 1)])
                    half2.extend(t[((- subsample) / 2):])
                (CM1, combs) = self.getPopCM2x2fast(half1)
                (CM2, combs) = self.getPopCM2x2fast(half2)
                half1_dprime = []
                half2_dprime = []
                for mat in range(0, len(CM1)):
                    half1_dprime.append(d_prime2x2(CM1[mat]))
                    half2_dprime.append(d_prime2x2(CM2[mat]))
                Rs.append(scipy.stats.spearmanr(half1_dprime, half2_dprime)[0])
            temp.append(np.ma.masked_invalid(Rs).mean(0))
        corr_dprime.append(temp)
        return corr_dprime