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:
mmmMMM

A fitted pymc_marketing.mmm.multidimensional.MMM instance (or the legacy pymc_marketing.mmm.MMM). Must have been fitted (mmm.idata is not None).

Raises:
ValueError

If the MMM has not been fitted.

NotImplementedError

If adstock_first=False (not supported in v1).

NotImplementedError

If 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.__init__(mmm)

ExperimentDesigner.from_idata(idata[, ...])

Create an ExperimentDesigner from a saved InferenceData fixture.

ExperimentDesigner.plot_adstock_ramp([...])

Plot adstock ramp fraction vs. experiment duration.

ExperimentDesigner.plot_channel_diagnostics([...])

Plot per-channel diagnostic summary.

ExperimentDesigner.plot_lift_distributions(channel)

Grid of lift posterior distributions for one channel.

ExperimentDesigner.plot_power_cost(...[, ...])

Scatter plot of assurance vs. absolute net cost.

ExperimentDesigner.plot_saturation_curve(channel)

Plot the saturation curve with posterior uncertainty.

ExperimentDesigner.recommend([...])

Recommend experiments across all channels.