help hdi() fail gracefully with fixed draws
kevingoneill opened this issue · comments
Hi,
I'm running into an issue where sometimes my draws are fixed (i.e., all samples have the same value), like for the diagonals of a covariance matrix. This works fine for some summary functions, e.g., qi(rep(0, times=10000))
yields the desired output of [0, 0]
.
But if I try hdi(rep(0, times=10000))
, I get the error Error in bw.SJ(x, method = "dpi", ...) : sample is too sparse to find TD
. From what I can tell, this used to work in previous versions of ggdist
, and has stopped working with the recent introduction of density_bounded
and density_unbounded
. Is there a way to handle this more gracefully with the new density functions?
P.S. I love this package, and use it all the time- thanks for developing it!
Thanks! Should be fixed on the github version now; can be installed via remotes::install_github("mjskay/ggdist")