Skip to content
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

Ability to use shared hyperpriors between different covariates #687

Open
lemartinet opened this issue Jun 22, 2023 · 1 comment
Open

Ability to use shared hyperpriors between different covariates #687

lemartinet opened this issue Jun 22, 2023 · 1 comment

Comments

@lemartinet
Copy link

lemartinet commented Jun 22, 2023

Hi!

I have a custom pymc model that I'd like to port to Bambi in the future. The model is of the form:

y ~ N(1 + treatment + row + col, s_y)

In this model we have a pattern like this to set priors:

spatial_variance_ratios = pm.Dirichlet(
    "spatial_variance_ratios", a=alphas, dims="sources"
)
sigmas = {source: np.sqrt(spatial_variance_ratios[i]) for i, source in enumerate(sources)}

where sources = ["row", "col", "s_y"] and alphas is a list of the same size. Then later we would build the model with terms like this:

predictor_row = pm.Normal("predictor_row", sigma=sigmas["row"], dims="row")

I was wondering if it would be possible to support defining priors similarly in Bambi. Thanks for your thoughts on this!

@tomicapretto
Copy link
Collaborator

Related to #584 and what is commented here as well #647.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants