Hi all,
I have built a hierarchical market mix model in pymc. The model has four hierarchy levels (state, age, brand, cohort). To allow for flexibility, I have not used pymc-marketing, except for importing the saturation and adstock functions to apply to the data.
The model works great for my current use case - where the data is non-ragged. I have transformed the data to x-arrays similar to the approach taken in an example notebook by @cetagostini, (similar to the answer here) and then I get to apply the adstock function along the date dimension. This is good.
I’m now tasked with extending the model to account for two more brands that only exist in a subset of the states in the model already, and so my data becomes ragged. I don’t think I can use the x-array approach any more? Note that each cross section will have the same number of dates, so perhaps I can leverage that somehow?
I have built hierarchical models on ragged data before, but these did not include an adstock function, so a convolution along a date dimension was not needed.
Any pointers would be great! Thank you.