UpDownGeoLift#

class causalpy.experiments.up_down_geolift.UpDownGeoLift[source]#

Estimate signed up and down geo effects against unchanged controls.

arms maps 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 as SyntheticControl; 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 disjoint up, down, and control geo groups.

  • model (PyMCModel | RegressorMixin | None) – Counterfactual model. Defaults to SoftmaxWeightedSumFitter.

  • 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 from data.attrs["unit"] when present. A per-period unit such as USD/week becomes USD on 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.

UpDownGeoLift.build()

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_draws

Draw-wise mean impact across geos in each intervention arm.

datapost

Data from on or after the treatment time (inclusive).

datapre

Data from before the treatment time (exclusive).

has_prior_predictive

Whether the prior phase has run (draws, and bundle where kept).

idata

Return fitted DataTree when the model backend supports it.

impact_draws

Signed per-period impact with aligned joint geo posterior draws.

is_built

Whether the model graph / fit design exists (no draws implied).

is_configured

design matrices are ready.

is_fitted

Whether posterior draws and the posterior result bundle exist.

model

The underlying model instance.

prior_result

Prior-group result bundle; raises before prior sampling.

result

Posterior-group result bundle; raises before fit().

supports_bayes

supports_ols

supports_pymc_forecast

labels

data

__init__(data, treatment_time, arms, model=None, *, min_donor_correlation=0.0, auto_scale_sigma=True)[source]#
Parameters:
Return type:

None

classmethod __new__(*args, **kwargs)#