def S_hac_groupsum(x, time, nlags=None, weights_func=weights_bartlett):
 x_group_sums = group_sums(x, time).T
 return S_hac_simple(x_group_sums, nlags=nlags, weights_func=weights_func)

def S_hac_groupsum ( x , time , nlags = None , weights_func = weights_bartlett ) : x_group_sums = group_sums ( x , time ) . T return S_hac_simple ( x_group_sums , nlags = nlags , weights_func = weights_func )
inner covariance matrix for hac over group sums sandwich this assumes we have complete equal spaced time periods .