@statfunc
def autocov(x, lag=1):
 x = np.asarray(x)
 if (not lag):
  return 1
 if (lag < 0):
  raise ValueError('Autocovariance lag must be a positive integer')
 return np.cov(x[:(- lag)], x[lag:], bias=1)

@ statfunc def autocov ( x , lag = 1 ) : x = np . asarray ( x ) if ( not lag ) : return 1 if ( lag < 0 ) : raise ValueError ( 'Autocovariance lag must be a positive integer' ) return np . cov ( x [ : ( - lag ) ] , x [ lag : ] , bias = 1 )
sample autocovariance at specified lag .