'Returns the kernel smoothing estimate of the variance at point x.'

def smoothvar(self, xs, ys, x):

    (xs, ys) = self.in_domain(xs, ys, x)
    if (len(xs) > 0):
        fittedvals = np.array([self.smooth(xs, ys, xx) for xx in xs])
        sqresid = square(subtract(ys, fittedvals))
        w = np.sum(self(((xs - x) / self.h)))
        v = np.sum([(rr * self(((xx - x) / self.h))) for (xx, rr) in zip(xs, sqresid)])
        return (v / w)
    else:
        return np.nan
