_r10#

pycafee.sample.outliers.Dixon._r10(self, x_exp, which)#

The equation to calculate the Dixon statsitic for the r10 ratio as described at [1]

Parameters
x_expnumpy array

One dimension numpy array with the data ordered.

whichstr

The value that should be evaluated.

  • If it is "max" (or None), the highest value is checked if it is a possible outlier.

  • If it is "min", the lowest value is checked.

Notes

If which=="min", the equation used is:

\[r_{10} = \frac{x_2-x_1}{x_n-x_1}\]

If which=="max", the equation used is:

\[r_{10} = \frac{x_n-x_{n-1}}{x_n-x_1}\]

References

1

DIXON, W. J. Processing Data for Outliers. Biometrics, v. 9, n. 1, p. 74–89, 1953.

Examples

>>> from pycafee.sample.dixon import Dixon
>>> import numpy as np
>>> x_exp = np.array([159, 153, 184, 153, 156, 150, 147])
>>> x_exp.sort(kind='quicksort')
>>> teste = Dixon()
>>> result = teste._r10(x_exp, which="min")
>>> print(result)
0.08108108108108109
>>> result = teste._r10(x_exp, which="max")
>>> print(result)
0.6756756756756757
>>> from pycafee.sample.dixon import Dixon
>>> import numpy as np
>>> x_exp = np.array([15.42, 15.51, 15.52, 15.53, 15.68, 15.52, 15.56, 15.53, 15.54, 15.56])
>>> x_exp.sort(kind='quicksort')
>>> teste = Dixon()
>>> result = teste._r10(x_exp, which="min")
>>> print(result)
0.34615384615384587
>>> result = teste._r10(x_exp, which="max")
>>> print(result)
0.4615384615384589