Lv3_detection_level.py
def power_for_sigma(significance,N,M,W):
    """
    Given some probability (that is, desired significance), what is the corresponding
    power needed in the power spectrum to claim statistical significance? Use the
    inverse survival function for this!

    significance - the number of 'sigmas' desired for detection
    N - number of trials
    M - number of segments
    W - number of consecutive bins summed
    """
    Q,sigfig = single_trial_prob(significance,N) #single trial probability
    dof = 2*M*W
    chi2 = stats.chi2.isf(Q,dof)
    power_required = chi2/(M*W)

    return power_required

    Given some probability (that is, desired significance), what is the corresponding
    power needed in the power spectrum to claim statistical significance? Use the
    inverse survival function for this!

    significance - the number of 'sigmas' desired for detection
    N - number of trials
    M - number of segments
    W - number of consecutive bins summed
    
Given some probability (that is, desired significance), what is the corresponding
power needed in the power spectrum to claim statistical significance. Use the
inverse survival function for this!

the number of 'sigmas' desired for detection
N - number of trials
M - number of segments
W - number of consecutive bins summed
Given some probability ( that is desired significance ) what is the corresponding power needed in the power spectrum to claim statistical significance . Use the inverse survival function for this! the number of ' sigmas ' desired for detection N - number of trials M - number of segments W - number of consecutive bins summed
def power_for_sigma(significance,N,M,W):
    Q,sigfig = single_trial_prob(significance,N) 
    dof = 2*M*W
    chi2 = stats.chi2.isf(Q,dof)
    power_required = chi2/(M*W)
    return power_required
def power_for_sigma ( significance , N , M , W ) : Q , sigfig = single_trial_prob ( significance , N ) dof = 2 * M * W chi2 = stats . chi2 . isf ( Q , dof ) power_required = chi2 / ( M * W ) return power_required
Given some probability (that is, desired significance), what is the corresponding
power needed in the power spectrum to claim statistical significance?
Given some probability ( that is desired significance ) what is the corresponding power needed in the power spectrum to claim statistical significance?
"""
    Given some probability (that is, desired significance), what is the corresponding
    power needed in the power spectrum to claim statistical significance? Use the
    inverse survival function for this!

    significance - the number of 'sigmas' desired for detection
    N - number of trials
    M - number of segments
    W - number of consecutive bins summed
    """ #single trial probability
significance
N
M
W