'Evaluate the log of the estimated pdf on a provided set of points.'

def logpdf(self, x):

    points = atleast_2d(x)
    (d, m) = points.shape
    if (d != self.d):
        if ((d == 1) and (m == self.d)):
            points = reshape(points, (self.d, 1))
            m = 1
        else:
            msg = ('points    have    dimension    %s,    dataset    has    dimension    %s' % (d, self.d))
            raise ValueError(msg)
    result = zeros((m,), dtype=float)
    if (m >= self.n):
        energy = zeros((self.n, m), dtype=float)
        for i in range(self.n):
            diff = (self.dataset[:, i, newaxis] - points)
            tdiff = dot(self.inv_cov, diff)
            energy[i] = (sum((diff * tdiff), axis=0) / 2.0)
        result = logsumexp((- energy), b=(1 / self._norm_factor), axis=0)
    else:
        for i in range(m):
            diff = (self.dataset - points[:, i, newaxis])
            tdiff = dot(self.inv_cov, diff)
            energy = (sum((diff * tdiff), axis=0) / 2.0)
            result[i] = logsumexp((- energy), b=(1 / self._norm_factor))
    return result
