A Python Based Library to Calculate Estimators (Sn, Qn, MAD, IQR)
Project description
robustbase
A Python Library to Calculate Estimators.
Installation
OS X , Windows & Linux:
pip install robustbase
Usage example
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)
Development setup
For local development setup
git clone https://github.com/deepak7376/robustbase
cd robustbase
pip install -r requirements.txt
Meta
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
Contributing
- 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
References
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/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for robustbase-0.2.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 509ca1b16d66b1d2154e1e655f1e57d6dd49c084af0682384e06d66220747bd8 |
|
MD5 | b5cce6baf46d6e410c130f2517d80f2f |
|
BLAKE2b-256 | 5f55ae94a569f879a9d097d0cc365daaf8d61f338f2b99d596ef460fbc3066bd |