Skip to content
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

Allow for HSGP Component in MMM class #1250

Open
wd60622 opened this issue Dec 2, 2024 · 1 comment · May be fixed by #1432
Open

Allow for HSGP Component in MMM class #1250

wd60622 opened this issue Dec 2, 2024 · 1 comment · May be fixed by #1432
Labels
enhancement New feature or request request discussion TVPs Related to time varying parameters
Milestone

Comments

@wd60622
Copy link
Contributor

wd60622 commented Dec 2, 2024

Following #1246, these components should be integrated into the MMM class.

This might also support the previous boolean flags for time_varying_intercept and time_varying_media but also include passing of either of the classes, HSGP or HSGPPeriodic

from pymc_marketing.prior import Prior
from pymc_marketing.mmm import MMM, HSGPPeriodic, GeometricAdstock, LogisticSaturation

media_hsgp = HSGPPeriodic(
    scale=Prior("HalfNormal", sigma=1), 
    ls=30, # days
    period=365, # days
    ...,
    dims="date",
)

mmm = MMM(
    date_column=..., 
    channel_columns=...,
    adstock=GeometricAdstock(l_max=10),
    saturation=LogisticSaturation(),
    time_varying_intercept=True, # Previous behavior or updated with HSGP behind the scenes
    time_varying_media=media_hsgp,
    ...,
)   

The complicated aspect is that the current implementation of GPs will perform a softplus transformation on that variable. Would that be explicit now? Or handled for all custom classes within the MMM class?

Thoughts on this? @juanitorduz @cetagostini

@wd60622 wd60622 added TVPs Related to time varying parameters enhancement New feature or request request discussion and removed Needs Triage labels Dec 2, 2024
@cetagostini
Copy link
Contributor

Like a lot this implementation, very similar to what I had in mind on the issue here. Lets go for it!

@wd60622 wd60622 added this to the 0.12.0 milestone Jan 15, 2025
@wd60622 wd60622 linked a pull request Jan 24, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request request discussion TVPs Related to time varying parameters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants