docs: def lsr_rankings(n_items, data, alpha=0.0, initial_params=None):
      """Compute the LSR estimate of model parameters.
  
      This function implements the Luce Spectral Ranking inference algorithm
      [MG15]_ for ranking data (see :ref:`data-rankings`).
  
      The argument ``initial_params`` can be used to iteratively refine an
      existing parameter estimate (see the implementation of
      :func:`~choix.ilsr_rankings` for an idea on how this works). If it is set
      to `None` (the default), the all-ones vector is used.
  
      The transition rates of the LSR Markov chain are initialized with
      ``alpha``. When ``alpha > 0``, this corresponds to a form of regularization
      (see :ref:`regularization` for details).
  
      Parameters
      ----------
      n_items : int
          Number of distinct items.
      data : list of lists
          Ranking data.
      alpha : float, optional
          Regularization parameter.
      initial_params : array_like, optional
          Parameters used to build the transition rates of the LSR Markov chain.
  
      Returns
      -------
      params : numpy.ndarray
          An estimate of model parameters.
      """
      weights, chain = _init_lsr(n_items, alpha, initial_params)
      for ranking in data:
          sum_ = weights.take(ranking).sum()
          for i, winner in enumerate(ranking[:-1]):
              val = 1.0 / sum_
              for loser in ranking[i+1:]:
                  chain[loser, winner] += val
              sum_ -= weights[winner]
      chain -= np.diag(chain.sum(axis=1))
      return log_transform(statdist(chain))