Method and source check
Last checked:
Automated source and implementation review, including worked examples and documented numerical limits. This review does not provide professional advice or specialist approval.
Method
Compute arithmetic mean and median, select one as the center, average absolute distances from that center, and also report their sum. Median-centered mode still averages distances; it does not compute the standard median absolute deviation statistic.
average absolute deviation about c = Σ|xᵢ−c|/n
c = mean or median
Variables and units
- xáµ¢
- each finite observation
- c
- selected center: mean or median
- n
- number of observations
Worked example
For 1,2,100 centered on the median 2, absolute distances are 1,0,98 and their average is 33.
Limitations
Mean, median, average deviation, total, and listed deviations are rounded to four decimals. Math.round retains the existing half-tie convention; if scaling for four-place rounding would overflow, the finite representable value is retained. Locale formatting is applied after numerical calculation.
- Median-centered average absolute deviation must not be labeled as standard median absolute deviation (MAD).
- Extremes still affect the average of deviations.
- Derived values outside the supported finite numerical range are rejected with a localized input-field error.
- All identical observations yield zero average absolute deviation.
- For 1,2,100, standard median absolute deviation would be median(1,0,98)=1, not this mode’s 33.