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

Density for bounded distributions #36

Open
drcthal opened this issue May 3, 2019 · 4 comments
Open

Density for bounded distributions #36

drcthal opened this issue May 3, 2019 · 4 comments

Comments

@drcthal
Copy link
Contributor

drcthal commented May 3, 2019

This is more of a general kdensity issue, but if you feed in a bounded distribution, the distribution plot will show/color area outside of the bounds, while the bar plot will (correctly) not reflect that.
e.g.
set.seed(123)
prior <- runif(100)
IMPosterior(prior = prior)

@ignacio82
Copy link
Owner

Good catch. The only solution I can think is adding an argument "bounded" that you can set to TRUE and if you do that we can avoid plotting things outside the domain of the draws that are passed. Do you think that would work? do you have a better idea?

@ignacio82
Copy link
Owner

On seconds thoughts maybe the argument that we want to add is support and just pass that to kdensity

@drcthal
Copy link
Contributor Author

drcthal commented May 3, 2019

Hmm, functionally it looks like calculating densities with kdensity and support doesn't look too different from just calculating regular densities and chopping them off, so for simplicity (not changing the code and adding the dependency) I think sticking with density and chopping the ends off makes sense. It'd still be good to call the option support for consistency.

@ignacio82
Copy link
Owner

ok

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