docs: def nb_r_deriv(r, data_row):
      """
      Derivative of log-likelihood wrt r (formula from wikipedia)
  
      Args:
          r (float): the R paramemter in the NB distribution
          data_row (array): 1d array of length cells
      """
      n = len(data_row)
      d = sum(digamma(data_row + r)) - n*digamma(r) + n*np.log(r/(r+np.mean(data_row)))
      return d