'Individual contributions to the log-likelihood, tries to return REML
contribution by default though this requires estimated
fixed effect a to be passed as an argument.
no constant with pi included
a is not used if ML=true  (should be a=None in signature)
If ML is false, then the residuals are calculated for the given fixed
effects parameters a.'

def logL(self, a, ML=False):

    if ML:
        return ((np.log(L.det(self.W)) - (self.r * np.dot(self.W, self.r)).sum()) / 2.0)
    else:
        if (a is None):
            raise ValueError('need    fixed    effect    a    for    REML    contribution    to    log-likelihood')
        r = (self.Y - np.dot(self.X, a))
        return ((np.log(L.det(self.W)) - (r * np.dot(self.W, r)).sum()) / 2.0)
