pymc-marketing
pymc-marketing copied to clipboard
Investigate CLV model composition
with pm.Model() as m:
hyper_priors = ...
prior1, prior2 = distribution(hyper_priors)
cohort1 = clv.ShiftedBetaGeo(data_cohort1, prior1)
cohort2 = clv.ShiftedBetaGeo(data_cohort2, prior2)
clv.ComposeModel(...)
Is this for hierarchical priors, or something more general?
Looking back on this, I can confirm BetaGeoModel
benefits from hyperpriors. The a
and b
parameters of the Beta dropout distribution seem to benefit from a hierarchical pooling approach:
https://mc-stan.org/users/documentation/case-studies/pool-binary-trials.html
Back when I was still maintaining the btyd
library, this was the only way I could get the posterior mean values to mach the MLE estimates from lifetimes
:
# Beta parameters.
a = pm.Deterministic("a", uniform_prior * pareto_prior)
b = pm.Deterministic("b", (1.0 - uniform_prior) * pareto_prior)