smpl.stat
Simplified statistics.
|
Chi2 - Goodness of Fit |
|
R2 - Coefficient of determination |
|
Return mean of |
|
Return |
|
Add gaussian noise to |
|
Return normalized |
|
Return mean of |
|
Return |
|
Return the nominal values of the numbers in NumPy array arr. |
|
Returns a function which applies |
|
Return the standard deviations of the numbers in NumPy array arr. |
Functions
- smpl.stat.Chi2(y, f, sigmas=None)[source]
Chi2 - Goodness of Fit
In general, if Chi-squared/Nd is of order 1.0, then the fit is reasonably good. Coversely, if Chi-squared/Nd >> 1.0, then the fit is a poor one.
References
https://www.phys.hawaii.edu/~varner/PHYS305-Spr12/DataFitting.html
- smpl.stat.R2(y, f)[source]
R2 - Coefficient of determination
In the best case, the modeled values exactly match the observed values, which results in R2 = 1. A baseline model, which always predicts the mean of y, will have R2 = 0. Models that have worse predictions than this baseline will have a negative R2.
References
- smpl.stat.unv(arr)
Return the nominal values of the numbers in NumPy array arr.
Elements that are not numbers with uncertainties (derived from a class from this module) are passed through untouched (because a numpy.array can contain numbers with uncertainties and pure floats simultaneously).
If arr is of type unumpy.matrix, the returned array is a numpy.matrix, because the resulting matrix does not contain numbers with uncertainties.
- smpl.stat.usd(arr)
Return the standard deviations of the numbers in NumPy array arr.
Elements that are not numbers with uncertainties (derived from a class from this module) are passed through untouched (because a numpy.array can contain numbers with uncertainties and pure floats simultaneously).
If arr is of type unumpy.matrix, the returned array is a numpy.matrix, because the resulting matrix does not contain numbers with uncertainties.