module for performing statistical calculations.
This module (as you may notice) provides very few statistical
routines. It does, however, provide biweight (robust) estimators of
location and scale, as described in Beers et al. 1990 (AJ, 100, 32), in
addition to a robust least squares fitting routine that uses the biweight
transform.
Some routines may fail if they are passed lists with few items and
encounter a `divide by zero' error. Where this occurs, the function will
return None. An error message will be printed to the console when this
happens if astStats.REPORT_ERRORS=True (the default). Testing if an
astStats function returns None can be used to handle errors in
scripts.
float
|
mean(dataList)
Calculates the mean average of a list of numbers. |
source code
|
|
float
|
weightedMean(dataList)
Calculates the weighted mean average of a two dimensional list
(value, weight) of numbers. |
source code
|
|
float
|
stdev(dataList)
Calculates the (sample) standard deviation of a list of numbers. |
source code
|
|
float
|
rms(dataList)
Calculates the root mean square of a list of numbers. |
source code
|
|
float
|
|
float
|
|
float
|
|
float
|
MAD(dataList)
Calculates the Median Absolute Deviation of a list of numbers. |
source code
|
|
float
|
normalizdMAD(dataList)
Calculates the normalized Median Absolute Deviation of a list of
numbers which, for a Gaussian distribution, is related to the
standard deviation by 1.4826. |
source code
|
|
float
|
biweightLocation(dataList,
tuningConstant=6.0)
Calculates the biweight location estimator (like a robust average) of
a list of numbers. |
source code
|
|
float
|
biweightScale(dataList,
tuningConstant=9.0)
Calculates the biweight scale estimator (like a robust standard
deviation) of a list of numbers. |
source code
|
|
float
|
biweightScale_test(dataList,
tuningConstant=9.0)
Calculates the biweight scale estimator (like a robust standard
deviation) of a list of numbers. |
source code
|
|
dictionary
|
biweightClipped(dataList,
tuningConstant,
sigmaCut)
Iteratively calculates biweight location and scale, using sigma
clipping, for a list of values. |
source code
|
|
list
|
|
float
|
|
dictionary
|
OLSFit(dataList)
Performs an ordinary least squares fit on a two dimensional list of
numbers. |
source code
|
|
dictionary
|
|
dictionary
|
|
dictionary
|
|
dictionary
|
weightedLSFit(dataList,
weightType)
Performs a weighted least squares fit on a three dimensional list of
numbers [x, y, y error]. |
source code
|
|
dictionary
|
biweightLSFit(dataList,
tuningConstant,
sigmaCut=None)
Performs a weighted least squares fit, where the weights used are the
biweight transforms of the residuals to the previous best fit .i.e. |
source code
|
|
list
|
|
list
|
|
list
|
weightedBinner(data,
weights,
binMin,
binMax,
binTotal)
Bins the input data, recorded frequency is sum of weights in bin. |
source code
|
|
tuple
|
bootstrap(data,
statistic,
resamples=1000,
alpha=0.05,
output=' ci ' ,
**kwargs)
Returns the bootstrap estimate of the confidence interval for the
given statistic. |
source code
|
|
tuple
|
|
numpy.array
|
|