File tree 1 file changed +7
-1
lines changed 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):
870
870
return f_inv
871
871
872
872
def _quartic_invcdf_estimate (p ):
873
+ # A handrolled piecewise approximation. There is no magic here.
873
874
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
874
877
x = (2.0 * p ) ** 0.4258865685331 - 1.0
875
- if p >= 0.004 < 0.499 :
878
+ if p < 0.499 :
876
879
x += 0.026818732 * sin (7.101753784 * p + 2.73230839482953 )
877
880
return x * sign
878
881
@@ -886,8 +889,11 @@ def quartic_kernel():
886
889
return pdf , cdf , invcdf , support
887
890
888
891
def _triweight_invcdf_estimate (p ):
892
+ # A handrolled piecewise approximation. There is no magic here.
889
893
sign , p = (1.0 , p ) if p <= 1 / 2 else (- 1.0 , 1.0 - p )
890
894
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 ))
891
897
return x * sign
892
898
893
899
@register ('triweight' )
You can’t perform that action at this time.
0 commit comments