def averagecorr(r1, r2):
    z1 = np.arctanh(r1)
    z2 = np.arctanh(r2)
    themean = ((z1 + z2) / 2)
    return np.tanh(themean)
def averagecorr(r1, r2):
    z1 = np.arctanh(r1)
    z2 = np.arctanh(r2)
    themean = ((z1 + z2) / 2)
    return np.tanh(themean)