UpDownGeoLift#
- class causalpy.experiments.up_down_geolift.UpDownGeoLift[source]#
Estimate signed up and down geo effects against unchanged controls.
armsmaps each of"up","down", and"control"to a nonempty sequence of geo columns in a wide revenue panel. All geos share one intervention date. Fitting uses the same synthetic-control model asSyntheticControl; the arm methods aggregate its joint posterior draws without fitting separate models or treating down geos as donors.Attribution requires adequate pre-period donor fit, no spillovers into controls, and no concurrent geo-specific changes correlated with arms. Arm labels describe assignment, not the amount of media actually delivered.
- Parameters:
data (
DataFrame) – Wide revenue panel with a unique, sorted time index and geo columns.treatment_time (
int|float|Timestamp) – First intervention period, shared by all up and down geos.arms (
Mapping[str,Sequence[str]]) – Nonempty and disjointup,down, andcontrolgeo groups.model (
PyMCModel|RegressorMixin|None) – Counterfactual model. Defaults toSoftmaxWeightedSumFitter.min_donor_correlation (
float) – Minimum pre-period correlation before warning about a donor.auto_scale_sigma (
bool) – Whether to scale the stock observation-noise prior by pre-period data.
Notes
The inherited three-panel
plot()labels revenue and impact axes fromdata.attrs["unit"]when present. A per-period unit such asUSD/weekbecomesUSDon the cumulative-impact axis.Methods
UpDownGeoLift.aggregate_draws(*[, start, ...])Aggregate a common inclusive post-intervention window within draws.
UpDownGeoLift.arm_effect_table(*[, start, ...])Summarize geo and arm effects with 94% equal-tailed intervals.
Construct the model graph without sampling anything.
UpDownGeoLift.effect_summary(*[, group, ...])Generate a decision-ready summary of causal effects for Synthetic Control.
UpDownGeoLift.fit(**kwargs)Run the posterior phase and populate
result.UpDownGeoLift.generate_report(*[, ...])Generate a self-contained HTML report for this experiment.
UpDownGeoLift.get_plot_data(*[, group, ...])Recover the data of the experiment along with the prediction and causal impact information.
UpDownGeoLift.input_validation(data, ...)Validate the input data and model formula for correctness.
UpDownGeoLift.plot(*[, group, round_to, ...])Plot the synthetic control results for a specific treated unit.
UpDownGeoLift.print_coefficients([round_to])Ask the model to print its posterior coefficients.
UpDownGeoLift.sample_prior_predictive(**kwargs)Run the optional prior phase and populate
prior_result.UpDownGeoLift.set_maketables_options(*[, ...])Set optional maketables rendering options for this experiment.
UpDownGeoLift.summary([round_to])Print summary of main results and model coefficients.
UpDownGeoLift.to_mmm_lift(*, spend_baseline, ...)Export per-period geo lift rows for scalar MMM saturation calibration.
Attributes
arm_impact_drawsDraw-wise mean impact across geos in each intervention arm.
datapostData from on or after the treatment time (inclusive).
datapreData from before the treatment time (exclusive).
has_prior_predictiveWhether the prior phase has run (draws, and bundle where kept).
idataReturn fitted DataTree when the model backend supports it.
impact_drawsSigned per-period impact with aligned joint geo posterior draws.
is_builtWhether the model graph / fit design exists (no draws implied).
is_configureddesign matrices are ready.
is_fittedWhether posterior draws and the posterior result bundle exist.
modelThe underlying model instance.
prior_resultPrior-group result bundle; raises before prior sampling.
resultPosterior-group result bundle; raises before
fit().supports_bayessupports_olssupports_pymc_forecastlabelsdata- __init__(data, treatment_time, arms, model=None, *, min_donor_correlation=0.0, auto_scale_sigma=True)[source]#
- classmethod __new__(*args, **kwargs)#