code: def rowsum_stdev(x, beta):
      r
      n = x.size
      betabar = (1.0/n) * np.dot(x, beta)
      stdev = np.sqrt((1.0/n) *
                      np.sum(np.power(np.multiply(x, beta) - betabar, 2)))
      return stdev/betabar
docs: r"""Compute row sum standard deviation.
  
      Compute for approximation x, the std dev of the row sums
      s(x) = ( 1/n \sum_k  (x_k beta_k - betabar)^2 )^(1/2)
      with betabar = 1/n dot(beta,x)
  
      Parameters
      ----------
      x : array
      beta : array
  
      Returns
      -------
      s(x)/betabar : float
  
      Notes
      -----
      equation (7) in Livne/Golub