Expand description
anomaly_score_mad window function โ MAD-based anomaly scoring.
Algorithm: score = |x - median(window)| / (MAD * 1.4826)
where MAD = median(|xi - median(window)|)
When MAD = 0 (majority-constant window), returns 0.0 if value equals median, or +inf otherwise.
Structsยง
Constantsยง
- MAD_
CONSISTENCY_ ๐CONSTANT - MAD consistency constant for normal distribution:
1 / ฮฆโปยน(3/4) โ 1.4826 - MIN_
SAMPLES ๐ - Minimum valid samples for MAD (n <= 2 makes MAD almost always 0, yielding spurious +inf).