Generate pymc-Code from a defined pymc-marketing MMM() model

Hi,

I have been fitting a pymc-marketing model by using the MMM() constructor and customizing some parts of it using the model_config parameter.

I would now like to create the pymc code in the sense of

with pm.Model() as model:
    ...

of course including all the concrete transformations like adstock, saturation, seasonality asf.

Is this possible in some way “out of the box” or otherwise what would be the best way to reach this?

Best regards
Matthias

Hi,

I would now like to create the pymc code

I think you may need to elaborate what you mean by this.

Do you mean you would like to re-implement the pymc model used by the MMM class from scratch? If so, then maybe start with a look at its build_model method, whitin which the model is defined.

Regards
Jonas

1 Like

Thanks for the hint to the build_model method, I will try this.

1 Like