docs: def optimal_distribution(data, distr_to_check=('norm', 'expon', 'uniform')):
      '''Calculate the parameters of a fit of different distributions to a data set
         and returns the distribution of the minimal ks-distance.
  
      Parameters:
          data: array of data points to be fitted
  
      Options:
          distr_to_check: tuple of distributions to be checked
  
      Returns:
          FitResults object with fitted parameters, errors and distribution type\
              of the fit with the smallest fit distance
  
      Note:
          Uses Kolmogorov-Smirnov test to estimate distance and p-value.
      '''
      fit_results = [fit(data, d) for d in distr_to_check]
      return min(fit_results, key=lambda fit: fit.errs[0])