A Python Library to Calculate Estimators.
OS X , Windows & Linux:
pip install robustbase
This package is used to calculate the following statistical estimators.
- Qn scale estimator
- Compute the robust scale estimator Qn, an efficient alternative to the MAD. Read More.
Qn(x, constant = 2.21914, finite_corr=True)
from robustbase import Qn
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# with bias correction
res = Qn(x) # ans = 3.196183
# Without bias correction
res = Qn(x, finite_corr=False) # ans = 4.43828
- Sn scale estimator
- Compute the robust scale estimator Sn, an efficient alternative to the MAD.Read More.
Sn(x, constant = 1.1926, finite_corr=True)
from robustbase import Sn
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# with bias correction
res = Sn(x) # ans = 3.5778
# Note: This is not working properly as R Sn code works (Fix it)
# Without bias correction
res = Sn(x, finite_corr=False) # ans = 3.5778
- Median Absolute Deviation(MAD)
mad(x, center = None, constant = 1.4826, na = False,
low = False, high = False)
from robustbase import mad
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
res = mad(x)
- Interquartile Range (IQR)
iqr(x)
from robustbase import iqr
x = [1, 2, 3, 4. 5]
res = iqr(x)
For local development setup
git clone https://github.com/deepak7376/robustbase
cd robustbase
pip install -r requirements.txt
Deepak Yadav – @imdeepak_dky – dky.united@gmail.com
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/deepak7376/robustbase/blob/master/LICENSE
- Fork it (https://github.com/deepak7376/robustbase/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/qn_scale.htm https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/sn_scale.htm https://www.statisticshowto.datasciencecentral.com/median-absolute-deviation/ https://www.statisticshowto.datasciencecentral.com/probability-and-statistics/interquartile-range/