-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add plot for distribution of convergence diagnostics #105
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
- Coverage 85.22% 84.53% -0.69%
==========================================
Files 25 26 +1
Lines 2876 3000 +124
==========================================
+ Hits 2451 2536 +85
- Misses 425 464 +39 ☔ View full report in Codecov by Sentry. |
I love that @aloctavodia , I think it'd be super helpful for most models, because a huge majority is highly dimensional and the classic plots don't allow you to diagnose the parameters quickly |
Anything I can help with to merge this one @aloctavodia ? |
3d22925
to
a23d3fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all good @aloctavodia , except for a typo I think. After that we can merge
docs/source/gallery/inference_diagnostics/plot_convergence_dist.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now
We probably want these two to be arguments to the function.
I would actually use both EDIT: I saw one of the examples in the docstring was using "rhat" so I already implemented this idea (for rhat only). |
Already working example with all backends shown: https://arviz-plots--105.org.readthedocs.build/en/105/gallery/plot_convergence_dist.html (bokeh also has the vertical line but it doesn't extend the axis limits up to the vertical line so ends up hidden, a bit weird but hopefully not super critical) |
LGTM, not sure what's the source of the new error. |
The old error was pre-commit. I have started adding tests and realized we need to work a bit on the API for the ess methods (test is currently failing but pushed anyway so it is here already) |
c0050b4
to
a80118c
Compare
sorry for the mess! |
I don't have a good name for this plot so its code name is
plot_nose
. The motivation is to visually inspect the values of ESS and R-hat for many variables.In PyMC-BART we have a plot_convergence function that generates a similar plot, which we used to check the "BART variables" which are always multidimensional with a size at least equal to the observations. The interest is not on any individual variables. This type of plot may be of interest to others outside of PyMC-BART.
I feel tempted to call "rhat_rank" just "rhat". What do you think?
specific diagnostics can be passed as strings.
some ess methods accept a prob argument, we can pass it also as part of the string, like a "tuple"
We could also add reference lines for ESS and r-hat following standard recommendations(added). For PyMC-BART, we have an "inflated" R-hat reference value. We use a heuristics to increase the 1.01 value based on the number of variables. Not saying we should use that heuristic, just saying we may want to have something similar.📚 Documentation preview 📚: https://arviz-plots--105.org.readthedocs.build/en/105/