'The psi function for Hampel\'s estimator
The analytic derivative of rho
Parameters
z : array-like
1d array
Returns
psi : array
psi(z) = z                            for \|z\| <= a
psi(z) = a*sign(z)                    for a < \|z\| <= b
psi(z) = a*sign(z)*(c - \|z\|)/(c-b)    for b < \|z\| <= c
psi(z) = 0                            for \|z\| > c'

def psi(self, z):

    z = np.asarray(z)
    a = self.a
    b = self.b
    c = self.c
    (t1, t2, t3) = self._subset(z)
    s = np.sign(z)
    z = np.fabs(z)
    v = (s * (((t1 * z) + ((t2 * a) * s)) + ((((t3 * a) * s) * (c - z)) / (c - b))))
    return v
