MCPcopy Index your code
hub / github.com/RustPython/RustPython / cosine_kernel

Function cosine_kernel

Lib/statistics.py:921–928  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

919
920@register('cosine')
921def cosine_kernel():
922 c1 = pi / 4
923 c2 = pi / 2
924 pdf = lambda t: c1 * cos(c2 * t)
925 cdf = lambda t: 1/2 * sin(c2 * t) + 1/2
926 invcdf = lambda p: 2.0 * asin(2.0 * p - 1.0) / pi
927 support = 1.0
928 return pdf, cdf, invcdf, support
929
930del register, normal_kernel, logistic_kernel, sigmoid_kernel
931del rectangular_kernel, triangular_kernel, parabolic_kernel

Callers

nothing calls this directly

Calls 3

cosFunction · 0.90
sinFunction · 0.90
asinFunction · 0.90

Tested by

no test coverage detected