pymc-marketing
pymc-marketing copied to clipboard
Pull out TVP as component
Having an API like:
from pymc_marketing.mmm import TVP
tvp = TVP(...)
coords = {
"date": dates_in_model,
}
with pm.Model(coords=coords):
# Ideally one thing that the user need to know about. Example
days_since_reference = pm.Data("days_since_reference", ..., dims="date")
intercept= pm.Determistic(
"tvp_intercept",
tvp.apply(days_since_reference),
dims="date",
)
mu = intercept # + media_contributions + controls + various
# Rest of model
Related to #711
CC: @ulfaslak