def alpha_ML(data, xmin, xmax):
    '\n    uses maximum likelihood to estimation\n    to determine power-law and error\n    From Clauset et al. 2010\n    '
    data = data[np.isfinite(data)]
    data = data[((data >= xmin) & (data <= xmax))]
    alpha = (1 + (len(data) * (np.sum(np.log((data / xmin))) ** (- 1))))
    error = ((alpha - 1) / np.sqrt(len(data)))
    N = len(data)
    loglike = (((N * np.log((alpha - 1))) - (N * np.log(xmin))) - (alpha * np.sum(np.log((data / xmin)))))
    return (alpha, error, loglike, xmin, xmax)
uses maximum likelihood to estimation
to determine power-law and error
From Clauset et al. 2010
def alpha_ML(data, xmin, xmax):
    '\n    uses maximum likelihood to estimation\n    to determine power-law and error\n    From Clauset et al. 2010\n    '
    data = data[np.isfinite(data)]
    data = data[((data >= xmin) & (data <= xmax))]
    alpha = (1 + (len(data) * (np.sum(np.log((data / xmin))) ** (- 1))))
    error = ((alpha - 1) / np.sqrt(len(data)))
    N = len(data)
    loglike = (((N * np.log((alpha - 1))) - (N * np.log(xmin))) - (alpha * np.sum(np.log((data / xmin)))))
    return (alpha, error, loglike, xmin, xmax)