<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fit_above_thresh(distr, vals, thresh=None):
 """ 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 """

    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)