I’ve been testing the latest version of pymc-marketing, which currently allow for custom prior by changing the model_config dictionary.
I can see how to priors can be configured across all beta_channels, but i’d like to know if i am able to set a custom distribution to a single one of my beta_channels. Specifically, i’d like to force a specific channel effect to be negative (currently they are necessarily positive, due to the use of HalfNormal distributions).
It’s potentially not the best solution into the long term, but for now is it possible to make your data negative - e.g if you have 100 impressions in week 1, they are adjusted to be -100 impressions, and then the end impact will be negative (even with a positive coefficient)
I’d like to achieve a similar results by changing the prior distribution on the coefficient for that variable, but i am having a hard time properly encoding prior knowledge and tests for specific channels using this package.
You can specify the parameters of the sigma prior on the coefficients beta_channel. If you pass a vector like [1, 10] (if you have two channels), you get different priors for them:
You then pass my_model_config when creating the MMM model. We should probably consider allowing arbitrary prior distributions, not just HalfNormal. Mixing of different distributions might be hard though.
Thank you! i’ll keep an eye out for these updates. As you mentioned, having specific distributions is for each channel could be convenient. In my case, there are channels and adstock level for which i am quite confident in the coefficient that they have, due prior experiments. So i would rather not estimate them again, but just set prior specifically to those channels, which are closer to the coefficient value i am confident in.
Some more flexible distribution like Gamma would allow you to parametrize with mu and sigma, and then you could set those you are confident easily with those parameters.
Like pm.Gamma("beta_cannel", mu=[1, 1], sigma=[10, 0.1]) (using PyMC API, but the ideas is the same)