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
717 stars 202 forks source link

Add ROAS plot #72

Open lucianopaz opened 2 years ago

lucianopaz commented 2 years 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 5 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 5 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 5 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?