Skip to content

Docs: Add visual documentation for adstock mode parameter (Before/After/Overlap) #2522

@daimon-pymclabs

Description

@daimon-pymclabs

Issue generated by @drbenvincent from an EAP advisory call discussion.

Problem

The adstock transformations (DelayedAdstock, WeibullPDFAdstock, etc.) support a mode parameter with three convolution modes:

  • After — traditional trailing decay (standard adstock)
  • Before — "excitement" / ramp-up effect (forward-looking)
  • Overlap — pull-forward and pull-backward

This parameter is defined in the code and mentioned in docstrings, but there are no plots demonstrating the visual effect of changing mode. Users currently see plots for different alpha/theta/k/lambda values but nothing showing what mode="Before" or mode="Overlap" actually looks like.

This was highlighted during a technical discussion where a production MMM team was unaware this feature existed. The mode parameter is particularly useful for modeling holiday/event effects — e.g., a ramp-up in purchasing before a holiday followed by decay after — but is effectively undiscoverable without visual documentation.

Suggested approach

Either (or both):

  1. Docstring plots — Add example plots to the adstock class docstrings showing the same transformation with mode="After" vs mode="Before" vs mode="Overlap" side by side
  2. Dedicated docs page or section — Extend the existing adstock functions guide notebook (docs/source/notebooks/mmm/adstock_functions_guide.ipynb) with a section on the mode parameter, including:
    • Visual comparison of all three modes
    • Practical use cases (e.g., holiday ramp-up, event anticipation effects)
    • How to apply this to event/holiday indicator variables

Context

The delayed adstock page already shows plots for varying theta and k/lambda, but the mode parameter is absent from all visualizations. The Weibull PDF adstock page similarly lacks mode demonstrations.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions