def whiten_ar(x, ar_coefs):
 rho = ar_coefs
 x = np.array(x, np.float64)
 if (x.ndim == 2):
  rho = rho[:, None]
 for i in range(self.order):
  _x[(i + 1):] = (_x[(i + 1):] - (rho[i] * x[0:(- (i + 1))]))
 return _x[self.order:]

def whiten_ar ( x , ar_coefs ) : rho = ar_coefs x = np . array ( x , np . float64 ) if ( x . ndim == 2 ) : rho = rho [ : , None ] for i in range ( self . order ) : _x [ ( i + 1 ) : ] = ( _x [ ( i + 1 ) : ] - ( rho [ i ] * x [ 0 : ( - ( i + 1 ) ) ] ) ) return _x [ self . order : ]
whiten a series of columns according to an ar(p) covariance structure .