def g(x, t=4): """A transformation that suppresses outliers for a standard normal.""" xp = np.clip(x, -t, t) diff = np.tanh(x - xp) return xp + diff