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

Module trigger_fits

source code

Functions [hide private]
 
fit_exponential(vals, thresh)
Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = alpha exp(-alpha (x-x_t)) above a threshold x_t.
source code
 
fit_rayleigh(vals, thresh)
Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = alpha x exp(-alpha (x**2-x_t**2)/2) above a threshold x_t.
source code
 
fit_power(vals, thresh)
Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = ((alpha-1)/x_t) (x/x_t)**-alpha above a threshold x_t.
source code
 
expfit(xvals, alpha, thresh)
The fitted exponential function normalized to 1 above threshold
source code
 
expfit_cum(xvals, alpha, thresh)
The integral of the exponential fit above a given value (reverse CDF) normalized to 1 above threshold
source code
 
rayleighfit(xvals, alpha, thresh)
The fitted Rayleigh function normalized to 1 above threshold
source code
 
rayleighfit_cum(xvals, alpha, thresh)
The integral of the Rayleigh fit above the x-values given (reverse CDF) normalized to 1 above threshold
source code
 
powerfit(xvals, alpha, thresh)
The fitted power-law function normalized to 1 above threshold
source code
 
powerfit_cum(xvals, alpha, thresh)
The integral of the power-law fit above the x-values given (reverse CDF) normalized to 1 above threshold
source code
 
fit_above_thresh(distr, vals, thresh=None)
Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = alpha exp(-alpha*x) above a given threshold.
source code
 
tail_threshold(vals, N=1000)
Determine a threshold above which there are N louder values
source code
 
fit_fn(distr, xvals, alpha, thresh)
The fitted function normalized to 1 above threshold
source code
 
cum_fit(distr, xvals, alpha, thresh)
The integral of the fitted function above a given value (reverse CDF) normalized to 1 above threshold
source code
 
KS_test(distr, vals, alpha, thresh=None)
Perform Kolmogorov-Smirnov test of the given set of discrete values above a given threshold for the fitted distribution function ex.: KS_test('exponential', vals, alpha, thresh) If no threshold is specified, the minimum sample value will be used.
source code
Variables [hide private]
  fitdict = {'exponential': fit_exponential, 'rayleigh': fit_ray...
  fndict = {'exponential': expfit, 'rayleigh': rayleighfit, 'pow...
  cum_fndict = {'exponential': expfit_cum, 'rayleigh': rayleighf...
Function Details [hide private]

fit_exponential(vals, thresh)

source code 

Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = alpha exp(-alpha (x-x_t)) above a threshold x_t.

vals: sequence of real numbers none of which lies below thresh thresh: threshold used in the fitting formula

fit_rayleigh(vals, thresh)

source code 

Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = alpha x exp(-alpha (x**2-x_t**2)/2) above a threshold x_t.

vals: sequence of real numbers none of which lies below thresh thresh: threshold used in the fitting formula

fit_power(vals, thresh)

source code 

Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = ((alpha-1)/x_t) (x/x_t)**-alpha above a threshold x_t.

vals: sequence of real numbers none of which lies below thresh thresh: threshold used in the fitting formula

expfit(xvals, alpha, thresh)

source code 

The fitted exponential function normalized to 1 above threshold

xvals: the values at which the fit PDF is to be evaluated alpha: the fitted exponent factor thresh: threshold value for the fitting process

To normalize to a given total count multiply by the count.

expfit_cum(xvals, alpha, thresh)

source code 

The integral of the exponential fit above a given value (reverse CDF) normalized to 1 above threshold

To normalize to a given total count multiply by the count.

rayleighfit(xvals, alpha, thresh)

source code 

The fitted Rayleigh function normalized to 1 above threshold

xvals: the values at which the fit PDF is to be evaluated alpha: the fitted exponent factor thresh: threshold value for the fitting process

To normalize to a given total count multiply by the count.

rayleighfit_cum(xvals, alpha, thresh)

source code 

The integral of the Rayleigh fit above the x-values given (reverse CDF) normalized to 1 above threshold

To normalize to a given total count multiply by the count.

powerfit(xvals, alpha, thresh)

source code 

The fitted power-law function normalized to 1 above threshold

xvals: the values at which the fit PDF is to be evaluated alpha: the fitted power thresh: threshold value for the fitting process

To normalize to a given total count multiply by the count.

powerfit_cum(xvals, alpha, thresh)

source code 

The integral of the power-law fit above the x-values given (reverse CDF) normalized to 1 above threshold

To normalize to a given total count multiply by the count.

fit_above_thresh(distr, vals, thresh=None)

source code 

Maximum likelihood fit for the coefficient alpha for a distribution of discrete values p(x) = alpha exp(-alpha*x) above a given threshold. Values below threshold will be discarded. If no threshold is specified, the minimum sample value will be used.

distr: name of distribution, either 'exponential' or 'rayleigh' or 'power'

vals: sequence of real numbers

thresh: threshold to apply before fitting - if thresh=None, use the lowest value

KS_test(distr, vals, alpha, thresh=None)

source code 

Perform Kolmogorov-Smirnov test of the given set of discrete values above a given threshold for the fitted distribution function ex.: KS_test('exponential', vals, alpha, thresh) If no threshold is specified, the minimum sample value will be used.

Returns the KS test statistic and its p-value: lower p means less probable under the hypothesis of a perfect fit


Variables Details [hide private]

fitdict

Value:
{'exponential': fit_exponential, 'rayleigh': fit_rayleigh, 'power': fi\
t_power}

fndict

Value:
{'exponential': expfit, 'rayleigh': rayleighfit, 'power': powerfit}

cum_fndict

Value:
{'exponential': expfit_cum, 'rayleigh': rayleighfit_cum, 'power': powe\
rfit_cum,}