code: def fit_above_thresh(distr, vals, thresh=None):
      
      vals = numpy.array(vals)
      if thresh is None:
          thresh = min(vals)
      else:
          vals = vals[vals >= thresh]
      alpha = fitalpha_dict[distr](vals, thresh)
      return alpha, fitstd_dict[distr](vals, alpha)
docs: Maximum likelihood fit for the coefficient alpha
  
      Fitting a distribution of discrete values above a given threshold.
      Exponential  p(x) = alpha exp(-alpha (x-x_t))
      Rayleigh     p(x) = alpha x exp(-alpha (x**2-x_t**2)/2)
      Power        p(x) = ((alpha-1)/x_t) (x/x_t)**-alpha
      Values below threshold will be discarded.
      If no threshold is specified the minimum sample value will be used.
  
      Parameters
      ----------
      distr : {'exponential', 'rayleigh', 'power'}
          Name of distribution
      vals : sequence of floats
          Values to fit
      thresh : float
          Threshold to apply before fitting; if None, use min(vals)
  
      Returns
      -------
      alpha : float
          Fitted value
      sigma_alpha : float
          Standard error in fitted value