docs: def check_length_of_initial_values(self, init_values):
          """
          Ensures that `init_values` is of the correct length. Raises a helpful
          ValueError if otherwise.
  
          Parameters
          ----------
          init_values : 1D ndarray.
              The initial values to start the optimizatin process with. There
              should be one value for each index coefficient, outside intercept
              parameter, and shape parameter being estimated.
  
          Returns
          -------
          None.
          """
          # Calculate the expected number of shape and index parameters
          # Note the uneven logit model has one shape parameter per alternative.
          num_alts = self.rows_to_alts.shape[1]
          num_index_coefs = self.design.shape[1]
  
          if self.intercept_ref_pos is not None:
              assumed_param_dimensions = num_index_coefs + 2 * num_alts - 1
          else:
              assumed_param_dimensions = num_index_coefs + num_alts
  
          if init_values.shape[0] != assumed_param_dimensions:
              msg_1 = "The initial values are of the wrong dimension."
              msg_2 = "It should be of dimension {}"
              msg_3 = "But instead it has dimension {}"
              raise ValueError(msg_1 +
                               msg_2.format(assumed_param_dimensions) +
                               msg_3.format(init_values.shape[0]))
  
          return None