UpDownGeoLift.to_mmm_lift#
- UpDownGeoLift.to_mmm_lift(*, spend_baseline, spend_realized, channel, spend_unit, outcome_unit, start=None, end=None)[source]#
Export per-period geo lift rows for scalar MMM saturation calibration.
Both spend frames require
(geo, channel)MultiIndex columns. Their values must be inspend_unitper outcome period, and revenue must be inoutcome_unitper the same period.xis mean baseline spend;delta_xis mean realized minus baseline spend;delta_yandsigmasummarize posterior draws of mean signed revenue impact. The selected window is inclusive and identical for spend and outcome. Baseline spend and the delivered change must each be stable across the window because a nonlinear saturation curve evaluated at mean spend generally differs from the mean of period-level responses. The six scalar likelihood columns are accompanied by arm, window, and unit metadata. The joint posterior remains inimpact_draws.- Parameters:
spend_baseline (
DataFrame) – Business-as-usual spend panel with(geo, channel)columns andattrs['unit']matchingspend_unit.spend_realized (
DataFrame) – Delivered spend panel on the same period grid and in the same units.channel (
str) – Tested channel name used in the MMM.spend_unit (
str) – Spend unit per outcome period, matching both spend frame attributes.outcome_unit (
str) – Revenue unit per outcome period, matching the fitted revenue attribute.start (
int|float|Timestamp|None) – First included post-intervention period.end (
int|float|Timestamp|None) – Last included post-intervention period.
- Returns:
One scalar lift row per treated geo with signed effect and spend change, posterior standard deviation, and unit and window metadata.
- Return type:
pd.DataFrame