'The robust criterion function for Hampel\'s estimator
Parameters
z : array-like
1d array
Returns
rho : array
rho(z) = (1/2.)*z**2                    for \|z\| <= a
rho(z) = a*\|z\| - 1/2.*a**2              for a < \|z\| <= b
rho(z) = a*(c*\|z\|-(1/2.)*z**2)/(c-b)    for b < \|z\| <= c
rho(z) = a*(b + c - a)                  for \|z\| > c'

def rho(self, z):

    z = np.fabs(z)
    a = self.a
    b = self.b
    c = self.c
    (t1, t2, t3) = self._subset(z)
    v = (((((t1 * (z ** 2)) * 0.5) + (t2 * ((a * z) - ((a ** 2) * 0.5)))) + (t3 * (((a * ((c * z) - ((z ** 2) * 0.5))) / (c - b)) - ((7 * (a ** 2)) / 6.0)))) + (((((1 - t1) + t2) + t3) * a) * ((b + c) - a)))
    return v
