'Evaluate the estimated pdf on a set of points.
Parameters
points : (# of dimensions, # of points)-array
Alternatively, a (# of dimensions,) vector can be passed in and
treated as a single point.
Returns
values : (# of points,)-array
The values at each point.
Raises
ValueError : if the dimensionality of the input points is different
than the dimensionality of the KDE.'

def evaluate(self, points):

    points = np.atleast_2d(points)
    (dim, num_m) = np.array(points).shape
    if (dim != self.dim):
        msg = (u'points    have    dimension    %s,    dataset    has    dimension    %s' % (dim, self.dim))
        raise ValueError(msg)
    result = np.zeros((num_m,), dtype=float)
    if (num_m >= self.num_dp):
        for i in range(self.num_dp):
            diff = (self.dataset[:, i, np.newaxis] - points)
            tdiff = np.dot(self.inv_cov, diff)
            energy = (np.sum((diff * tdiff), axis=0) / 2.0)
            result = (result + np.exp((- energy)))
    else:
        for i in range(num_m):
            diff = (self.dataset - points[:, i, np.newaxis])
            tdiff = np.dot(self.inv_cov, diff)
            energy = (np.sum((diff * tdiff), axis=0) / 2.0)
            result[i] = np.sum(np.exp((- energy)), axis=0)
    result = (result / self.norm_factor)
    return result
