def autocov(v, lx):
    """ Compute a lag autocovariance.
    """
    ch = 0
    for i in range(v.shape[0]-lx):
        for j in range(v.shape[1]):
            ch += v[i][j]*v[i+lx][j]
    return ch/((v.shape[0]-lx)*v.shape[1])