Skip to content

Add Optional Delayed Adstock Transformation for More Flexible Carryover Effects #658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yujiosaka
Copy link

resolves #385

This PR implements an optional delayed adstock function to address the feature request for more flexible carryover effects, especially when dealing with channels that exhibit longer conversion periods. In my experience with travel, real estate, and other high-involvement purchases, the impact of marketing spend can peak days or even weeks after the initial touchpoint.

Previous workarounds, such as adjusting the max_lag parameter or shifting the input data manually, have proven too inflexible and ad hoc.

Key Changes:

  1. ModelSpec Modification:

    • Added a new field adstock (defaulting to "geometric") in the ModelSpec class. When set to "delayed", the model will switch to using the delayed adstock transformation.

    • Users can now activate delayed adstock by configuring the model as follows:

      model_spec = meridian.model.spec.ModelSpec(adstock="delayed")
  2. Delayed Adstock Implementation:

  3. Prior Distributions:

    • New Uniform priors have been added for the delay parameters (theta_m, theta_rf, etc.) in the PriorDistribution class.
    • By default, theta is assigned a Uniform prior over the range [0, max_lag - 1]. This choice is noninformative and allows the model to learn the appropriate delay from data. In our reading (e.g., Bayesian Methods for Media Mix Modeling with Carryover and Shape Effects, section 2.1), a uniform prior for delay is suitable when no strong prior assumptions are available.

Copy link

google-cla bot commented Apr 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] A more flexible carryover effect
1 participant