def METHOD_NAME(t, u, gamma, mode=None):
    n = u.size
    tau = t - np.min(t)
    expt = np.exp(gamma * tau)
    # prepare x
    x = expt - 1
    xm = np.mean(x)
    # prepare y
    y = u * expt
    ym = np.mean(y)
    # calculate slope
    var_x = np.mean(x**2) - xm**2
    cov = np.sum(y.dot(x)) / n - ym * xm
    k = cov / var_x
    # calculate intercept
    b = ym - k * xm if mode != "fast" else None
    return k * gamma, b