SCALE
SCALE = 1.4826
Scales the median absolute deviation onto the standard-deviation scale.
A run of observations of one measurement, and the statistics a detector asks of it.
The median and the median absolute deviation are used rather than the mean and the standard deviation. The series a detector watches is a site's own history, and a site's history contains the very spikes the detector exists to find - a mean and a standard deviation computed over a window containing one large spike are both dragged toward it, which raises the threshold enough for the next spike to look ordinary. The median absolute deviation is not moved by a minority of outliers, so yesterday's incident does not hide today's.
The 1.4826 scale factor makes the deviation comparable to a standard deviation for normally distributed data, so a threshold expressed in sigma means roughly what a reader expects.
score(float $value) : float
How far a value sits from the middle, in deviations.
A series whose observations are all identical has no deviation, so any different value is infinitely unusual by the arithmetic. That is not useful, so the distance is expressed against the median instead: a value double the median scores 1.0 rather than infinity.
| float | $value | The observation to score. |
Signed deviations from the median.