def _compute_multivariate_sample_acovf(endog, maxlag):
    # Get the (demeaned) data as an array
    endog = np.array(endog)
    if endog.ndim == 1:
        endog = endog[:, np.newaxis]
    endog -= np.mean(endog, axis=0)

    # Dimensions
    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
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/statespace/tools.py/_compute_multivariate_sample_acovf