stan-dev / posterior

The posterior R package
https://mc-stan.org/posterior/
Other
167 stars 24 forks source link

pareto diagnostics return named values, preventing renaming #346

Closed n-kall closed 6 months ago

n-kall commented 8 months ago

Currently the pareto_* summary functions return named vectors without the preceding pareto_. e.g. pareto_convergence_rate returns a numeric named convergence_rate.

This was done as the function names were deemed too long for column names. However, this also has the side effect that the columns can not be renamed in summarise_draws (and convergence_rate is still quite long). I think all other built-in diagnostics that return single values are unnamed, so this inconsistency is a bit unexpected.

The functions names and lengths are: pareto_convergence_rate (23 characters, still 16 without pareto_) pareto_khat_threshold (21 characters, 14 without pareto_) pareto_min_ss (13 characters, 6 without pareto) pareto_khat. (11 characters, 4 without pareto_)

In contrast, the longest name for other built-in summary functions is rhat_nested (11 characters, also a recent addition), and others are shorter than 10 characters (e.g. ess_tail).

I see two options to fix this:

  1. shorten the function names where possible and then change to return unnamed values
  2. keep returning named values, but shorten the names for convergence_rate and khat_threshold (maybe convrate and khat_thresh?)