Lv3_detection_level.py
def single_trial_prob(significance,N):
    """
    To obtain the single trial probability required for a statistically significant
    "significance" detection, with N trials.

    significance - the number of 'sigmas' desired for detection
    N - number of trials
    """
    prob = 1-special.erf(significance/np.sqrt(2))
    single_trial = 1 - (1 - prob)**(1/N)
    single_trial_signif = special.erfinv(1-single_trial)*np.sqrt(2)

    #print('The single trial probability required for a ' + str(significance) + ' sigma detection with ' + str(int(N)) + ' trials is ' + str(single_trial) + ', i.e., a significance of ' + str(single_trial_signif))

    return single_trial, single_trial_signif

    To obtain the single trial probability required for a statistically significant
    "significance" detection, with N trials.

    significance - the number of 'sigmas' desired for detection
    N - number of trials
    
To obtain the single trial probability required for a statistically significant
"significance" detection, with N trials.

the number of 'sigmas' desired for detection
N - number of trials
To obtain the single trial probability required for a statistically significant " significance " detection with N trials . the number of ' sigmas ' desired for detection N - number of trials
def single_trial_prob(significance,N):
    prob = 1-special.erf(significance/np.sqrt(2))
    single_trial = 1 - (1 - prob)**(1/N)
    single_trial_signif = special.erfinv(1-single_trial)*np.sqrt(2)
    return single_trial, single_trial_signif
def single_trial_prob ( significance , N ) : prob = 1 - special . erf ( significance / np . sqrt ( 2 ) ) single_trial = 1 - ( 1 - prob ) ** ( 1 / N ) single_trial_signif = special . erfinv ( 1 - single_trial ) * np . sqrt ( 2 ) return single_trial , single_trial_signif
To obtain the single trial probability required for a statistically significant
"significance" detection, with N trials.
To obtain the single trial probability required for a statistically significant " significance " detection with N trials .
"""
    To obtain the single trial probability required for a statistically significant
    "significance" detection, with N trials.

    significance - the number of 'sigmas' desired for detection
    N - number of trials
    """ #print('The single trial probability required for a ' + str(significance) + ' sigma detection with ' + str(int(N)) + ' trials is ' + str(single_trial) + ', i.e., a significance of ' + str(single_trial_signif))
significance
N