8000 gh-115532: Minor tweaks to kde() by rhettinger · Pull Request #117897 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115532: Minor tweaks to kde() #117897

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 3 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

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
Add kernel invcdf for the parabolic kernel
  • Loading branch information
rhettinger committed Apr 15, 2024
commit 3fe2c653d095b7fbd42f73e6fd9564432d24ed12
3 changes: 2 additions & 1 deletion Doc/library/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ accurately approximated inverse cumulative distribution function.
.. testcode::

from random import choice, random, seed
from math import sqrt, log, pi, tan, asin
from math import sqrt, log, pi, tan, asin, cos, acos
from statistics import NormalDist

kernel_invcdfs = {
Expand All @@ -1172,6 +1172,7 @@ accurately approximated inverse cumulative distribution function.
'sigmoid': lambda p: log(tan(p * pi/2)),
'rectangular': lambda p: 2*p - 1,
'triangular': lambda p: sqrt(2*p) - 1 if p < 0.5 else 1 - sqrt(2 - 2*p),
'parabolic': lambda p: 2 * cos((acos(2*p-1) + pi) / 3),
'cosine': lambda p: 2*asin(2*p - 1)/pi,
}

Expand Down
0