bambinos / bambi

BAyesian Model-Building Interface (Bambi) in Python.
https://bambinos.github.io/bambi/
MIT License
1.09k stars 126 forks source link

I cannot set priors on auxillary parameters in distributional regressions #854

Closed zwelitunyiswa closed 5 days ago

zwelitunyiswa commented 3 weeks ago

Thanks for the ongoing work on this great package. My issue is that I cannot set priors on auxillary parameters in distributional regressions.

For example, I am using a beta_binomial likelihood, and my prior for mu is recognized, by my priors for kappa are ignored:

Screenshot 2024-11-06 at 6 00 36 AM

Same thing when I change the formula for kappa:

Screenshot 2024-11-06 at 6 03 24 AM

I have had issues when I have tried other distributions as well.

tomicapretto commented 3 weeks ago

I think you need a nested dictionary, like

priors = {
    "mu": {"1|snf_id": bmb.Prior(...)},
    "kappa":  {"Intercept": bmb.Prior(...), "snf_id": bmb.Prior(...)}.
}

Let me know if that doesnt work and I can double check

zwelitunyiswa commented 5 days ago

Perfect. That works! Thank you.