def calc_autocorrelation_lag1(df):
    """Compute average autocorrelation with specified lag."""
    corr_rounds = df.reset_index(inplace=False)
    corr_rounds = corr_rounds.pivot(index="period", columns="subject")["e2"]
    return corr_rounds.apply(lambda col: col.autocorr(1), axis=0).mean()