def logistic4(x, A, B, C, D):
    """4-parameter logistic model

    y = D + (A - D) / (1 + ((x / C)**B))

    A is min
    B is Hill coef
    C is inflection
    D is max
    """
    return D + (A - D) / (1 + ((x / C)**B))