'GLS whiten method.
Parameters
X : array-like
Data to be whitened.
Returns
np.dot(cholsigmainv,X)
See Also
regression.GLS'

def whiten(self, X):

    X = np.asarray(X)
    if ((self.sigma is None) or (self.sigma.shape == ())):
        return X
    elif (self.sigma.ndim == 1):
        if (X.ndim == 1):
            return (X * self.cholsigmainv)
        else:
            return (X * self.cholsigmainv[:, None])
    else:
        return np.dot(self.cholsigmainv, X)
