# Choice of constants in a robust z score

I'm trying to calculate a robust z score, and I'd like to understand the constants I'm using, and their impact on my statistic.

One corner case I've noticed is when my sample happens to be all the same value, since there is no dispersion, both a regular z-score, and a MAD-based robust z-score have zero std/MAD in the denominator, and produce undefined results. Even if quite mathematically reasonable, this is is less robust than I'd hope (it seems maybe more intuitive to smooth this to the constant itself than to undefined).

A definition I saw from an IBM product recommended special-casing the denominator for this reason.

Coding their suggestion in pandas for example, on a rolling basis, I might have something like this:

def rolling_robust_zscore(d, window=5):
num = d - d.rolling(window).median()

• What are the values they provided, 1.48258 for the median absolute deviation and 1.253314 for the mean absolute deviation? How were these chosen?
• I would guess "1.48258" is an approximation to $1/\Phi^{-1}(3/4)= 1.48260\ldots.$