Skip to content

HDI column names incorrect  #2399

@sandstromviktor

Description

@sandstromviktor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions