pymc-labs / pymc-marketing

Bayesian marketing toolbox in PyMC. Media Mix (MMM), customer lifetime value (CLV), buy-till-you-die (BTYD) models and more.
https://www.pymc-marketing.io/
Apache License 2.0
648 stars 175 forks source link

Add ROAS plot #72

Open lucianopaz opened 1 year ago

lucianopaz commented 1 year ago

Add a method to compute the return of ad spend for certain channels and plot it. The plot could follow the style of figure 3 from Jin et al 2017, which I'll copy down here just as a reference.

image

ricardoV94 commented 1 year ago

Challenge: We need to do a forward pass to get these results.

wd60622 commented 2 months ago

Could the "channel_contributions" Deterministic be used for this?

For instance,

import xarray as xr 

# (chain, draw, date, channel)
channel_contributions = mmm.fit_result["channel_contribution"]
# Divide with spends from the data
# (date, channel)
spends: xr.DataArray = ...

roas = channel_contributions / spends

Have any thoughts on the difficulty of this @juanitorduz?

juanitorduz commented 2 months ago

Yes! We just need to be careful with the adstock contribution (similar as you did with the out-of-sample feature ;) )

wd60622 commented 2 months ago

Yes! We just need to be careful with the adstock contribution (similar as you did with the out-of-sample feature ;) )

Would this affect more than the first l_max time periods?