Skip to content

Addressed issue titled "HDI naming" by changing the lower and upper hdi bound names in stats.py summary() function to hdi_{hdi_prob}_lb and hdi_{hdi_prob}_ub #2454

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arviz/stats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ def summary(
hdi_higher = hdi_post.sel(hdi="higher", drop=True)
metrics.extend((mean, sd, hdi_lower, hdi_higher))
metric_names.extend(
("mean", "sd", f"hdi_{100 * alpha / 2:g}%", f"hdi_{100 * (1 - alpha / 2):g}%")
("mean", "sd", f"hdi_{100 * alpha / 2:g}_lb%", f"hdi_{100 * (1 - alpha / 2):g}_ub%")
)
elif stat_focus == "median":
median = dataset.median(dim=("chain", "draw"), skipna=skipna)
Expand Down Expand Up @@ -1550,6 +1550,7 @@ def summary(
return summary_df



def waic(data, pointwise=None, var_name=None, scale=None, dask_kwargs=None):
"""Compute the widely applicable information criterion.

Expand Down
2 changes: 1 addition & 1 deletion arviz/tests/base_tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,4 +881,4 @@ def test_bayes_factor():
bf_dict0 = bayes_factor(idata, var_name="a", ref_val=0)
bf_dict1 = bayes_factor(idata, prior=np.random.normal(0, 10, 5000), var_name="a", ref_val=0)
assert bf_dict0["BF10"] > bf_dict0["BF01"]
assert bf_dict1["BF10"] < bf_dict1["BF01"]
assert bf_dict1["BF10"] < bf_dict1["BF01"]
Loading