File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -870,9 +870,12 @@ def f_inv(y):
870870 return f_inv
871871
872872def _quartic_invcdf_estimate (p ):
873+ # A handrolled piecewise approximation. There is no magic here.
873874 sign , p = (1.0 , p ) if p <= 1 / 2 else (- 1.0 , 1.0 - p )
875+ if p < 0.0106 :
876+ return ((2.0 * p ) ** 0.3838 - 1.0 ) * sign
874877 x = (2.0 * p ) ** 0.4258865685331 - 1.0
875- if p >= 0.004 < 0.499 :
878+ if p < 0.499 :
876879 x += 0.026818732 * sin (7.101753784 * p + 2.73230839482953 )
877880 return x * sign
878881
@@ -886,8 +889,11 @@ def quartic_kernel():
886889 return pdf , cdf , invcdf , support
887890
888891def _triweight_invcdf_estimate (p ):
892+ # A handrolled piecewise approximation. There is no magic here.
889893 sign , p = (1.0 , p ) if p <= 1 / 2 else (- 1.0 , 1.0 - p )
890894 x = (2.0 * p ) ** 0.3400218741872791 - 1.0
895+ if 0.00001 < p < 0.499 :
896+ x -= 0.033 * sin (1.07 * tau * (p - 0.035 ))
891897 return x * sign
892898
893899@register ('triweight' )
You can’t perform that action at this time.
0 commit comments