-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding MCSE Plot #79
base: main
Are you sure you want to change the base?
Adding MCSE Plot #79
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #79 +/- ##
==========================================
- Coverage 84.80% 83.81% -1.00%
==========================================
Files 21 22 +1
Lines 2336 2576 +240
==========================================
+ Hits 1981 2159 +178
- Misses 355 417 +62 ☔ View full report in Codecov by Sentry. |
src/arviz_plots/plots/mcseplot.py
Outdated
|
||
# print(f"\n final z_mcse_dataset = {z_mcse_dataset}") | ||
|
||
# for now the quantile_values can be computed in the visual element function itself |
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.
you already have xdata_dataset
, also mcse_y_dataset
(which now should be the errorbars, not the y position). I think quantiles_dataset = distribution.quantile(probs, dim=mcse_dims)
will mostly give you what you want, the only problem is it will have a quantile
dimension instead of an mcse_dim
one, you can rename and reindex it or use quantile as dimension name for the other objects.
afer that you should be able to concat them into a new object with plot_axis
having x
(xdata_dataset), y
(quantiles_dataset) and error
(mcse_y_dataset) so the visual function can process that and still accept x, y in case we want aesthetics mapped to them
Rebased the PR |
First commit for MCSE plot. A lot of ESS plot conventions are followed, including the extra methods (mean and sd) and
scatter_xy
visual element portions developed in it.The computing of quantiles for plotting the errorbars as desired requires subsetting the distribution so the subsets can be flattened and then the
arviz-stats
quantile function called- thexarray_sel_iter
function fromarviz_base
was imported and attempted to be used for this. I then tried to concatenate the computed values to themcse_dataset
along the plot_axis dim as coordinate 'z'. There are some issues with achieving this though since thexr.concat()
andxr.merge()
are not in-place functions so the logic/algorithm for extendingmcse_dataset
like this might need more thought. There might be a simpler way to do this that I haven't thought of though. This bit is marked as WIP in the code. If we pick the alternative (below) approach it could be removed altogether.Since
pc.map()
automatically subsets DataArray/Dataset type objects passed to it, moving the computation to the newerror_bar
visual element function makes it a lot more simple so this is the current implementation I've kept in this commit. This requires callingarviz-stats
and doing some computation in the visual element function which none of the other visual element functions do, but it works already. If any other plots with different logic also require usage of this visual element function then modifications might be needed.Also added the backend function
errorbar
for backend=None and backend=Matplotlib so far. The Bokeh and the new Plotly backend's implementations are left.The current visual outputs of the plot are like this:
📚 Documentation preview 📚: https://arviz-plots--79.org.readthedocs.build/en/79/