def _compute_multivariate_sample_acovf(endog, maxlag):
 endog = np.array(endog)
 if (endog.ndim == 1):
  endog = endog[:, np.newaxis]
 endog -= np.mean(endog, axis=0)
 (nobs, k_endog) = endog.shape
 sample_autocovariances = []
 for s in range((maxlag + 1)):
  sample_autocovariances.append(np.zeros((k_endog, k_endog)))
  for t in range((nobs - s)):
   sample_autocovariances[s] += np.outer(endog[t], endog[(t + s)])
  sample_autocovariances[s] /= nobs
 return sample_autocovariances

def _compute_multivariate_sample_acovf ( endog , maxlag ) : endog = np . array ( endog ) if ( endog . ndim == 1 ) : endog = endog [ : , np . newaxis ] endog -= np . mean ( endog , axis = 0 ) ( nobs , k_endog ) = endog . shape sample_autocovariances = [ ] for s in range ( ( maxlag + 1 ) ) : sample_autocovariances . append ( np . zeros ( ( k_endog , k_endog ) ) ) for t in range ( ( nobs - s ) ) : sample_autocovariances [ s ] += np . outer ( endog [ t ] , endog [ ( t + s ) ] ) sample_autocovariances [ s ] /= nobs return sample_autocovariances
computer multivariate sample autocovariances parameters endog : array_like sample data on which to compute sample autocovariances .