'Whiten a series of columns according to an AR(p)
covariance structure. This drops initial p observations.
Parameters
X : array-like
The data to be whitened,
Returns
whitened array'

def whiten(self, X):

    X = np.asarray(X, np.float64)
    _X = X.copy()
    for i in range(self.order):
        _X[(i + 1):] = (_X[(i + 1):] - (self.rho[i] * X[0:(- (i + 1))]))
    return _X[self.order:]
