'logarithm of probability density function
Parameters
x : array_like
can be 1d or 2d, if 2d, then each row is taken as independent
multivariate random vector
Returns
logpdf : float or array
probability density value of each random vector
this should be made to work with 2d x,
with multivariate normal vector in each row and iid across rows
doesn\'t work now because of dot in whiten'

def logpdf(self, x):

    x = np.asarray(x)
    x_whitened = self.whiten((x - self.mean))
    SSR = np.sum((x_whitened ** 2), (-1))
    llf = (- SSR)
    llf -= (self.nvars * np.log((2.0 * np.pi)))
    llf -= self.logdetsigma
    llf *= 0.5
    return llf
