'return log-likelihood of `x` regarding the current sample distribution'

@staticmethod
def loglikelihood(self, x, previous=False):

    if (previous and hasattr(self, 'lastiter')):
        sigma = self.lastiter.sigma
        Crootinv = self.lastiter._Crootinv
        xmean = self.lastiter.mean
        D = self.lastiter.D
    elif (previous and (self.countiter > 1)):
        raise _Error('no    previous    distribution    parameters    stored,    check    options    importance_mixing')
    else:
        sigma = self.sigma
        Crootinv = self._Crootinv
        xmean = self.mean
        D = self.D
    dx = (array(x) - xmean)
    n = self.N
    logs2pi = ((n * log((2 * np.pi))) / 2.0)
    logdetC = (2 * sum(log(D)))
    dx = np.dot(Crootinv, dx)
    res = ((((((- sum((dx ** 2))) / (sigma ** 2)) / 2) - logs2pi) - (logdetC / 2)) - (n * log(sigma)))
    if (1 < 3):
        s2pi = ((2 * np.pi) ** (n / 2.0))
        detC = (np.prod(D) ** 2)
        res2 = ((((- sum((dx ** 2))) / (sigma ** 2)) / 2) - log(((s2pi * (abs(detC) ** 0.5)) * (sigma ** n))))
        assert ((res2 < (res + 1e-08)) or (res2 > (res - 1e-08)))
    return res
