10000 gh-115532: Add kernel density estimation to the statistics module by rhettinger · Pull Request #115863 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115532: Add kernel density estimation to the statistics module #115863

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

Merged
merged 19 commits into from
Feb 25, 2024
Merged
Changes from 1 commit
Commits
File filter 10000

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve variable names in integration using the midpoint rule.
  • Loading branch information
rhettinger committed Feb 24, 2024
commit 5ac105514b216517b557bc11b7c91b85b91df26e
6 changes: 3 additions & 3 deletions Lib/test/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2369,9 +2369,9 @@ def test_kde(self):

def integrate(func, low, high, steps=10_000):
"Numeric approximation of a definite function integral."
width = (high - low) / steps
xarr = (low + width/2 + width * i for i in range(steps))
return sum(map(func, xarr)) * width
dx = (high - low) / steps
midpoints = (low + (i + 1/2) * dx for i in range(steps))
return sum(map(func, midpoints)) * dx

for kernel in kernels:
with self.subTest(kernel=kernel):
Expand Down
0