Skip to content

Commit

Permalink
fix per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aloctavodia committed Jun 5, 2024
1 parent 5cb460e commit ada4736
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion arviz/plots/khatplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,13 @@ def plot_khat(
good_k = khats.good_k
khats = khats.pareto_k
if not isinstance(khats, DataArray):
raise ValueError("Incorrect khat data input. Check the documentation")
good_k = None
warnings.warn(
"support for DataArrays will be deprecated, please use ELPDData."
"The reason for this, is that we need to know the numbers of draws"
"sampled from the posterior",
FutureWarning,
)

khats = get_coords(khats, coords)
dims = khats.dims
Expand Down
2 changes: 1 addition & 1 deletion arviz/stats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def loo(data, pointwise=None, var_name=None, reff=None, scale=None):

if np.any(pareto_shape > good_k):
warnings.warn(
f"Estimated shape parameter of Pareto distribution is greater than {good_k:.1f} "
f"Estimated shape parameter of Pareto distribution is greater than {good_k:.2f} "
"for one or more samples. You should consider using a more robust model, this is "
"because importance sampling is less likely to work well if the marginal posterior "
"and LOO posterior are very different. This is more likely to happen with a "
Expand Down
4 changes: 2 additions & 2 deletions arviz/stats/stats_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ def get_log_likelihood(idata, var_name=None, single_var=True):
Pareto k diagnostic values:
{{0:>{0}}} {{1:>6}}
(-Inf, {{8:.1f}}] (good) {{2:{0}d}} {{5:6.1f}}%
({{8:.1f}}, 1] (bad) {{3:{0}d}} {{6:6.1f}}%
(-Inf, {{8:.2f}}] (good) {{2:{0}d}} {{5:6.1f}}%
({{8:.2f}}, 1] (bad) {{3:{0}d}} {{6:6.1f}}%
(1, Inf) (very bad) {{4:{0}d}} {{7:6.1f}}%
"""
SCALE_DICT = {"deviance": "deviance", "log": "elpd", "negative_log": "-elpd"}
Expand Down

0 comments on commit ada4736

Please sign in to comment.