Robust Statistics

Changed in version 0.4.0: Function names have been changed in this module and new function added. See the below for more details.

lsl.statistics.robust.biweightMean(inputData, axis=None, dtype=None)

Calculate the mean of a data set using bisquare weighting.

Based on the biweight_mean routine from the AstroIDL User’s Library.

Changed in version 1.0.3: Added the ‘axis’ and ‘dtype’ keywords to make this function more compatible with numpy.mean()

lsl.statistics.robust.mean(inputData, Cut=3.0, axis=None, dtype=None)

Robust estimator of the mean of a data set. Based on the resistant_mean function from the AstroIDL User’s Library.

Changed in version 1.2.1: Added a ValueError if the distriubtion is too strange

Changed in version 1.0.3: Added the ‘axis’ and ‘dtype’ keywords to make this function more compatible with numpy.mean()

lsl.statistics.robust.mode(inputData, axis=None, dtype=None)

Robust estimator of the mode of a data set using the half-sample mode.

lsl.statistics.robust.std(inputData, Zero=False, axis=None, dtype=None)

Robust estimator of the standard deviation of a data set.

Based on the robust_sigma function from the AstroIDL User’s Library.

Changed in version 1.2.1: Added a ValueError if the distriubtion is too strange

Changed in version 1.0.3: Added the ‘axis’ and ‘dtype’ keywords to make this function more compatible with numpy.std()

lsl.statistics.robust.checkfit(inputData, inputFit, epsilon, delta, BisquareLimit=6.0)

Determine the quality of a fit and biweights. Returns a tuple with elements:

  1. Robust standard deviation analog
  2. Fractional median absolute deviation of the residuals
  3. Number of input points given non-zero weight in the calculation
  4. Bisquare weights of the input points
  5. Residual values scaled by sigma

This function is based on the rob_checkfit routine from the AstroIDL User’s Library.

lsl.statistics.robust.linefit(inputX, inputY, iterMax=25, Bisector=False, BisquareLimit=6.0, CloseFactor=0.03)

Outlier resistance two-variable linear regression function.

Based on the robust_linefit routine in the AstroIDL User’s Library.

lsl.statistics.robust.polyfit(inputX, inputY, order, iterMax=25)

Outlier resistance two-variable polynomial function fitter.

Based on the robust_poly_fit routine in the AstroIDL User’s Library.

Unlike robust_poly_fit, two different polynomial fitters are used because numpy.polyfit does not support non-uniform weighting of the data. For the weighted fitting, the SciPy Orthogonal Distance Regression module (scipy.odr) is used.

Statistical Tests

New in version 0.4.0.

Collection of statistical tests not found in any of the common python libraries.

lsl.statistics.stattests.waldwolfowitz(inputData)

Wald-Wolfowitz test of randomness. Given a numpy array of values compute the probability that the values are mutially independent.

Table Of Contents

Previous topic

Math Utilities

Next topic

Module and Data Paths

This Page