-
Notifications
You must be signed in to change notification settings - Fork 7
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 method #18
density method #18
Conversation
@zeileis All tests are passing so feel free to skip over this quickly if you don't have time to review. The main thing you may (or not) want to comment on are lines 583-605. In short, to get the individual group density plots I extract the model call and then run |
Disclaimer: I'm not particularly fond of plotting the density f(x | by) against x. In most situations I'm more interested in the probability f(by | x). So this is what the "conditional density plot" Concerns: Having said that, I see two potential problems. The first is easier to address than the second, I think.
Example:
|
These are all great comments @zeileis. Some quick responses:
P.S. I'm not sure about the |
Thanks for the follow-up!
|
I'm convinced ;-) I believe that my latest changes address the main shortcomings, so feel free to "Squash and merge" if you agree. Quickly on 4 and 5, which I'll leave for a future set of PRs.
EDIT: forgot to include an example of the updated grouped density plot (i.e., with the joint bandwidth calc). library(plot2)
plot2(density(iris$Sepal.Width), by = iris$Species) Created on 2023-04-13 with reprex v2.0.2 |
Looks good, thanks. I'll post a wishlist item for 4/5. |
* Add density method * Import methods and update Namepsace * Update examples * Add grouped density plot example to README * Add tests * NEWS * Use joint bandwidth * update tests * Add envir
Fixes #17
Examples:
Created on 2023-04-11 with reprex v2.0.2