-
Notifications
You must be signed in to change notification settings - Fork 71
Allow users to define custom priors #387
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
Comments
See the discussion here pymc-devs/pymc#7416 on whether to port the |
Based on the discussion, it seems that the The code is a single file so it would be easy to copy and tweak to your liking. With access to the
Based on the old API, it might look like this: from pymc_marketing.prior import Prior
from causalpy.pymc_models import WeightedSumFitter
priors = {
"beta": Prior("Dirichlet", a=[1, 2, 3, 4], dims="coeffs"),
"sigma": Prior("Gamma", mu=1.5, sigma=0.25),
}
model = WeightedSumFitter(priors=priors)
# Check the priors
print(model.priors)
model.fit(X, y) |
Note to self: Ideally we wait for pymc-devs/pymc-extras#448 (maybe done by @williambdean) then we use that :) |
High level goals
Implementation
We can perhaps learn from
pymc-marketing
which started off allowing users to specify priors by providingdict
s but which has moved to having a prior class (see pymc-labs/pymc-marketing#759). We may find thatdict
s are fine for our purposes, but there could be advantages of going down the path of using classes. (Tagging @wd60622)The text was updated successfully, but these errors were encountered: