@staticmethod
def fit_deriv(x, amplitude, x_break, alpha_1, alpha_2, delta):
    'One dimensional smoothly broken power law derivative with respect\n           to parameters'
    xx = (x / x_break)
    logt = (np.log(xx) / delta)
    f = np.zeros_like(xx)
    d_amplitude = np.zeros_like(xx)
    d_x_break = np.zeros_like(xx)
    d_alpha_1 = np.zeros_like(xx)
    d_alpha_2 = np.zeros_like(xx)
    d_delta = np.zeros_like(xx)
    threshold = 30
    i = (logt > threshold)
    if i.max():
        f[i] = ((amplitude * (xx[i] ** (- alpha_2))) / (2.0 ** ((alpha_1 - alpha_2) * delta)))
        d_amplitude[i] = (f[i] / amplitude)
        d_x_break[i] = ((f[i] * alpha_2) / x_break)
        d_alpha_1[i] = (f[i] * ((- delta) * np.log(2)))
        d_alpha_2[i] = (f[i] * ((- np.log(xx[i])) + (delta * np.log(2))))
        d_delta[i] = (f[i] * ((- (alpha_1 - alpha_2)) * np.log(2)))
    i = (logt < (- threshold))
    if i.max():
        f[i] = ((amplitude * (xx[i] ** (- alpha_1))) / (2.0 ** ((alpha_1 - alpha_2) * delta)))
        d_amplitude[i] = (f[i] / amplitude)
        d_x_break[i] = ((f[i] * alpha_1) / x_break)
        d_alpha_1[i] = (f[i] * ((- np.log(xx[i])) - (delta * np.log(2))))
        d_alpha_2[i] = ((f[i] * delta) * np.log(2))
        d_delta[i] = (f[i] * ((- (alpha_1 - alpha_2)) * np.log(2)))
    i = (np.abs(logt) <= threshold)
    if i.max():
        t = np.exp(logt[i])
        r = ((1.0 + t) / 2.0)
        f[i] = ((amplitude * (xx[i] ** (- alpha_1))) * (r ** ((alpha_1 - alpha_2) * delta)))
        d_amplitude[i] = (f[i] / amplitude)
        d_x_break[i] = ((f[i] * (alpha_1 - ((((alpha_1 - alpha_2) * t) / 2.0) / r))) / x_break)
        d_alpha_1[i] = (f[i] * ((- np.log(xx[i])) + (delta * np.log(r))))
        d_alpha_2[i] = (f[i] * ((- delta) * np.log(r)))
        d_delta[i] = ((f[i] * (alpha_1 - alpha_2)) * (np.log(r) - (((t / (1.0 + t)) / delta) * np.log(xx[i]))))
    return [d_amplitude, d_x_break, d_alpha_1, d_alpha_2, d_delta]
One dimensional smoothly broken power law derivative with respect
to parameters
@staticmethod
def fit_deriv(x, amplitude, x_break, alpha_1, alpha_2, delta):
    'One dimensional smoothly broken power law derivative with respect\n           to parameters'
    xx = (x / x_break)
    logt = (np.log(xx) / delta)
    f = np.zeros_like(xx)
    d_amplitude = np.zeros_like(xx)
    d_x_break = np.zeros_like(xx)
    d_alpha_1 = np.zeros_like(xx)
    d_alpha_2 = np.zeros_like(xx)
    d_delta = np.zeros_like(xx)
    threshold = 30
    i = (logt > threshold)
    if i.max():
        f[i] = ((amplitude * (xx[i] ** (- alpha_2))) / (2.0 ** ((alpha_1 - alpha_2) * delta)))
        d_amplitude[i] = (f[i] / amplitude)
        d_x_break[i] = ((f[i] * alpha_2) / x_break)
        d_alpha_1[i] = (f[i] * ((- delta) * np.log(2)))
        d_alpha_2[i] = (f[i] * ((- np.log(xx[i])) + (delta * np.log(2))))
        d_delta[i] = (f[i] * ((- (alpha_1 - alpha_2)) * np.log(2)))
    i = (logt < (- threshold))
    if i.max():
        f[i] = ((amplitude * (xx[i] ** (- alpha_1))) / (2.0 ** ((alpha_1 - alpha_2) * delta)))
        d_amplitude[i] = (f[i] / amplitude)
        d_x_break[i] = ((f[i] * alpha_1) / x_break)
        d_alpha_1[i] = (f[i] * ((- np.log(xx[i])) - (delta * np.log(2))))
        d_alpha_2[i] = ((f[i] * delta) * np.log(2))
        d_delta[i] = (f[i] * ((- (alpha_1 - alpha_2)) * np.log(2)))
    i = (np.abs(logt) <= threshold)
    if i.max():
        t = np.exp(logt[i])
        r = ((1.0 + t) / 2.0)
        f[i] = ((amplitude * (xx[i] ** (- alpha_1))) * (r ** ((alpha_1 - alpha_2) * delta)))
        d_amplitude[i] = (f[i] / amplitude)
        d_x_break[i] = ((f[i] * (alpha_1 - ((((alpha_1 - alpha_2) * t) / 2.0) / r))) / x_break)
        d_alpha_1[i] = (f[i] * ((- np.log(xx[i])) + (delta * np.log(r))))
        d_alpha_2[i] = (f[i] * ((- delta) * np.log(r)))
        d_delta[i] = ((f[i] * (alpha_1 - alpha_2)) * (np.log(r) - (((t / (1.0 + t)) / delta) * np.log(xx[i]))))
    return [d_amplitude, d_x_break, d_alpha_1, d_alpha_2, d_delta]