agg_nearest seems to be not so similar to nearest at all. It will only be similar when multimodal would return a single interval. Otherwise, it also includes all the intervals between the HDI intervals and can contain much more probability than the requested "hdi_prob". Personally, I don't see a use for agg_nearest; I see it as being similar to reaching for a CDF estimated from a KDE instead of an ECDF. I think the smoothing would in general only make the estimate worse. If something similar to nearest that forces contiguity but uses "bin centers" is really what's desired, a JIT-compiled sliding window approach would be quite efficient.
On @OriolAbril 's suggestion, this PR removes the method, which was never in the original ArviZ.
As discussed in https://github.com/arviz-devs/arviz-stats/pull/28#issuecomment-2414524683, HDI method
agg_nearest
is not very useful as an HDI estimator compared to our other options. From that comment:On @OriolAbril 's suggestion, this PR removes the method, which was never in the original ArviZ.
📚 Documentation preview 📚: https://arviz-stats--31.org.readthedocs.build/en/31/