Changed in version 0.4.0: Function names have been changed in this module and new function added. See the below for more details.
Small collection of robust statistical estimators based on functions from Henry Freudenriech (Hughes STX) statistics library (called ROBLIB) that have been incorporated into the AstroIDL User’s Library. Function included are:
- biweightMean - biweighted mean estimator
- mean - robust estimator of the mean of a data set
- mode - robust estimate of the mode of a data set using the half-sample method
- std - robust estimator of the standard deviation of a data set
- checkfit - return the standard deviation and biweights for a fit in order to determine its quality
- linefit - outlier resistant fit of a line to data
- polyfit - outlier resistant fit of a polynomial to data
For the fitting routines, the coefficients are returned in the same order as numpy.polyfit, i.e., with the coefficient of the highest power listed first.
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()
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.0.3: Added the ‘axis’ and ‘dtype’ keywords to make this function more compatible with numpy.mean()
Robust estimator of the mode of a data set using the half-sample mode.
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.0.3: Added the ‘axis’ and ‘dtype’ keywords to make this function more compatible with numpy.std()
Determine the quality of a fit and biweights. Returns a tuple with elements:
- Robust standard deviation analog
- Fractional median absolute deviation of the residuals
- Number of input points given non-zero weight in the calculation
- Bisquare weights of the input points
- Residual values scaled by sigma
This function is based on the rob_checkfit routine from the AstroIDL User’s Library.
Outlier resistance two-variable linear regression function.
Based on the robust_linefit routine in the AstroIDL User’s Library.
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.
New in version 0.4.0.
Collection of statistical tests not found in any of the common python libraries.
Wald-Wolfowitz test of randomness. Given a numpy array of values compute the probability that the values are mutially independent.