def METHOD_NAME(ϑ: float, x: np.ndarray | None, s: np.ndarray):
    σg = ϑ
    if σg < 0:
        return None, None, None
    vinv = np.diag(np.ravel(1.0 / (s + σg)))
    if x is None:
        return vinv, None, None
    a = x.T @ vinv
    b = a @ x
    # projection matrix
    p = vinv - a.T @ np.linalg.lstsq(b, a, rcond=None)[0]
    return vinv, p, b