-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Diagnostics + Stats to use xarray #501
Comments
I think most of the functions could eat InferenceData and then use some default (bfmi, etc). We do this already in What we could change, is that user can define those default values. --> InferenceData, value_name(, group) |
I would like to start working on that @ahartikainen . But I have some questions. For the I will start working on the loo function and submit a PR to show it is a work in progress. For example:
can be modified to:
Which poses the question of whether or not to maintain the xarray datatype and modify the |
I have done most of the rewrite already for stats+diagnostics, so I think maybe we can come back to this after the PR is ready. |
I checked this a little further, and even though the code may look cleaner, the xarray version runs around 10 times slower in my computer.So I don't think it is worth it. I leave the xarray version (the previous post is already outdated) here just in case:
Also, fun fact, this will only work on python>=3.6, because from 3.6 on, kwargs maintain their order. |
Interesting insight. I do think maybe the cleanest approach is to implement "unit" functions that take in |
I gave some more though to this, because I am using the coords information in pointwise elpd plots, thus I need them to be dataarray objects. Therefore there are 2 options, either leave the calculation with arrays like it is done now and once finished convert it back to dataarray, or do the calculations with dataarrays the whole time (either via apply_ufunc or via xarray internals, preferably apply_ufunc to be compatible with arrays). I started with psislw, and I managed to convert it to a ufunc and apply it to the radon example. I only modified I will try it with logsumexp too. If you have any hints on how to start, they will be really welcome. |
Use InferenceData as a default data-structure for diagnostics and stats. Use dim names to do calculations correctly. (
chain
,draw
).The text was updated successfully, but these errors were encountered: