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).
- 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).NotImplementedErrorIf the saturation or adstock type is not supported.
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.