question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Diagnostics + Stats to use xarray

See original GitHub issue

Use InferenceData as a default data-structure for diagnostics and stats. Use dim names to do calculations correctly. (chain,draw).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
OriolAbrilcommented, May 27, 2019

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:

log_likelihood = inference_data.sample_stats.log_likelihood
log_likelihood = log_likelihood.stack(n_samples=('chain','draw'), data_points=log_likelihood.dims[2:])
n_samples, n_data_points = log_likelihood.shape

Also, fun fact, this will only work on python>=3.6, because from 3.6 on, kwargs maintain their order.

1reaction
ahartikainencommented, Mar 26, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use xarray throughout · Issue #97 · arviz-devs/arviz - GitHub
It has the trace as the first level, and diagnostics and stats as the second level. The second level is optional but will...
Read more >
arviz.stats.stats — ArviZ dev documentation
The weights are stabilized using the Bayesian bootstrap. ... "stats", "diagnostics") if not isinstance(kind, str) or kind not in kind_group: raise ...
Read more >
Xarray related projects
wrf-python: A collection of diagnostic and interpolation routines for use with ... curvature, zonal-statistics, proximity, hillshading, viewshed, etc.).
Read more >
xarray.apply_ufunc() with GroupBy: unexpected number of ...
import xarray as xr # http://xarray.pydata.org/en/stable/dask.html from scipy import stats from dask.diagnostics import ProgressBar import ...
Read more >
How to Access MERRA-2 Data using OPeNDAP with Python3 ...
We also demonstrate how to calculate the daily/weekly/monthly statistics from the ... You may want to test first if your xarray package can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found