'Whitener for WLS model, multiplies each column by sqrt(self.weights)
Parameters
X : array-like
Data to be whitened
Returns
whitened : array-like
sqrt(weights)*X'

def whiten(self, X):

    X = np.asarray(X)
    if (X.ndim == 1):
        return (X * np.sqrt(self.weights))
    elif (X.ndim == 2):
        return (np.sqrt(self.weights)[:, None] * X)
