Exemple #1
0
 def update_parameters(ddate, **kwargs):
     xx = (ddate - x["dates"][0]).days
     ppars = kwargs.copy()
     ppars["beta"] = kwargs["beta"] * one_minus_logistic_fcn(
         xx,
         L=kwargs["L"],
         k=kwargs["k"],
         x0=kwargs["x0"],
     )
     return ppars
Exemple #2
0
def logistic_social_policy(
        date: Date,
        **kwargs: Dict[str, FloatOrDistVar]) -> Dict[str, FloatOrDistVar]:
    """Updates beta parameter as a function of time by multiplying base parameter
    with 1 - logistic function.

    Relevant keys are:
        * dates
        * beta
        * logistic_L
        * logistic_k
        * logistic_x0
    """
    xx = (date - kwargs["dates"][0]).days
    ppars = kwargs.copy()
    ppars["beta"] = kwargs["beta"] * one_minus_logistic_fcn(
        xx,
        L=kwargs["logistic_L"],
        k=kwargs["logistic_k"],
        x0=kwargs["logistic_x0"],
    )
    return ppars