Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow for HSGP Component in MMM class #1250

Open
wd60622 opened this issue Dec 2, 2024 · 1 comment
Open

Allow for HSGP Component in MMM class #1250

wd60622 opened this issue Dec 2, 2024 · 1 comment
Labels
enhancement New feature or request request discussion TVPs Related to time varying parameters

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!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request request discussion TVPs Related to time varying parameters
Projects
None yet
Development

No branches or pull requests

2 participants