Approximating Median Absolute Deviation with Bounded Error
Zhiwei Chen, Shaoxu Song, Ziheng Wei, Jingyun Fang, Jiang Long
Abstract
The median absolute deviation (MAD) is a statistic measuring the variability of a set of quantitative elements. It is known to be more robust to outliers than the standard deviation (SD), and thereby widely used in outlier detection. Computing the exact MAD however is costly, e.g., by calling an algorithm of finding median twice, with space cost O ( n ) over n elements in a set. In this paper, we propose the first fully mergeable approximate MAD algorithm, OP-MAD, with one-pass scan of the data. Remarkably, by calling the proposed algorithm at most twice, namely TP-MAD, it guarantees to return an (ϵ, 1)-accurate MAD, i.e., the error relative to the exact MAD is bounded by the desired ϵ or 1. The space complexity is reduced to O ( m ) while the time complexity is O ( n + m log m ), where m is the size of the sketch used to compress data, related to the desired error bound ϵ. To get a more accurate MAD, i.e., with smaller ϵ, the sketch size m will be larger, a trade-off between effectiveness and efficiency. In practice, we often have the sketch size m ≪ n , leading to constant space cost O (1) and linear time cost O ( n ). The extensive experiments over various datasets demonstrate the superiority of our solution, e.g., 160000× less memory and 18x faster than the aforesaid exact method in datasets pareto and norm . Finally, we further implement and evaluate the parallelizable TP-MAD in Apache Spark, and the fully mergeable OP-MAD in Structured Streaming.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext cddb34cf-0cdd-4ee5-bbf9-e5a3a4f23212Cited by top-tier papers2
- Randomized Sketches for Quantile in LSM-tree based StoreZiling Chen, Shaoxu SongSIGMOD 2025 · 2 citations
- CORE-Sketch: On Exact Computation of Median Absolute Deviation with Limited SpaceHaoquan Guan, Ziling Chen, Shaoxu SongVLDB 2023 · 1 citation
Related papers
- STREAM: Spatiotemporal Similarity-based Efficient Approximate Median with Tunable GranularityFenfang Li, Huizhang Luo, Weichen Liu, Anthony Theodore Chronopoulos et al.DAC 2025
- OmniSketch: Efficient Multi-Dimensional High-Velocity Stream Analytics with Arbitrary PredicatesWieger R. Punter, Odysseas Papapetrou, Minos N. GarofalakisVLDB 2024 · 10 citations
- PR-Sketch: Monitoring Per-key Aggregation of Streaming Data with Nearly Full AccuracySiyuan Sheng, Qun Huang, Sa Wang, Yungang BaoVLDB 2021 · 33 citations
- Efficient Incremental Computation of Aggregations over Sliding WindowsChao Zhang, Reza Akbarinia, Farouk ToumaniKDD 2021 · 11 citations
- Enabling Efficient and General Subpopulation Analytics in Multidimensional Data StreamsAntonis Manousis, Zhuo Cheng, Ran Ben Basat, Zaoxing Liu et al.VLDB 2022 · 16 citations
