sid.policies
¶
This module contains the code to for applying contact policies.
Module Contents¶
Functions¶
|
Apply policies to contacts. |
|
Compute pseudo effect sizes of policies. |
- apply_contact_policies(contact_policies: Dict[str, Dict[str, Any]], contacts: pandas.DataFrame, states: pandas.DataFrame, date: pandas.Timestamp, seed: itertools.count) pandas.DataFrame [source]¶
Apply policies to contacts.
- compute_pseudo_effect_sizes_of_policies(policies: Dict[str, Dict[str, Any]], states: Optional[pandas.DataFrame] = None) Dict[str, Dict[str, Union[float, pandas.Series]]] [source]¶
Compute pseudo effect sizes of policies.
This function returns either the multiplicand of a policy or computes a pseudo effect size by passing a
pandas.Series
with booleans set toTrue
to the policy function. The effect size is the average of the returnedpandas.Series
.How is the effect size interpreted.
The effect is an average treatment effect on the whole population since this simple approach cannot infer which share of the population is affected by the policy.
The pseudo effect size can be interpreted as an effect on the average of contacts for this contact model.
- Parameters
- Returns
effects – A dictionary containing for each contact model the mean effect size and a raw effect size if a pseudo effect was computed.
- Return type