def ccovf(x, y, unbiased=True, demean=True):
 n = len(x)
 if demean:
  xo = (x - x.mean())
  yo = (y - y.mean())
 else:
  xo = x
  yo = y
 if unbiased:
  xi = np.ones(n)
  d = np.correlate(xi, xi, 'full')
 else:
  d = n
 return (np.correlate(xo, yo, 'full') / d)[(n - 1):]

def ccovf ( x , y , unbiased = True , demean = True ) : n = len ( x ) if demean : xo = ( x - x . mean ( ) ) yo = ( y - y . mean ( ) ) else : xo = x yo = y if unbiased : xi = np . ones ( n ) d = np . correlate ( xi , xi , 'full' ) else : d = n return ( np . correlate ( xo , yo , 'full' ) / d ) [ ( n - 1 ) : ]
crosscovariance for 1d parameters x .