-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add univariate KDE #13
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
==========================================
- Coverage 99.82% 92.82% -7.01%
==========================================
Files 11 12 +1
Lines 570 613 +43
==========================================
Hits 569 569
- Misses 1 44 +43 ☔ View full report in Codecov by Sentry. |
This PR implements univariate KDE, following #6,
as well as a cumulative variant.It tries to make as few modifications to KernelDensity as possible, in the hopes of upstreaming this code to KernelDensity. Its extra functionality is limited to:
n
histogram bins, wheren
is chosen such that the probability mass in the left padding area from convolving the kernel with the rightmost data point is less than 1e-3. This padding is removed, which without boundary correction would produce an unnormalized KDEIt differs from Python arviz primarily in when the boundary correction is performed. Python ArviZ performs it after binning the data into histograms but before convolution. We perform it after convolution.
The two methods are numerically very similar, though the maximum density of this implementation always seems to be a little higher than Python ArviZ's.
EDIT: removed the cumulative KDE functionality because it's somewhat trivial to get from the KDE and not really recommended, since the ECDF is superior for visualization.