Skip to content
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

HDI column names incorrect #2399

Open
sandstromviktor opened this issue Dec 2, 2024 · 2 comments
Open

HDI column names incorrect #2399

sandstromviktor opened this issue Dec 2, 2024 · 2 comments

Comments

@sandstromviktor
Copy link

sandstromviktor commented Dec 2, 2024

Issue: Incorrect Naming of HDI Columns in summary output

Thanks for producing a very useful and great tool! I've found a small thing that would improve Arviz.

The summary function produces HDI columns labeled as hdi_<alpha>% and hdi_<1-alpha>%, which is misleading. For example, a 94% HDI does not correspond to the 3% and 97% quantiles (as it’s not a confidence interval).

Proposed Fix

Rename the columns to reflect their meaning more accurately:

on lines 1424-1426 in arviz/stats/stats.py, this:

            metric_names.extend(
                ("mean", "sd", f"hdi_{100 * alpha / 2:g}%", f"hdi_{100 * (1 - alpha / 2):g}%")
            )

should be something similar to this:

            metric_names.extend(
                ("mean", "sd", f"hdi_{100 * alpha:g}_lower%", f"hdi_{100 * (alpha):g}_upper%")
            )

This change would improve clarity and prevent confusion about the nature of the HDI.

@sethaxen
Copy link
Member

sethaxen commented Dec 2, 2024

Related to #2306 and proposes an alternative to the solution proposed there.

@sandstromviktor
Copy link
Author

Thanks for showing me the related issue that i didn't find before. Should I close this?

I don't have any strong opinions in this matter, only that this naming is (very much) incorrect and anything proposed in #2306 is better. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants