Skip to content
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

help hdi() fail gracefully with fixed draws #194

Closed
kevingoneill opened this issue Aug 29, 2023 · 1 comment
Closed

help hdi() fail gracefully with fixed draws #194

kevingoneill opened this issue Aug 29, 2023 · 1 comment

Comments

@kevingoneill
Copy link

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!

@mjskay mjskay closed this as completed in ee75e84 Sep 3, 2023
@mjskay
Copy link
Owner

mjskay commented Sep 3, 2023

Thanks! Should be fixed on the github version now; can be installed via remotes::install_github("mjskay/ggdist")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants