(J: np.ndarray, x_star: np.ndarray, delta: float,
                    B: np.ndarray, G: np.ndarray, P_star: np.ndarray,
                    D_star: np.ndarray)
return b_star
Compute the random sampling matrix B*.

    Parameters
    ----------
    J: matrix of 1's
    x_star: randomly chosen "base value" of x
    delta: parameters variation
    B: sampling matrix (not random)
    G: groups matrix
    P_star: random permutation matrix
    D_star: diagonal matrix with each element being +1 or -1, with equal
            probability

    Returns
    -------
    Random sampling matrix B*
Compute the random sampling matrix B*.
Compute the random sampling matrix B * .
def _compute_b_star(J: np.ndarray, x_star: np.ndarray, delta: float,
                    B: np.ndarray, G: np.ndarray, P_star: np.ndarray,
                    D_star: np.ndarray) -> np.ndarray:
    """
    Compute the random sampling matrix B*.

    Parameters
    ----------
    J: matrix of 1's
    x_star: randomly chosen "base value" of x
    delta: parameters variation
    B: sampling matrix (not random)
    G: groups matrix
    P_star: random permutation matrix
    D_star: diagonal matrix with each element being +1 or -1, with equal
            probability

    Returns
    -------
    Random sampling matrix B*
    """
    element_a = J[0, :] * x_star
    element_b = np.matmul(G, P_star).T
    element_c = np.matmul(2.0 * B, element_b)
    element_d = np.matmul((element_c - J), D_star)

    b_star = element_a + (delta / 2.0) * (element_d + J)
    return b_star
def _compute_b_star ( J : np . ndarray , x_star : np . ndarray , delta : float , B : np . ndarray , G : np . ndarray , P_star : np . ndarray , D_star : np . ndarray ) -> np . ndarray : element_a = J [ 0 , : ] * x_star element_b = np . matmul ( G , P_star ) . T element_c = np . matmul ( 2.0 * B , element_b ) element_d = np . matmul ( ( element_c - J ) , D_star ) b_star = element_a + ( delta / 2.0 ) * ( element_d + J ) return b_star