-
Notifications
You must be signed in to change notification settings - Fork 262
Add Bass Diffusion Model #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Bass Diffusion Model #1328
Conversation
Here is a crude implementation of the Bass model. Feel free to take over @juanitorduz I forget why I didn't wrap it in the ModelBuilder. Maybe I was just trying it out and familiarizing myself with the model. Maybe it will be straight forward but I remember having some concern. As for the magnitude of model = Bass(m_scaling=5000)
# Under the hood
m = m_scaling * Prior.create_variable(...) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1328 +/- ##
==========================================
+ Coverage 93.53% 93.55% +0.02%
==========================================
Files 55 56 +1
Lines 6357 6381 +24
==========================================
+ Hits 5946 5970 +24
Misses 411 411 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks @wd60622 ! I will familiarize myself with the model and push it forward 🙌 |
Sounds good! Thanks I had the idea we could parameterize it as days/weeks/months from product launch making pooling across dims / products easier. I feel like that would be an interesting insight. |
I will pick up this one so that we can merge the base model and iterate |
The magnitude of import pymc as pm
from pymc_marketing.prior import Prior
class Scaled:
def __init__(self, dist: Prior, factor: str):
self.dist = dist
self.factor = factor
@property
def dims(self):
return self.dist.dims
def create_variable(self, name: str):
var = self.dist.create_variable(f"{name}_unscaled")
return pm.Deterministic(name, var * self.factor, dims=self.dims) This would keep the model itself free from this scaling logic but still allow if needed. from pymc_marketing.prior import sample_prior
m = Scaled(Prior("HalfNormal", sigma=1), 5000)
prior = sample_prior(m) |
Description
Adding Bass Diffusion Model
Related Issue
Checklist
Modules affected
Type of change
📚 Documentation preview 📚: https://pymc-marketing--1328.org.readthedocs.build/en/1328/