Find Outliers with Thompson Tau
Updated 17 May 2010
Given a sample, the routine looks for outliers and gives back their indexes that identify them in the input vector.
The routine allows the specification of the critical probability (alpha, default is 0.01 = 1%), can manage NaNs and, as default, it uses statistics (biweight) that are robust to outliers because the sample mean and the standard deviation are not.
If requested a figure showing data values and outliers is also created.
Modified Thompson's Tau is recommended by Measurement Uncertainty (Part I, ASME PTC 19.1 1998) for the individuation of outliers in a set of repeated measurements.
As usual, suggested alpha goes from 0.1 (indicate all moderately suspicious outlier) to 0.01 (indicate only the bigger suspect values) or even smaller (allow even very big values and indicates only the huge ones).
To obtain the result you are looking for you can adjust alpha; otherwise, if data are expected to be very skewed, you must use another test or transform the data via a non-linear transformation.
The implemented version works with or without the statistic toolbox, but in the last case the value of alpha is fixed to the default value (0.01, 1%)
Additional specifications on the test and on the algorithm are given as comments in the code.
Michele Rienzner (2023). Find Outliers with Thompson Tau (https://www.mathworks.com/matlabcentral/fileexchange/27553-find-outliers-with-thompson-tau), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Implemented biweight statistics and allowed the choice of the used statistic. Implemented the figure. A check script, more comments and references are also given.
fixed the bug for the "without toolbox" branch; included references in the help.
Now works properly also without the statistics toolbox. An interpolation of table values is added for the "non-toolbox" branch. Corrected mistakes in the comments.
Some better specification in the help part and in the comments (the most important in the title: from "Tompson" to "Thompson"); some corrections of English form are also made.