Package pylal :: Module PopStatement
[hide private]
[frames] | no frames]

Module PopStatement

source code

Classes [hide private]
  GRBdata
  PopStatement
Functions [hide private]
 
mannwhitney_u(x, y)
Return the Mann-Whitney U statistic on the provided scores.
source code
 
mannwhitney_p(U, n1, n2)
Return the right-tailed probability of the U value, assuming that N is sufficiently high.
source code
 
grbbinomial_Pmin_raw(localProb, Ndraws) source code
 
grbbinomialtest(localProb, Ndraws, Nmc, discreteness=None)
Adapted from https://trac.ligo.caltech.edu/xpipeline/browser/trunk/utilities/grbbinomialtest.m
source code
 
grbbinomialtest_threshold(Ndraws, Ntail, percentile, Nmc, discreteness=None, blocksize=10000)
Adapted from https://trac.ligo.caltech.edu/xpipeline/browser/trunk/utilities/grbbinomialtest_threshold.m
source code
Function Details [hide private]

mannwhitney_u(x, y)

source code 

Return the Mann-Whitney U statistic on the provided scores. Copied from scipy.stats.mannwhitneyu except that we only return the U such that large U means that population x was systematically larger than population y, rather than the smaller U between x and y. The two possible U values one can report are related by U' = n1*n2 - U.

grbbinomialtest(localProb, Ndraws, Nmc, discreteness=None)

source code 

Adapted from https://trac.ligo.caltech.edu/xpipeline/browser/trunk/utilities/grbbinomialtest.m

localProb is a *sorted* array of FAP values, one per GRB to be tested
Ndraws is a scalar saying how many GRBs were analyzed in total
Nmc is the number of Monte-Carlo simulations to perform in assessing
    significance.
discreteness is optional, but allows you to draw FAP values uniformly
    from multiples of 1 / discreteness

Pmin_raw     Lowest cumulative binomial probability of the input set
             localProb.  Note that this number does not account for the
             trials factor when length(localProb)>1.
Pmin         Probability that the tail of length(localProb) of a set of
             Ndraws uniformly distributed random numbers will give a
             cumulative binomial probability less than or equal to
             Pmin_raw.
Nmin         Number of tail values to include at which the binomial
             probability Pmin_raw occurs.

grbbinomialtest_threshold(Ndraws, Ntail, percentile, Nmc, discreteness=None, blocksize=10000)

source code 

Adapted from https://trac.ligo.caltech.edu/xpipeline/browser/trunk/utilities/grbbinomialtest_threshold.m

Ndraws is a scalar saying how many GRBs were analyzed in total
Ntail is the number of loudest GRB events kept
percentile is the desired percentile of the binomial probability
    distribution (This should be between 0 and 100!)
Nmc is the number of Monte-Carlo simulations to perform in assessing
    significance
discreteness is optional, but allows you to draw FAP values uniformly
    from multiples of 1 / discreteness

Return the threshold on Pmin for the given percentile and an array of the
    FAPs corresponding to that threshold for each k=1..Ntail at which
    we evaluate the binomial probability.