def METHOD_NAME(mn, inverse_covariance, dof1, dof2, fcontrast):
    cope = fcontrast @ mn
    a = fcontrast @ np.linalg.lstsq(inverse_covariance, fcontrast.T, rcond=None)[0]
    b = np.linalg.lstsq(a, cope, rcond=None)[0]
    f = float(cope.T @ b) / dof1
    z = f2z_convert(f, dof1, dof2)
    return cope, f, z