docs: def _mm(n_items, data, initial_params, alpha, max_iter, tol, mm_fun):
      """
      Iteratively refine MM estimates until convergence.
  
      Raises
      ------
      RuntimeError
          If the algorithm does not converge after `max_iter` iterations.
      """
      if initial_params is None:
          params = np.zeros(n_items)
      else:
          params = initial_params
      converged = NormOfDifferenceTest(tol=tol, order=1)
      for _ in range(max_iter):
          nums, denoms = mm_fun(n_items, data, params)
          params = log_transform((nums + alpha) / (denoms + alpha))
          if converged(params):
              return params
      raise RuntimeError("Did not converge after {} iterations".format(max_iter))