-
-
Notifications
You must be signed in to change notification settings - Fork 273
Bayesian workflow example #797
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Not sure if this belongs in case studies or elsewhere ... |
View / edit / reply to this conversation on ReviewNB twiecki commented on 2025-06-19T14:52:53Z A lot of these have not plot? fonnesbeck commented on 2025-06-19T19:58:54Z I don't understand the question. aloctavodia commented on 2025-06-19T20:06:11Z I think he means that a lot of the plots are not visible... fonnesbeck commented on 2025-06-19T20:11:30Z That's odd. Will ask Oriol about this. Would be a shame if we can't use plotly in the docs. fonnesbeck commented on 2025-06-19T20:48:38Z OK, I've fixed this. Thanks. |
View / edit / reply to this conversation on ReviewNB twiecki commented on 2025-06-19T14:55:49Z Maybe add COVID-19 or infection modeling to the title. |
Either case-study or howto, leaning towards the latter. |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:00Z The first two sentences could be "Bayesian modeling is a robust approach to draw conclusions from data. Successful modeling involves an interplay..." |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:01Z A slightly different way to write this would be
dist = pz.Gamma() pz.maxent(dist, lower=0.1, upper=20, mass=0.95);
Then, in the next cell
fig = px.histogram(x=dist.rvs(1000), nbins=20, title="Gamma Distribution Samples") fig.show()
and in the model
alpha = dist.to_pymc("alpha")
|
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:01Z we can use
alpha = pz.maxent(pz.Gamma(), lower=0.1, upper=20, mass=0.95, plot=False).to_pymc("alpha")
instead of
gamma_params = pm.find_constrained_prior( pm.Gamma, lower=0.1, upper=20, init_guess={"alpha": 6, "beta": 1}, mass=0.95 ) alpha = pm.Gamma("alpha", **gamma_params) |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:02Z plt.tight_layout() not neccesary given that we are using "arviz-doc" style |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:03Z plt.show() not neccesary? |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:03Z Just for your information "New ArviZ", has functionality for prior/likelihood sensitivity checks, see https://arviz-devs.github.io/EABM/Chapters/Sensitivity_checks.html No needed to be done now, but maybe in a next round of revision we could use "new arviz" its new prior checks, or new plot like rank plots... |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T18:40:04Z "sampels" |
I don't understand the question. View entire conversation on ReviewNB |
I think he means that a lot of the plots are not visible... View entire conversation on ReviewNB |
That's odd. Will ask Oriol about this. Would be a shame if we can't use plotly in the docs. View entire conversation on ReviewNB |
OK, I've fixed this. Thanks. View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T21:03:15Z This can be removed |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T21:03:16Z Add ; |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T21:03:16Z Also add ; |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T21:03:17Z Add ; |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T21:03:18Z Add ; |
View / edit / reply to this conversation on ReviewNB aloctavodia commented on 2025-06-19T21:03:18Z Add ; |
Everyone cool with these changes? |
A notebook adapted from course material on how to implement Gelman et al.'s Bayesian workflow, using a COVID-19 dataset.
Helpful links
📚 Documentation preview 📚: https://pymc-examples--797.org.readthedocs.build/en/797/