ExperimentDesigner#
- class pymc_marketing.mmm.experiment_design.designer.ExperimentDesigner(mmm)[source]#
Posterior-aware experiment designer for marketing lift tests.
Consumes a fitted MMM and recommends which experiment to run based on posterior uncertainty. Supports national-level experiments analysed via Interrupted Time Series (ITS).
The designer uses the model’s own computational graph (via
extract_response_distribution) to evaluate channel contributions, so it works with any adstock/saturation combination automatically.Note
Assurance values are conditional on the MMM being reasonably well-identified. If a channel’s effect is confounded (e.g., spend correlates strongly with seasonal demand or another channel), the posterior may be confidently wrong, producing misleadingly high assurance. Always review model diagnostics (posterior predictive checks, prior sensitivity, spend correlation) before acting on recommendations. High spend correlation is flagged automatically in each recommendation’s rationale.
- Parameters:
- mmm
MMM A fitted
pymc_marketing.mmm.multidimensional.MMMinstance (or the legacypymc_marketing.mmm.MMM). Must have been fitted (mmm.idatais notNone).
- mmm
- Raises:
ValueErrorIf the MMM has not been fitted.
NotImplementedErrorIf
adstock_first=False(not supported in v1).
Examples
from pymc_marketing.mmm import MMM from pymc_marketing.mmm.experiment_design import ExperimentDesigner mmm = MMM(...) mmm.fit(X, y) designer = ExperimentDesigner(mmm) recommendations = designer.recommend( spend_changes=[0.1, 0.2, 0.3, -0.5, -1.0], durations=[4, 6, 8, 12], )
Methods
ExperimentDesigner.from_idata(idata[, ...])Create an ExperimentDesigner from a saved InferenceData fixture.
Plot adstock ramp fraction vs. experiment duration.
Plot per-channel diagnostic summary.
Grid of lift posterior distributions for one channel.
ExperimentDesigner.plot_power_cost(...[, ...])Scatter plot of assurance vs. absolute net cost.
Plot the saturation curve with posterior uncertainty.
ExperimentDesigner.recommend([...])Recommend experiments across all channels.