AugmentedSyntheticControl#
- class causalpy.experiments.augmented_synthetic_control.AugmentedSyntheticControl[source]#
Sample a joint augmented synthetic control posterior.
One PyMC model draws simplex base weights and one shared donor prognostic correction. Credible intervals of the counterfactual and the treatment effect are Bayesian intervals for that full model, not a cut posterior.
Weights are independent across treated units. Each unit’s weights are
Dirichletwith concentration ones, with a Normal likelihood on that unit’s pre-period outcomes and mean equal to the donor pre-period matrix times the unit’s weights. The prognostic regression uses donor outcomes at each time as the response and that donor’s full pre-period outcome vector as covariates, with time-specific coefficients and no intercept. Coefficients have aNormal(0, tau)prior andtauisHalfNormalwith scale 1. Both Normal likelihoods use observation scale 1. All units share onetreatment_time.- Parameters:
- Raises:
DataException – If the time axis cannot be taken from
data.BadIndexException – If
treatment_timecannot be compared with the time axis.ValueError – If the unit columns, the pre-period, or the post-period cannot support the recorded likelihoods.
Notes
The untreated counterfactual at post-period time
tfor treated unituisdonor_post[t] @ w_u + (X_u - X_donors @ w_u) @ beta[t].X_uand each donor row ofX_donorsare full pre-period outcome vectors.beta[t]is the prognostic coefficient vector at timet. The treatment effect is the treated post-period outcome minus that counterfactual. Treated post-period outcomes do not enter the counterfactual or either likelihood.Methods
AugmentedSyntheticControl.fit([sample_kwargs])Sample the joint posterior.
- classmethod __new__(*args, **kwargs)#