Skip to content

Allow for HSGP Component in MMM class #1250

@williambdean

Description

@williambdean

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions