code: def convenience_calc_gradient(self, params):
          
          orig_nest_coefs, betas = self.convenience_split_params(params)
  
          args = [orig_nest_coefs,
                  betas,
                  self.design,
                  self.choice_vector,
                  self.rows_to_obs,
                  self.rows_to_nests]
  
          return general_gradient(*args, ridge=self.ridge, weights=self.weights)
docs: Calculates the gradient of the log-likelihood for this model / dataset.