-
Notifications
You must be signed in to change notification settings - Fork 187
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
Weighted quantiles? #47
Comments
Implemented in https://observablehq.com/d/f7139ebca0286081 it's a bit less performant than d3.quantile since I used sort instead of quickselect. |
Also, not sure about the API. The typical use case might be with |
I added a note about the interpolation method—I'm using R-2, not R-7. My thinking here is that the (possibly non-integer) weights do not correspond to repeated point samples that have by chance yielded the same value, but rather represent contiguous classes (or blocks) of a certain width. We want to interpolate the value only when we are exactly on the edge between two blocks. |
The API now allows for an optional accessor (last argument of the function), weights can be specified as an accessor or an iterable, and values as an iterable. |
I tend to do something like this, but it’s pretty inefficient and requires integer weights:
A related question is how to expose weighted quantiles as a scale.
The text was updated successfully, but these errors were encountered: