InteractiveFixedEffectsSyntheticControl#
- class causalpy.experiments.interactive_fixed_effects.InteractiveFixedEffectsSyntheticControl[source]#
Interactive fixed-effects synthetic control on a
WidePanel.Not a
SyntheticControlsubclass. Several treated units share onetreatment_time. Control units are donors. There is non_factorsargument:max_factorsis an upper bound, not a selected rank.buildconstructs the control-panel graph. Its likelihood uses the one shared positive residual scale, not a unit observation scale.fitsamples the control-panel posterior of the shared factors, shared time intercepts, per-factor shrinkage scales, and that one scale. Treated pre-period outcomes may update the scale’s draws after that sample. They must not resample the factor or time-intercept draws. Loadings use the updated draws.The untreated counterfactual is not a donor-row prediction. Raw factors and raw loadings are not identifiers: a rotation or a sign flip leaves the product unchanged. This sampler does not impose orthonormality.
- Parameters:
data (
DataFrame) – Balanced wide panel indexed by time. Used columns must have no missing values.treatment_time (
int|float|Timestamp) – Shared first post-period time. Rows at this time are post-period.control_units (
list[str] |tuple[str,...]) – Donor columns.treated_units (
list[str] |tuple[str,...]) – Treated columns. One or more.max_factors (
int) – Upper bound on the number of factors. Not a selected rank.
Methods
Construct the control-panel graph without sampling.
InteractiveFixedEffectsSyntheticControl.compose_result(*, ...)Compose the frozen result from component draws.
Sample the joint posterior and populate
result.Plot the reconstructed untreated trajectory and impact panels.
Attributes
control_unitsDonor names, in the order supplied at construction.
treated_unitsTreated names, in the order supplied at construction.
- classmethod __new__(*args, **kwargs)#