+
    0i{                    L   ^ RI Ht ^ RIt^ RIt^ RIt^ RIHtHtH	t	 ^ RIH
t ^ RIHtHt ^ RIHt ^ RIHtHtHtHtHtHtHt ^ RIHtHtHt ^ R	IHt ^ R
IH t! ^ RI"H#t#H$t$H%t%H&t& ^ RI'H(t(H)t) ^ RI*H+t+H,t, ]#! ]4       ! R R4      4       t-]#! ]P&                  4       ! R R4      4       t.]#! ]P4                  4       ! R R4      4       t/ ! R R]4      t0 ! R R4      t1 ! R R4      t2]#! ]4       ! R R4      4       t3 ! R R4      t4 ! R R4      t5 ! R  R!4      t6 ! R" R#4      t7R# )$    )productN)assert_assert_equalassert_allclose)raises)statsspecial)distributions)epps_singleton_2sampcramervonmises_cdf_cvmcramervonmises_2samp_pval_cvm_2samp_exactbarnard_exactboschloo_exact)mannwhitneyu
_mwu_state_MWU)_TestPythranFunc)array_api_extra)make_xp_test_casexp_default_dtypeis_numpyeager_warns)xp_assert_equalxp_assert_close)SmallSampleWarningtoo_small_1d_not_omitc                      a  ] tR t^t o ]P
                  P                  R. R	O4      R 4       tR tR t	R t
R tRtV tR# )
TestEppsSingletondtypeNc                   \        V4      '       d/   VP                  R 8  d   VR8X  d   \        P                  ! R4       Vf   \	        V4      M
\        W!4      pVP                  . R
OVR7      pVP                  . ROVR7      p\        W44      w  rV\        WRP                  RVR7      RR7       \        WbP                  RVR7      R	R7       R# )2.0float32!Pre-NEP 50 doesn't respect dtypesNr!   gHzG.@gQ?atolgQ,r?-C6?)
gffffffֿgffffff@gGz?\(\?ffffff?gQ@gq=
ףp?gGzgGz׿gp=
#(@)
gffffffg333333ÿgףp=
@g      
@gGz@g)\(@      @g(\@g(\ @333333!@)	r   __version__pytestskipr   getattrasarrayr   r   )selfr!   xpxywps   &&&    ^/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/stats/tests/test_hypotests.pytest_statistic_1"TestEppsSingleton.test_statistic_1   s     B<<BNNU2u	7IKK;<(- $72;MJJ 9@E  GJJ 3:?  A#A)::e5:9E::gU:;&I    c                    VP                  . RO4      pVP                  . RO4      p\        W#4      w  rE\        WAP                  R4      RR7       \        WQP                  R4      RR7       R# )	r   g!@MbP?r'   g&J?g-C6
?N)r         r@   r@   r@      rA   rA   rA         rC   rC   rC      
   rE   rE   rE   )rE   rB   r   rC   rE   rE   r   rC   rD      rE   rA   r?   rF   r      r?   rC   rG   rE   )r2   r   r   )r3   r4   r5   r6   r7   r8   s   &&    r9   test_statistic_2"TestEppsSingleton.test_statistic_2+   sZ    JJ 7 8JJ 8 9#A)::e,48::g.T:r<   c                z   \         P                  ! ^4      \         P                  ! ^4      r!\        \        V4      \        V4      4      w  r4\        \	        V4      \	        V4      4      w  rV\        W4      w  rx\        Y5u;8H  ;'       d    V8H  Mu 4       \        YFu;8H  ;'       d    V8H  4       R# u 4       R# )   N)nparanger   listtupler   )	r3   r5   r6   w1p1w2p2w3p3s	   &        r9   test_epps_singleton_array_like0TestEppsSingleton.test_epps_singleton_array_like5   sv    yy}biim1%d1gtAw7%eAha9%a+BBr<   c                   VP                  . RO4      VP                  ^
4      r2\        \        \        VR7      ;_uu_ 4        \        W#4      p\        VP                  VP                  VP                  4      4       \        VP                  VP                  VP                  4      4       RRR4       R#   + '       g   i     R# ; i)r?   matchr4   Nr?   r@   rA   rB   )
r2   rM   r   r   r   r   r   	statisticnanpvaluer3   r4   r5   r6   ress   &&   r9   test_epps_singleton_size*TestEppsSingleton.test_epps_singleton_size?   s{    zz,'21+3HRPP&q,CCMM2::bff+=>CJJ

266(:; QPPPs   A*B66C	c                   \         P                  P                  R 4      pVP                  RR7      pVP                  RR7      p\         P                  ! . RO4      p\	        W4RR7      w  rg\         P
                  We&   \         P
                  Wu&   \         P
                  W5^ ,          ^ 3&   \         P                  W5^,          ^3&   \         P                  ) WE^,          ^3&   VP                  V4      VP                  V4      rC\	        W4RR7      w  r\        WP                  V4      4       \        WP                  V4      4       R# )l   2$>. sizeaxisN)rE      )rE      )r?   rB   	   )rL   randomdefault_rngr2   r   r]   infr   )
r3   r4   rngr5   r6   iw_refp_refw_resp_ress
   &&        r9   test_epps_singleton_nonfinite/TestEppsSingleton.test_epps_singleton_nonfiniteG   s    ii##N3JJHJ%JJHJ%JJy!+Ar:6666VVA$'
VVA$'
ffWA$'
zz!}bjjm1+Ar:zz%01zz%01r<    Nr$   float64)__name__
__module____qualname____firstlineno__r/   markparametrizer:   rH   rV   ra   ru   __static_attributes____classdictcell____classdict__s   @r9   r    r       sE     [[W&BCJ DJ ; <2 2r<   r    c            
         a  ] tR t^[t o ]P
                  P                  R^. RO. RO3^
. RO. RO3R. RO. RO3R. RO. RO3.4      R 4       tR tR t	R t
R t]P
                  P                  R	R
R7      ]P
                  P                  RRR..4      R 4       4       t]P
                  P                  R. RO4      R 4       tR tRtV tR# )TestCvmz	n, x, ref  Nc                r    \        \        VP                  V4      V4      VP                  V4      R R7       R# r)   r'   N)r   r   r2   )r3   nr5   refr4   s   &&&&&r9   test_cdf_refTestCvm.test_cdf_ref`   s'     	A2BJJsO$Or<   c                    \        \        VP                  RR.4      R4      VP                  RR.4      4       \        \        VP                  RR.4      ^4      VP                  RR.4      4       R# )	r?   i                ?NgX(~$?gUUUUU5f@gaah?g"@)r   r   r2   )r3   r4   s   &&r9   test_cdf_supportTestCvm.test_cdf_supporti   s`    Z,?!@#F

B8,	._j,I!JBO

B8,	.r<   c                n    VP                  . RO4      p\        \        VR4      \        V4      RR7       R# )a+e?'  r)   r'   N)r   +?&pn?+MJA?d   )r2   r   r   r3   r4   r5   s   && r9   test_cdf_large_nTestCvm.test_cdf_large_np   s(    JJ@AE*HQKdCr<   c                    VP                  R VP                  R7      pR\        VR4      u;8  d	   R8  g   Q h Q hR\        V4      u;8  d	   R8  g   Q h Q hR# )gt@r&   gwJ?r   r   N)r2   ry   r   r   s   && r9   test_large_xTestCvm.test_large_xu   sW     JJuBJJJ/(1d+1c12121(1+++,+,+r<   c                    ^p\        VP                  V4      R,          \        P                  4      p\	        VP
                  W!R7      R8  g   Q h\        VP                  VP                  R4      4       R# )ri   皙?)r4   r   r   N)	r   onesr	   ndtrr   r\   r   r^   r2   )r3   r4   r   r`   s   &&  r9   
test_low_pTestCvm.test_low_p   sT     RWWQZ^W\\:q03666

BJJrN3r<   	jax.numpylazy -> no _axis_nan_policyreasonr5         ?c                   \         P                  ! \        \        R 7      ;_uu_ 4        \	        VP                  V4      \        P                  4      p\        VP                  VP                  VP                  4      4       \        VP                  VP                  VP                  4      4       RRR4       R#   + '       g   i     R# ; i)rZ   N)r/   warnsr   r   r   r2   r	   r   r   r\   r]   r^   )r3   r5   r4   r`   s   &&& r9   test_invalid_inputTestCvm.test_invalid_input   su     \\,4IJJ A=CCMM2::bff+=>CJJ

266(:; KJJJs   BB;;C	r!   c                p  a \        S4      '       d/   SP                  R 8  d   VR8X  d   \        P                  ! R4       Vf   \	        S4      M\        SV4      p\        SP                  . ROVR7      \        P                  4      p\        VP                  SP                  RVR7      4       \        VP                  SP                  RVR7      4       \        SP                  . ROVR7      R 4      p\        VP                  SP                  RVR7      4       \        VP                  SP                  R	VR7      4       \        SP                  . ROVR7      V3R
 l4      p\        VP                  SP                  RVR7      4       \        VP                  SP                  RVR7      4       R# )r#   r$   r%   Nr&   gӈk&q?gDC+?c                 J    \         P                  ! V ^,
          R,          4      # )rA   r   )r	   r   )r5   s   &r9   <lambda>'TestCvm.test_values_R.<locals>.<lambda>   s    w||QUCK'@r<   grW*?gju2`?c                 *   < SP                  V ) 4      ) # N)expm1)r5   r4   s   &r9   r   r      s    rxx|mr<   g  .?g`(r?)g333333r@   r   g?rB   皙?333333?)	r?   r@   rC   ffffff?gQ?rh      ?      @)r   r.   r/   r0   r   r1   r   r2   r	   r   r   r\   r^   )r3   r!   r4   r`   s   &&f r9   test_values_RTestCvm.test_values_R   sO   B<<BNNU2u	7IKK;<(- $72u;M
 RZZ(FeZT$\\+rzz2B%z'PQ

BJJuJ$MN RZZ(FeZT@Brzz2B%z'PQ

BJJ/@J$NO JJ=UJK#% 	rzz2B%z'PQ

BJJ/@J$NOr<   c                   \        V4      '       gO   R p\        P                  ! \        VR7      ;_uu_ 4        \	        VP                  . RO4      R4       RRR4       R# \        P                  ! ^4      RrC\	        V\        P                  P                  4      p\	        VR4      p\        VP                  VP                  3VP                  VP                  34       \	        V\        P                  P                  V4      p\	        VRV4      p\        VP                  VP                  3VP                  VP                  34       R#   + '       g   i     R# ; i)z7`cdf` must be a callable if `rvs` is a non-NumPy array.r   betaNexponr?   r@   rA   )r   ffffff?)r   r/   r   
ValueErrorr   r2   rL   rM   r
   r   cdfr   r\   r^   r   )r3   r4   messager5   argsr   r`   s   &&     r9   test_str_cdfTestCvm.test_str_cdf   s    ||OGz99rzz)4f= :))A,
4Q 3 3 7 78Q(cmmSZZ03==#**2MNQ 2 2 6 6=Q-cmmSZZ03==#**2MN :9s   EE	rw   )gy;i?g#^?gE>?gD
)?){Gz?皙?      ?g+?)g8*5?g@߾?gHm?g%1 ?)r   r   r   g333333?)g}tg?g`?gI5o?gׁsF?)r   r   r   r   rx   )rz   r{   r|   r}   r/   r~   r   r   r   r   r   r   skip_xp_backendsr   r   r   r   r   r   s   @r9   r   r   [   s     
 [[[	
02JK	13KL	35MN	35MN	+ PP.D
-4 [[!!+6S!T[[S2u+.< / U< [[W&BCP DP4O Or<   r   c                   N  a  ] tR t^t o ]P
                  P                  RRR7      R 4       tR tR t	. R7Ot
. R8OtRRR	R
/R9.RRR	R
/R:.RRR	R
/R;.RRR	R/R<.RRR	R/R=.RRR	R/R>..t]P
                  P                  R?]4      ]P
                  P                  R. R@O4      R 4       4       tRRRR/RA.RRRR/RB.RRRR/RC.RRRR/RD.RRRR/RE.RRRR/RF..t]P
                  P                  R?]4      R 4       tR t^. RGO^. RHO^. RIO/t^. RJO^. RKO^. RLO^. RMO/t^. RNO^. ROO^. RPO^. RQO^. RRO/t^. RSO^. RTO^. RUO^. RVO^. RWO^. RXO/tR tR tR tRRR	R
/RY.RRR	R
/RZ.RRR	R
/R[.RRR	R/R\.RRR	R/RZ.RRR	R/R\..t]P
                  P                  R]]4      R 4       tR t]P
                  P                  RRR7      ]P
                  P                  R	R
R.4      R 4       4       tR t]P
                  P                  RRR7      R 4       t. R^O^^^^]P@                  ^^^^^^.RR 3. R^O^^^^]P@                  ]P@                  ^^^^^.R!R"3^^]P@                  ^.^^^^]P@                  ^^^^^^.R#R$3^^]P@                  ^.^^^^]P@                  ]P@                  ^^^^^.RR%3^]P@                  ]P@                  ^.^^^^]P@                  ]P@                  ^^^^^.R&R'3.t!]P
                  P                  R_]!4      R( 4       t". R`O. RaO. RbO. RcO. RdO. ReO. RfO. RgO. RhO.	t#]P
                  P                  Ri]#4      R) 4       t$]P
                  P                  RRR7      R* 4       t%. RjOR+R,.RRk.. RjOR+R,.RRk.. RjOR+R,.RRl.. RmO^.RRn.. RmO^.RRn.. RmO^.RRo.^^.^^.RRp.^^.^^.RRp.^^.^^.RRq..	t&]P
                  P                  . RrO]&4      R- 4       t'R. t(]P
                  P                  R. RsO4      R/ 4       t). RtOt*. RuOt+R0t,R1 t-R2 t.R3 t/R4 t0R5 t1R6t2V t3R# )vTestMannWhitneyUr   r   r   c                   VP                  ^^.4      pVP                  ^^.4      pVP                  . VP                  R7      pVP                  VP                  4      p\        P                  ! \
        \        R7      ;_uu_ 4        \        W$4      p\        VP                  V4       \        VP                  V4       RRR4       \        P                  ! \
        \        R7      ;_uu_ 4        \        WC4      p\        VP                  V4       \        VP                  V4       RRR4       \        P                  ! \
        \        R7      ;_uu_ 4        \        WD4      p\        VP                  V4       \        VP                  V4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r?   r&   r   N)r2   r!   r]   r/   r   r   r   r   r   r\   r^   )r3   r4   r5   r6   emptyr]   r`   s   &&     r9   
test_emptyTestMannWhitneyU.test_empty   s3   JJ1vJJ1v

2QWW
-jj \\,4IJJq(CCMM3/CJJ, K
 \\,4IJJu(CCMM3/CJJ, K
 \\,4IJJu,CCMM3/CJJ, KJ KJ
 KJ
 KJJs$   8F/8F,8F?F)	,F<	?G	c                d   VP                  ^^.4      pVP                  ^^.4      p\        \        RR7      ;_uu_ 4        \        W#RR7       RRR4       \        \        RR7      ;_uu_ 4        \        W#RR7       RRR4       \        \        RR7      ;_uu_ 4        \        W#R	R
7       RRR4       \        \        RR7      ;_uu_ 4        \        W#RR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lg; i  + '       g   i     R# ; i)r?   z`use_continuity` must be oner   ekki)use_continuityNz`alternative` must be one ofalternativez`axis` must be an integerr   rf   z`method` must be one ofmethod)r2   assert_raisesr   r   )r3   r4   r5   r6   s   &&  r9   test_input_validation&TestMannWhitneyU.test_input_validation   s    JJ1vJJ1v:-KLLf5 M:-KLL62 M:-HIIC( J:-FGGf- HG MLLLIIGGGs0    C%/C8DD%C5	8D	D	D/	c                   \         P                  P                  R 4      p^pVP                  VP                  V^,
          4      4      pVP                  VP                  V^,
          4      4      p\	        WE4      p\	        WERR7      p\	        WERR7      pVP
                  VP
                  8X  g   Q hVP
                  VP
                  8w  g   Q hVP                  VP                  V^,
          4      4      pVP                  VP                  V^,           4      4      p\	        WE4      p\	        WERR7      p\	        WERR7      pVP
                  VP
                  8X  g   Q hVP
                  VP
                  8w  g   Q h\	        WT4      p\	        WERR7      p\	        WERR7      pVP
                  VP
                  8X  g   Q hVP
                  VP
                  8w  g   Q hVP                  VP                  V^,           4      4      pVP                  VP                  V^,           4      4      p\	        WE4      p\	        WERR7      p\	        WERR7      pVP
                  VP
                  8w  g   Q hVP
                  VP
                  8X  g   Q hVP                  VP                  V^,
          4      4      pVP                  VP                  V^,
          4      4      p\        P                  ! V4      ^,          P                  V^,          4      p\	        WE4      p\	        WERR7      p\	        WERR7      pVP
                  VP
                  8w  g   Q hVP
                  VP
                  8X  g   Q hR# )l   nEQWSf
asymptoticr   exactN)	rL   rl   rm   r2   r   r^   xpxatset)	r3   r4   ro   r   r5   r6   autor   r   s	   &&       r9   	test_autoTestMannWhitneyU.test_auto   s    ii##$67 JJszz!A#'JJszz!A#'A!!!|<
Q'2{{ell***{{j///// JJszz!A#'JJszz!A#'A!!!|<
Q'2{{ell***{{j///// A!!!|<
Q'2{{ell***{{j///// JJszz!A#'JJszz!A#'A!!!|<
Q'2{{ell***{{j///// JJszz!A#'JJszz!A#'FF1IaLQqT"A!!!|<
Q'2{{ell***{{j/////r<   r   	two-sidedr   r         0@lessgreaterr   r!   Nc                   \        V4      '       d/   VP                  R 8  d   VR8X  d   \        P                  ! R4       Vf   \	        V4      M
\        WC4      pVP                  V P                  VR7      VP                  V P                  VR7      re\        WV3/ VB p\        VP                  VP                  V^ ,          VR7      4       \        VP                  VP                  V^,          VR7      4       R# )r#   r$   z*Scalar dtypes only respected after NEP 50.Nr&   )r   r.   r/   r0   r   r1   r2   r5   r6   r   r   r\   r^   )r3   kwdsexpectedr!   r4   r5   r6   r`   s   &&&&&   r9   
test_basicTestMannWhitneyU.test_basic;  s     B<<BNNU2u	7IKKDE(- $72;Mzz$&&z.

466
0O11(4(rzz(1+Uz'KL

BJJx{%J$HIr<   r   TFc                <   VP                  V P                  4      VP                  V P                  4      rT\        WT3R R/VB p\	        VP
                  VP                  V^ ,          4      4       \	        VP                  VP                  V^,          4      4       R# )r   r   N)r2   r5   r6   r   r   r\   r^   )r3   r   r   r4   r5   r6   r`   s   &&&&   r9   test_continuity TestMannWhitneyU.test_continuityS  so     zz$&&!2::dff#511===rzz(1+'>?

BJJx{$;<r<   c           
        VP                  . RO4      pVP                  . RO4      pVP                  . RO4      R,          pVP                  . RO4      R,          pVP                  VR,
          W4,
          W5,
          W3V,           W4,           VR,           .4      p\        W&R	RR7      p. R
Op. ROp	\        VP                  VP                  V4      4       \        VP                  VP                  V	4      4       R# )r   r   r   )rg   r   Nr          @      @      @)r   r   r   r   r,   )r   r   r   r   r   )r   r   r   r   r   rk   )rE   rj         !@rG   r   rF   rD   )r?   g]U?g[?gi\?gZX<_?gx.?g 
?)r2   stackr   r   r\   r   r^   )
r3   r4   r5   y0dydy2r6   r`   
U_expected
p_expecteds
   &&        r9   test_tie_correct!TestMannWhitneyU.test_tie_correctc  s     JJ'(ZZ,-ZZ,-d2jj-.t3HHbgrubfbS&"%DIJ1b>/
I
rzz*'=>

BJJz$:;r<   c           	        \        \        R \        ^ ^ 4      4       ^V P                  ^V P                  ^V P
                  ^V P                  /pVP                  4        EF  w  r#VP                  4        EF  w  rE\        P                  ! ^ \        V4      4      p\        P                  P                  WB4       \        \        P                  P                  VR7      VRR7       \        P                  ! ^ WB,          ^,           4      p\        \        P                  P                  VR7      \        P                  P                  VR7      ,           \        P                  P!                  VR7      ,
          ^4       \        P                  P!                  VR7      p\        WRRR1,          4       \        P                  P                  W$4       \        P                  P!                  VR7      p	\        W4       EK  	  EK  	  R# )s)kr>   r'   Nrk   )setattrr   r   pn3pn4pm5pm6itemsrL   rM   lenr  
set_shapesr   r   sfpmf)
r3   p_tablesr   tablemr8   uu2r  pmf2s
   &         r9   test_exact_distribution(TestMannWhitneyU.test_exact_distribution  sg   
Ca,txxDHHa1dhhG (HAIIaQ(''-
 0 01 0 5qtD YYq!#a%(
 0 02 0 6",,,//B/"7!8",,,"2"2R"2"8!9:;=
 !ll&&&,2Y/ ''-!||''"'-*) & )r<   c                   \         P                  P                  R 4      pVP                  VP                  ^4      4      pVP                  VP                  ^4      4      p\	        W4RR7      p\	        W4RR7      pVP
                  VP
                  8X  g   Q hVP                  VP                  VP                  ,
          4      R8  g   Q hVP                  VP                  ^(4      4      pVP                  VP                  ^(4      4      p\	        W4RR7      p\	        W4RR7      pVP
                  VP
                  8X  g   Q hVP                  VP                  VP                  ,
          4      R8  g   Q hR# )i0  r   r   r   r   r>   N)rL   rl   rm   r2   r   r\   absr^   )r3   r4   ro   r5   r6   res1res2s   &&     r9   test_asymptotic_behavior)TestMannWhitneyU.test_asymptotic_behavior  s   ii##E* JJszz!}%JJszz!}%A1A6~~///vvdkkDKK/04777 JJszz"~&JJszz"~&A1A6~~///vvdkkDKK/04777r<   c                   VP                  . RO4      VP                  RR.4      r2\        W#RRR7      p\        W#RRR7      p\        VP                  VP                  4       VP                  R8  g   Q h\        W#R	RR7      p\        VP                  VP                  R4      4       \        VP                  VP                  R 4      4       R
# )r   r   r         @r   r   )r   r   r   r   r   Nr   r   r   )r2   r   r   r^   r\   )r3   r4   r5   r6   res_lres_gr`   s   &&     r9   test_exact_U_equals_mean)TestMannWhitneyU.test_exact_U_equals_mean  s     zz,'S#J)?1QvgFQyIell3||c!!!1[Irzz"~6

BJJrN3r<   c                0    \        \        R/ VB V4       R# )r?   Nr?   r@   )r   r   )r3   r   results   &&&r9   test_scalar_data!TestMannWhitneyU.test_scalar_data  s     	2T2F;r<   c           	         \        \        ^^RR7      R4       \        \        ^^RR7      R4       \        \        ^^RRR7      R\        P                  34       R# )	r?   r   r   r   r   F)r   r   N)r   r?   )r   r   rL   r]   r3   s   &r9   test_equal_scalar_data'TestMannWhitneyU.test_equal_scalar_data  sP    
 	\!Qw7B\!Q|<hG 	\!Q|168:=rvv	Hr<   c                   \         P                  P                  R 4      pRp^^
reVP                  V^^34      pVP                  ^V^^34      R,           p\        VP	                  V4      VP	                  V4      WR7      p	Rp
V	P
                  P                  V
8X  g   Q hV	P                  P                  V
8X  g   Q h\         P                  ! WtR	4      \         P                  ! WR	4      rVR
,          pVP                  VP                  8X  g   Q h\         P                  ! WzV3,           4      p\         P                  ! WV3,           4      pVP                  RR	 V
8X  g   Q hVP                  RR	 V
8X  g   Q h\         P                  ! V
4      p\         P                  ! V
4      p\        V
 Uu. uF  p\        V4      NK  	  up!   F=  pW~,          pW,          p\        VVVR7      pVP                  W&   VP
                  W&   K?  	  \        V	P
                  VP	                  V4      RR7       \        V	P                  VP	                  V4      RR7       R# u upi )l   2=U r   )r   rg   Nr   缉ؗҜ<r'   )rD   rA   rG   rk   )N.)rL   rl   rm   r   r2   r^   shaper\   moveaxisndimbroadcast_tozerosr   ranger   )r3   r   r4   ro   rg   r  r   r5   r6   r`   r.  
statisticspvaluesrp   indicesxiyitemps   &&&               r9   test_gh_12837_11113$TestMannWhitneyU.test_gh_12837_11113  s    ii##J/ "1JJ1ay!JJ1a|$s*2::a="**Q-Rzz5(((}}""e+++ {{1B'Qb)A1iLvvOOAt|,OOAt|,wws|u$$$wws|u$$$ XXe_
((5/5 95aq5 9:GBBBv6D"&..J#{{G ; 	

BJJw$7eDrzz*'=EJ !:s   -Ic                n   . ROp. ROp\        VP                  V4      VP                  V4      4      pRV^ &   \        P                  V^&   \        VP                  V4      VP                  V4      4      p\	        VP
                  VP
                  4       \	        VP                  VP                  4       R# )r?   r   Nr[   )rA   rD   rF   rG   rj   rA   r@   r?   rB   rB   rC   )r   r2   rL   rn   r   r\   r^   )r3   r4   r5   r6   r  r  s   &&    r9   test_gh_11355TestMannWhitneyU.test_gh_11355   s    -BJJqM2::a=9 !vv!BJJqM2::a=97T[[1r<   c                T   . ROp^^^\         P                  ^	^^^^^^.p\        VP                  V4      VP                  V4      4      p\	        VP
                  VP                  VP                  4      4       \	        VP                  VP                  VP                  4      4       R# )r   Nr   )rL   r]   r   r2   r   r\   r^   )r3   r4   r5   r6   res3s   &&   r9   test_gh11355_nan!TestMannWhitneyU.test_gh11355_nan.  s{     1bffaAq!Q2BJJqM2::a=9

266(:;RZZ%78r<         $@g+zQ?r   g}$k\?g     1@g!˛G*?g,s?     8@gFHQ?c                    \        VP                  V4      VP                  V4      R R7      p\        VP                  VP                  V4      RR7       \        VP                  VP                  V4      RR7       R# )r   r   -q=r'   N)r   r2   r   r\   r^   )r3   r5   r6   r\   r^   r4   r`   s   &&&&&& r9   test_gh_11355bTestMannWhitneyU.test_gh_11355bG  sT     2::a="**Q-Mrzz)'<5I

BJJv$6UCr<   c                   R pVP                  . RO4      pVP                  . RO4      p\        WxVW#R7      p	\        V	P                  VP                  V4      4       \	        V	P
                  VP                  V4      4       R# )g     A@r   r   r   N)
r   g(\?g=
ףp=?gp=
ף?g333333?gGz?g(\?g=
ףp=?r*   g\(\?)gffffff?g)\(?r   gGz?g\(\?)r2   r   r   r\   r   r^   )
r3   r   r   r   
pvalue_expr4   statistic_expr5   r6   r`   s
   &&&&&&    r9   test_gh_9184TestMannWhitneyU.test_gh_9184X  sg    . JJSTJJ561'2Crzz-'@A

BJJz$:;r<   c                   VP                  VP                  4      pVP                  W"W"V.4      pVP                  W"W"V.4      p\        W44      p\	        VP
                  VP                  V4      4       \	        VP                  V4       R # r   )r2   r]   r   r   r   r\   r^   )r3   r4   r]   abr`   s   &&    r9   test_gh_4067TestMannWhitneyU.test_gh_4067w  sn     jj HHc#./HHc#./1 rzz#7

C(r<   r   r  c                V   \        VP                  V4      VP                  V4      R VRR7      p\        V4      VP                  8X  d   RMRp\	        VP
                  VP                  V^ ,          4      VR7       \	        VP                  VP                  V^,          4      VR7       R# )Tr   rJ  ư>rF  rtolN)r   r2   r   r$   r   r\   r^   )r3   r5   r6   r   r   r4   r`   rW  s   &&&&&&  r9   test_gh_2118TestMannWhitneyU.test_gh_2118  s{     2::a="**Q-'2<I'+rzz9turzz(1+'>TJ

BJJx{$;$Gr<   c                   \         P                  P                  R 4      p^^r2VP                  VR7      pVP                  VR7      p\        \        R\        ^ ^ 4      4       \        P                  P                  4        \        P                  ! WERR7      p\        P                  P                  P                  pVR,          \        VP                  W#,          VP                  ,
          4      ^,           8X  g   Q h\        P                  ! WTRR7       V\        P                  P                  P                  8X  g   Q h\        P                  P                  4        \        P                  ! V^ V,          RRR7       \        P                  P                  P                  pVR,          ^8X  g   Q h\        P                  ! ^ V,          VRRR7       V\        P                  P                  P                  8X  g   Q hR# )	   g>mjK rd   r  r   r   r   )r   r   Nrk   )rL   rl   rm   r  r   r   r  resetr   r   configurationsr.  minr\   )r3   ro   r  r   r5   r6   r`   r.  s   &       r9   test_gh19692_smaller_table+TestMannWhitneyU.test_gh19692_smaller_table  si   
 ii##$78"1JJAJJJAJ
Ca,  g6++11RyCqsS]]/BCaGGGG10
3399999
 	1ac'yI++11RyA~~1Q3'yI
3399999r<   c                   \         P                  P                  R 4      pVP                  RR7      pVP                  RR7      p\        P                  ! W4\        P
                  ! 4       V^R7      p\        P                  ! W4RV^R7      p\        VP                  VP                  RR7       \        VP                  VP                  RR7       R# )	r[  rd   )r   r   rg   r   V瞯<rV  N)r@   rC   )r@   rD   )	rL   rl   rm   r   r   PermutationMethodr   r\   r^   )r3   r   ro   r5   r6   r`   r  s   &&     r9   test_permutation_method(TestMannWhitneyU.test_permutation_method  s    ii##$78JJFJ#JJFJ#  e.E.E.G-8qB!!!w.9Ct~~EB

DKKe<r<   g+=c                $   VP                  V P                  4      VP                  V P                  4      r2\        P                  ! W#R R7      w  rE\        P                  ! W2RR7      w  rg\        P                  ! W#RR7      w  r\        P                  ! W2R R7      w  r\        WW4       \        W4       WY8w  g   Q h\        WAP                  R4      4       \        WaP                  R4      4       \        WP                  R4      4       \        WP                  R4      4       \        WQP                  R4      V P                  R7       VP                  VP                  8X  d   V P                  MRp\        WP                  R4      VR	R
7       R# )r   r   r         @     Y@g=_A?rV  Mb@?glPz.?r,  rW  r(   N)
r2   XYr   r   r   r   rW  r!   ry   r3   r4   rk  rl  u1rQ   r  rS   u3rU   u4p4rW  s   &&           r9   test_mannwhitneyu_one_sided,TestMannWhitneyU.test_mannwhitneyu_one_sided  s   zz$&&!2::dff#51##Af=##Ai@##Ai@##Af=xxJJt,-JJt,-JJt,-JJt,-JJ'89		JGGrzz1tyytJJ':;$USr<   c                   VP                  V P                  4      VP                  V P                  4      r2\        P                  ! W#R R7      w  rE\        P                  ! W2R R7      w  rg\        WW4       \        WAP                  R4      4       \        WaP                  R4      4       VP                  VP                  8X  d   V P                  MRp\        WQP                  R4      VRR7       R# )	r   r   rg  rh  ri  glPz.?r,  rj  N
r2   rk  rl  r   r   r   r!   ry   rW  r   	r3   r4   rk  rl  rn  rQ   r  rS   rW  s	   &&       r9   test_mannwhitneyu_two_sided,TestMannWhitneyU.test_mannwhitneyu_two_sided  s    zz$&&!2::dff#51##AkB##AkBJJt,-JJt,-GGrzz1tyytJJ'9:ERr<   c                   VP                  V P                  4      VP                  V P                  4      r2\        P                  ! W#R RR7      w  rE\        P                  ! W2R RR7      w  rg\        P                  ! W#R RR7      w  r\        P                  ! W2R RR7      w  r\        WW4       \        W4       WY8w  g   Q h\        WAP                  R4      4       \        WaP                  R4      4       \        WP                  R4      4       \        WP                  R4      4       VP                  VP                  8X  d   V P                  MRp\        WQP                  R4      VRR	7       \        WP                  R
4      VRR	7       R# )Fr   r   r   rg  rh  ri  gii5?r,  rj  g22?Nru  rm  s   &&           r9   &test_mannwhitneyu_no_correct_one_sided7TestMannWhitneyU.test_mannwhitneyu_no_correct_one_sided  s   zz$&&!2::dff#51##A%VD##A%YG##A%YG##A%VDxxJJt,-JJt,-JJt,-JJt,-GGrzz1tyytJJ'895QJJ';<4eTr<   c                   VP                  V P                  4      VP                  V P                  4      r2\        P                  ! W#R RR7      w  rE\        P                  ! W2R RR7      w  rg\        WW4       \        WAP                  R4      4       \        WaP                  R4      4       VP                  VP                  8X  d   V P                  MRp\        WQP                  R4      VRR7       R	# )
Fr   r   rg  rh  ri  g22?r,  rj  Nru  rv  s	   &&       r9   &test_mannwhitneyu_no_correct_two_sided7TestMannWhitneyU.test_mannwhitneyu_no_correct_two_sided  s    zz$&&!2::dff#51##A%[I##A%[IJJt,-JJt,-GGrzz1tyytJJ';<4eTr<   c                   VP                  . R NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NRNR NR NRNR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR N4      pVP                  . R NR NR NR NR NR NR NRNR NRNR NR NR NR NRNR NR NR NRNR NR NR NR NR NRNR NR NRNR NR NR NR NR NR NR NR NR NR NRNR NRNR NR NR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NRNRNR NR NRNR NR NRNR NRNR NR NR NR NRNRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NR NR NRNRNRNR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NRNR NR NR NR NRNR NR NR NR NR NR NR NR NR NR NR NR NRNR NR NR NRNR NR NR NR NR NR N4      p\        P                  ! W#RR7      p\        VP                  VP                  R4      4       \        VP
                  VP                  R4      4       \        P                  ! W#RR7      p\        VP                  VP                  R4      4       \        VP
                  VP                  R4      4       \        P                  ! W#R	R7      p\        VP                  VP                  R4      4       \        VP
                  VP                  R
4      4       R# )r   r   r   r   r   g     @g ?չ>r   g&)E?r   g?չ?N)r2   r   r   r   r\   r^   r_   s   &&   r9   test_mannwhitneyu_ones'TestMannWhitneyU.test_mannwhitneyu_ones  s   JJ 0 0B 0 0B 0 0B 0 0B 0 0B 0 0B 0 0B 000 "0$&0(*0,.00204608:0<>0@B0DF0HJ0LN000 "0$&0(*0,.00204608:0<>0@B0DF0HJ0LN0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 	0 	0 !#	0 %'	0 )+	0 -/	0 13	0 57	0 9;	0 =?	0 AC	0 EG	0 IK	0 MO	0
 0
 0
 !#0
 %'0
 )+0
 -/0
 130
 570
 9;0
 =?0
 AC0
 EG0
 IK0
 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0 0 0 !#0 %'0 )+0 -/0 130 570 9;0 =?0 AC0 EG0 IK0 MO0  !0  !0  !#!0  %'!0  )+!0  -/!0  13!0  57!0  9;!0  =?!0  AC!0  EG!0  IK!0  MO!0" #0" #0" !##0" %'#0" )+#0" -/#0 1& JJ ( (B ( (B ( (B ( (B ( (B ( (B ( (B ((( "($&((*(,.(02(46(8:(<>(@B(DF(HJ(LN((( "($&((*(,.(02(46(8:(<>(@B(DF(HJ(LN( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( 	( 	( !#	( %'	( )+	( -/	( 13	( 57	( 9;	( =?	( AC	( EG	( IK	( MO	(
 (
 (
 !#(
 %'(
 )+(
 -/(
 13(
 57(
 9;(
 =?(
 AC(
 EG(
 IK(
 MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )+( -/( 13( 57( 9;( =?( AC( EG( IK( MO( ( ( !#( %'( )   6:rzz'':;

BJJ/D$EF  9=rzz'':;

BJJ$?@  ;?rzz'':;

BJJ/@$ABr<   rw   )gm9Aj@g+H3[@gi>s@)g#hA{@glz@gcDf@gǳ*h@gZA@gI9^YQa@g`@g՞p@g:q@g&@gZ|@g`r@gMc3g@)r   
+?)r   
+?)r   缌%c?)r   g9:?)r   g9:?)r   g*::?)r   r   rx   )      7@r  )r  r  )r  r  )r  gl,KNh?)r  giژ?)r  gl,KNh?)g      ?r   g      ?)r   皙?皙?r   )r   r   r  r+   r   g?)r  r  r   )gx&?g/$?gJ+?r  r   )y&1?v/?gv/?r  gjt?~jt?ʡE?)	gy&1?gV-?r  r   gS?gv?gʡE?g'1Z?gm?)gK7A`?gZd;O?r   gMbX?)Mb?RQ?RQ?M?r  r  )	g;On?;On?V-?g      ?gJ+?r  gx&?r   gCl?)Mb?Mb?Mb?gy&1?r  M?g|?5^?gn?g\(\?!rh?K7?)Mbp?r  r  r  ~jt?g333333?g"~j?ףp=
?gzG?K7?gGz?gl?r   gI+?)r  r  g1Zd?r  )r  r  r  1Zd?g%C?r  r  )
g~jt?g~jt?r  gsh|??gS㥛?r  r  g+?r  r  )g{Gzt?r   g~jt?gL7A`?r  gjt?gPn?gI+?gX9v?gQ?gMb?gsh|??gK7A`?)Mb`?r  g;On?gQ?g9v?gˡE?gT㥛 ?gbX9ȶ?grh|?gQ?r  gx&?gv/?gMbX?g(\?gQ?)r>   r  r  r  g9v?g/$?r  r  gL7A`?g
ףp=
?gQ?r  gK7?g`"?g7A`?r+   gV-?gjt?gˡE?r   r   )r   r   )r   g郡E?)r   r?   )r   r$  )r   r@   rA   rB   )r5   r6   r\   r^   )Tr   r   g&?)Tr   r   gO?)Tr   r   gO?)Fr   r   g9@VN!x?)Fr   r   g9M>?)Fr   r   g9M>?)Tr   r   g?UV?)Tr   r   gߺVJH?)Tr   r   gVJH?)r   r   r   rK  r  )r   ga׀}?)r   r   r   )r   g?h?)r   r   )r   g5&#\?)r   r   )r5   r6   r   r   )r   r   r   )g	U3@g^3@gt3@g]o5@gzS4@gt< 4@gM	X3@gXmCk4@gLo&3@gfɘ2@g{m;^3@ga A$|3@gMѢ_4@g#3@g19T_3@ggC2@gqR4@gKk/4@g܁3@gZ2@g_
3@g$`3@g
x4@g3#л5@g;VND1@g >H2@gr4@gyܤ2@g?4@g=bɇ3@)gpG3@gL:j0@g2@gJNnC1@gR;`(3@g+Pi,2@g6:Z2@gZ"3=2@gF	uSa	3@gXҀ2@gX3^83@g21@gJ2@gZ)E2@gU83@g50@gԆ3@gFz33@gz3@gڴ3@)4rz   r{   r|   r}   r/   r~   r   r   r   r   r5   r6   cases_basicr   r   cases_continuityr   r   r  r  r  r  r  r  r   cases_scalarr%  r)  r:  r=  rA  rL   rn   cases_11355rG  
cases_9184rM  rR  
cases_2118rX  r_  rd  rk  rl  rW  rr  rw  rz  r}  r  r   r   r   s   @r9   r   r      s     [[!!+6S!T- U-*
.10j 	-A	A& #K<H*,"FHlC*,"IxF*,"K7C*,"FHg>*,"IxA*,-K [[1;?[[W&BCJ D @J (6FM/1'1A4H/1'4DdK/1'6FN/1'1A5I/1'4DeL/12 [[13CD= E=<, $8.0Coq"A<KMC (7K 2 <=C *? 1 9  G $%C+88*4" $[(LI#VX|D #Y,G)+#[(GDgN#VXw?K#Y'BGLNL [[/>< ?<H [[!!+6S!T[[Xg'>?)K @ U)KV2 [[!!+6S!T9 U9 "1aAq!Q:* "1aAq!Q?)+ 2661%1aAq!Q:/+ 2661%1aAq!Q?* *1aAq!Q?/+,K  [[>LD MD ?BC@CE:=?AJ [[ 67AC<C<: [[!!+6S!T) U)  #sY8MN#sV5JK#s[)Dqc9.CDqc6+@Aqc;	:q6Aq69.BCq6Aq66+?@q6Aq6;9;J [[BJOH PH:: [[],LM	= N	=	-A	NA DT$	SU$	U+C +Cr<   r   c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR t]P                   P#                  RR4      R 4       tR tRtV tR# )TestSomersDi>  c                   V P                   V P                  ,           V n        ^ \        P                  ! ^
4      V P                   V P                  ,           3^\        P                  ! ^
4      V P                   V P                  ,           3/V n        V P
                   Uu. uF  qP
                  V,          ^ ,          NK  	  pp\        P                  ! \        P                  RR7      V n
        V P                  ! V!  V n        R# u upi )r   r   r   N)ALL_INTEGER	ALL_FLOATdtypesrL   rM   	arguments	functoolspartialr   somersdpartialfuncr   )r3   idxinput_arrays   &  r9   setup_methodTestSomersD.setup_method?  s    &&7biim"..?Abiim"..?AB :>H#~~c*1--H
 %,,U]]9DF((+6 Is   "Dc                    V P                   ! V!  p\        VP                  V P                  P                  R R7       \        VP                  V P                  P                  R R7       R# )rb  r'   N)r  r   r\   r   r^   )r3   r   r`   s   &* r9   pythranfuncTestSomersD.pythranfuncN  sF    %t}}'>'>UK

DMM$8$8uEr<   c                <   . RO. RO. RO.p\         P                  ! V4      pV P                  \         P                  4      p\         P                  ! V3/ VB p\        VP                  VP                  RR7       \        VP
                  VP
                  RR7       R# )   rb  r'   N)r        rF   r   )rF   r     #   ri   )r?   rA   r@   rF      )r   r  get_optional_argsr   r\   r^   )r3   r  r  optional_argsr  s   &    r9   test_pythranfunc_keywords%TestSomersD.test_pythranfunc_keywordsS  sm    #%8:JK}}U#..u}}=}}U4m4UCT[[u=r<   c                   . ROp. ROpRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       . R	Op. R
OpRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       . ROp. ROpRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! ^
4      pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! . RO4      pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! ^
4      RRR1,          pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \
        P                  ! ^
4      p\
        P                  ! . RO4      pRp\         P                  ! W4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       . ROp. ROpRp\         P                  ! WV4      p\        VP                  V^ ,          RR7       \        VP                  V^,          RR7       \         P                  ! . RO. RO4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! . RO. RO4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! . RO. RO4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! ^ .^ .4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \         P                  ! . . 4      p\        VP                  \
        P                  4       \        VP                  \
        P                  4       \
        P                  ! R4      p\
        P                  ! R4      p\        \        \         P                  W4       R# )rC   rb  r'   NrC        4@)rC   r@   r?   rA   rD   rB   rF   rG   )rC   r@   rD   rA   r?   rG   rF   rB   r  )	r   rC   r@   r?   rA   rD   rB   rF   rG   )	rC   r@   r   rD   rA   r?   rG   rF   rB   )rC   r@   r?   rA   rD   rB   rF   )rC   r@   rD   rA   r?   rF   rB   )g+$I$I¿g=/3n+?r   r   )
r   r@   r?   rA   rB   rD   rC   rF   rG   rj   )gs'}'?r   rk   )g      r   )
rj   rF   rG   rD   rC   rA   rB   r@   r?   r   )g}'}'r   )ri   r@   r?   ri   r@   )r?   rB   rF   r?   r   )      g.ʂ?)r@   r@   r@   )r@   r   r@   )r   r  r   r\   r^   rL   rM   arrayr]   r   r   )r3   r5   r6   r   r`   x1x2s   &      r9   test_like_kendalltau TestSomersD.test_like_kendalltau^  s    %$9mmA!x{?

HQKe< ('9mmA!x{?

HQKe< "!:mmA!x{?

HQKe< IIbMIIbM *mmA!x{?

HQKe< IIbMHH349mmA!x{?

HQKe< IIbMIIbM$B$ +mmA!x{?

HQKe< IIbMHH34;mmA!x{?

HQKe< :mmB#x{?

HQKe< mmIy1rvv.

BFF+mmIy1rvv.

BFF+mmIy1rvv.

BFF+mmQC!%rvv.

BFF+ mmB#rvv.

BFF+ IIcNIIcNj%--6r<   c                   . ROp. R	OpRpRpRp\         P                  ! W4      p\        VP                  VRR7       \        VP                  VRR7       \        VP                  P                  R
4       \         P                  ! W!4      p\        VP                  VRR7       \        VP                  VRR7       \        VP                  P                  R4       R# )r?   gCE]t?g^_?gO((Ƿ?rb  r'   r)   N)r?   r?   r?   r@   r@   r@   r@   r@   rA   rA   r?   r@   r@   r@   r@   r@   r@   r@   rA   rA   rA   rA   rA   rA   )r?   r?   r?   r?   r?   r?   r?   r?   r?   r?   r@   r@   r@   r@   r@   r@   r@   r@   r@   r@   r@   r@   r@   r@   )rA   r@   r@   rA   )r   r  r   r\   r^   r   r  r.  )r3   r5   r6   d_crd_rcr8   r`   s   &      r9   test_asymmetryTestSomersD.test_asymmetry  s    11 ! mmA!t%8

AD1SYY__f-mmA!t%8

AE2SYY__f-r<   c                j   \         P                  ! ^^.^^.^^.^^.^^..4      pVP                  pRp\        \        P
                  ! V4      P                  V4       \         P                  ! ^^ .^U^ .^ ^..4      pRRr#\        \        P
                  ! V4      P                  V4       \        \        P
                  ! VP                  4      P                  V4       \         P                  ! ^^ .^ ^.^U^ ..4      pRp\        \        P
                  ! VP                  4      P                  V4       R# )rG   NgHHHHHH?gM&w?r   gtE]t)rL   r  Tr   r   r  r\   )r3   r  dyxdxys   &   r9   test_somers_original TestSomersD.test_somers_original  s    
 1a&1a&1a&1a&1a&ABe,66< 2q'B7QG45iSe,66<egg.88#> 2q'Ar7RG45egg.88#>r<   c                   ^dpRp\         P                  ! V4      p\         P                  P                  ^ 4      p\        P
                  P                  V\         P                  ! V4      V,          VR7      P                  V4      p\        P                  ! V4      p\         P                  ! V^\         P                  ! V^,          4      ^ R7      p\        P                  ! V4      p\         P                  ! V^\         P                  ! V^ ,          4      ^R7      p	\        P                  ! V	4      p
\         P                  ! V^\         P                  ! V^ ,          ^,           4      ^R7      p\        P                  ! V4      p\        VP                  RRR7       \        VP                  VP                  4       \        VP                  V
P                  4       \        VP                  VP                  4       \        VP                  RRR7       \        VP                  VP                  4       \        VP                  V
P                  4       \        VP                  VP                  4       R# )	r   r8   random_staterf   rb  r'   gPj$?NrB   rD   gay)rL   prodrl   RandomStater   multinomialrvsr   reshaper  insertr2  r   r\   r^   )r3   Nr.  re   ro   r  r`   s2r  s3r@  s4res4s   &            r9   *test_contingency_table_with_zero_rows_cols6TestSomersD.test_contingency_table_with_zero_rows_cols  s    wwu~ii##A&!!!rwwt}T'9/2 " 44;GEN 	
mmAYYq!RXXeAh/a8}}R YYq!RXXeAh/a8}}R YYr1bhhuQxz2;}}R  	'9Ft~~6t~~6t~~6

$5EB

DKK0

DKK0

DKK0r<   c                   ^dpRp\         P                  ! V4      p\         P                  P                  ^ 4      p\        P
                  P                  V\         P                  ! V4      V,          VR7      P                  V4      pV^,
          pRp\        \        VR7      ;_uu_ 4        \        P                  ! V4       RRR4       VR,           pRp\        \        VR7      ;_uu_ 4        \        P                  ! V4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! . .4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! ^..4       RRR4       \         P                  ! R	4      p	\        \        VR7      ;_uu_ 4        \        P                  ! V	4       RRR4       ^V	R
&   \        \        VR7      ;_uu_ 4        \        P                  ! V	4       RRR4       R#   + '       g   i     ELV; i  + '       g   i     EL'; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   r  z:All elements of the contingency table must be non-negativer   Nr   z5All elements of the contingency table must be integerz?At least two elements of the contingency table must be nonzero.r  )rA   rA   r   r?   )rL   r  rl   rm   r   r  r  r   r  r   r   r  r2  )
r3   r  r.  re   ro   r  s5r   s6s7s
   &         r9   test_invalid_contingency_tables+TestSomersD.test_invalid_contingency_tables  s   wwu~ii##A&!!!rwwt}T'9/2 " 44;GEN 	
 UN:W55MM" 6 XI:W55MM" 6,:W55MM2$ 6 :W55MMA3%  6 XXf:W55MM" 6 4:W55MM" 65+ 655
 655
 65 65 65 655sH   *H-H"'H6 I	0I-I/H	"H3	6I		I	I,	/J 	c                <   . ROpRR\         P                  .p. ROp^ R\         P                  ) .p\        P                  ! W4      p\        P                  ! W$4      p\	        VP
                  VP
                  4       \	        VP                  VP                  4       R# )r?   g @Nr   rk   )rA   r@   r?   r  )rL   rn   r   r  r   r\   r^   )r3   r5   r  r6   y2r`   r  s   &      r9   test_only_ranks_matter"TestSomersD.test_only_ranks_matter@  sn    #rvvwmmA!}}R$S]]DNN3SZZ-r<   c                    \         P                  ! ^
4      p\         P                  ! ^
4      p\        P                  ! W4      p\	        VP
                  \         P                  ! ^
4      4       R# )rE   N)rL   rM   r   r  r   r  eyer3   r5   r6   r`   s   &   r9   test_contingency_table_return)TestSomersD.test_contingency_table_returnK  s@    IIbMIIbMmmA!SYYr
+r<   c                   . R	Op. R
Op\         P                  ! WRR7      pVP                  ^ 8  g   Q h\         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  ^VP
                  ^,          ,
          4       \         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  VP
                  ^,          4       VP                  4        \         P                  ! WRR7      pVP                  ^ 8  g   Q h\         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  ^VP
                  ^,          ,
          4       \         P                  ! WRR7      p\        VP                  VP                  4       \	        VP
                  VP
                  ^,          4       \        P                  ! \        RR7      ;_uu_ 4        \         P                  ! WRR7       RRR4       R#   + '       g   i     R# ; i)r?   r   r   r   r   z`alternative` must be...r   	ekki-ekkiN)r?   r@   rA   rB   rC   )rC   rD   rF   rG   rF   )
r   r  r\   r   r   r^   reverser/   r   r   )r3   r  r  r   r`   s   &    r9   test_somersd_alternative$TestSomersD.test_somersd_alternativeR  s     ==[A!!A%%% mmB7S]]H$6$67

A1)<$=> mmB	:S]]H$6$67

HOOa$78 	

 ==[A!!A%%% mmB	:S]]H$6$67

A1)<$=> mmB7S]]H$6$67

HOOa$78]]:-GHHMM"k: IHHHs   I  I	positive_correlationc                &   \         P                  ! ^
4      pV'       d   TM\         P                  ! V4      pV'       d   ^MRp\        P                  ! W#RR7      pVP
                  V8X  g   Q hVP                  ^ 8X  g   Q h\        P                  ! W#RR7      pVP
                  V8X  g   Q hVP                  V'       d   ^M^ 8X  g   Q h\        P                  ! W#RR7      pVP
                  V8X  g   Q hVP                  V'       d   ^ M^8X  g   Q hR# )rE   r   r   r   r   Nrk   )rL   rM   flipr   r  r\   r^   )r3   r  r  r  expected_statisticr`   s   &&    r9    test_somersd_perfect_correlation,TestSomersD.test_somersd_perfect_correlation{  s     YYr]'RRWWR["6QB mmB<}} 2222zzQ mmB7}} 2222zz#7aQ??? mmB	:}} 2222zz#7aQ???r<   c                    ^^.pRp\         P                  P                  R4      pVP                  W4      pVP                  W4      pRp\        P
                  ! WE4      P                  p\        WgRR7       R# )r?   l   .E5 g 0uD?rb  r'   N@B )rL   rl   rm   choicer   r  r\   r   )r3   classes	n_samplesro   r5   r6   val_sklearn	val_scipys   &       r9   !test_somersd_large_inputs_gh18132-TestSomersD.test_somersd_large_inputs_gh18132  si     a&	ii##J/JJw*JJw* + MM!'11	U;r<   )r  r  r   r  N)FT)rz   r{   r|   r}   r  r  r  r  r  r  r  r  r  r  r  r/   r~   r   r  r
  r   r   r   s   @r9   r  r  >  su     7F
	>m7^.2?,1@"H	.,';R [[3]C@ D@0< <r<   r  c                     a  ] tR tRt o Rt]P                  P                  R^+^(.^
^'..R3^d^.R^..R3^^.^^..R3^^.^
^
..R3^^.^^..R3^^.^^..R3^
^.^
^..R3^^ .^^..R3^ ^.^^..R3^ ^.^^..R3^^.^^..R3.4      R 4       t]P                  P                  R^+^(.^
^'..R3^d^.R^..R3^^.^^..R3^^.^
^
..R 3^^.^^..R!3^^.^^..R"3^
^.^
^..R#3^^ .^^..R$3^ ^.^^..R%3^ ^.^^..R&3^^.^^..R3.4      R 4       t	R t
]P                  P                  R^ ^ .^^..R'3.4      R	 4       t]P                  P                  R^ ^.^ ^
..R]P                  33^^ .^
^ ..R]P                  33.4      R
 4       t]P                  P                  R^^.^^..R(3^^.R^..R)3^^.R^..R*3.4      ]P                  P                  RRR.4      R 4       4       tRtV tR# )+TestBarnardExacti  z8Some tests to show that barnard_exact() works correctly.input_sample,expectedr   c                d    \        V4      pVP                  VP                  rT\        WE.V4       R# )zThe expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-6 :
```R
library(Barnard)
options(digits=10)
barnard.test(43, 40, 10, 39, dp=1e-6, pooled=TRUE)
```
Nr   r\   r^   r   r3   input_sampler   r`   r\   r^   s   &&&   r9   test_preciseTestBarnardExact.test_precise  s*    2 L)MM3::6+X6r<   c                h    \        VRR7      pVP                  VP                  rT\        WE.V4       R# )zThe expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-6 :
```R
library(Barnard)
options(digits=10)
barnard.test(43, 40, 10, 39, dp=1e-6, pooled=FALSE)
```
F)pooledNr  r  s   &&&   r9   test_pooled_param"TestBarnardExact.test_pooled_param  s,    2 L7MM3::6+X6r<   c                   R p\        \        VR7      ;_uu_ 4        \        ^^.^^..^ R7       RRR4       Rp\        \        VR7      ;_uu_ 4        \        \        P                  ! ^4      P                  ^^4      4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        R^.^^..4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        ^^.^^..R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Ln; i  + '       g   i     R# ; i)	7Number of points `n` must be strictly positive, found 0r   r   N,The input `table` must be of shape \(2, 2\).*All values in `table` must be nonnegative.zI`alternative` should be one of {'two-sided', 'less', 'greater'}, found .*not-correctrk   )r   r   r   rL   rM   r  r3   	error_msgs   & r9   test_raisesTestBarnardExact.test_raises  s     F 	 :Y77Aq6Aq6*a0 8 E	:Y77"))A,..q!45 8 A	:Y77B7QF+, 8
 	 :Y77Aq6Aq6*M: 87% 87
 87
 87 877/   C80D&DD18D	D	D.	1E	r   c                    \        V4      pVP                  VP                  rT\        WR^ ,          4       \        WB^,          4       R# r   Nr   r\   r^   r   r  s   &&&   r9   test_edge_cases TestBarnardExact.test_edge_cases  s5     L)MM3::6Va[)Y,r<   c                    \        V4      pVP                  VP                  rT\        WR^ ,          4       \        WB^,          4       R# r%  r&  r  s   &&&   r9   test_row_or_col_zero%TestBarnardExact.test_row_or_col_zero  s5     L)MM3::6Va[)Y,r<   ,  i  r   r   r   c                    Vw  rEVR8X  d&   \         P                  ! V4      RRRR13,          pV) p\        WR7      pVP                  VP                  r\        Wx.WE.RR7       R# )a0  
"The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-6 :
```R
library(Barnard)
options(digits=10)
a = barnard.test(2, 7, 8, 2, dp=1e-6, pooled=TRUE)
a$p.value[1]
```
In this test, we are using the "one-sided" return value `a$p.value[1]`
to test our pvalue.
r   :NNNNr   Hz>r'   rk   )rL   r  r   r\   r^   r   )	r3   r  r   r   expected_statless_pvalue_expectr`   r\   r^   s	   &&&&     r9   test_less_greater"TestBarnardExact.test_less_greater  sd    , -5))#88L1!TrT':L*NMLBMM3::6-!D4	
r<   rw   N)gXyq@g{2s&Q7?)gllgEA]0K?)*)1%g_  ?)g_c1?g= ?)g5PyQgQ@2?)ggJ"?)g_c1gwݝل?)g7@g      ?)g~t,?3O?)gr?~CY7?)g7\@gA2?)gXS;gh?)g>!Ɏg6  ?)gSy@?g^F?)g-gXI#?)gaЍgo?)gb]?gFugH	?)g6ҭ@g      ?)gi(	r4  )gNXzr5  r  )r3  gE\/??)ggQ5r   )g&X}>r   )rz   r{   r|   r}   __doc__r/   r~   r   r  r  r!  r'  rL   r]   r*  r1  r   r   r   s   @r9   r  r    sx    B[[2hR!#CDAhq	"$EF!fq!f@A!fr2h!AB"gBx "CD"gBx "CD1gAw!BC!fq!f?@!fq!f@A!fq!f@A!fq!f@A	
 7! 7 [[2hR!#CDAhq	"$EF!fq!f@A!fr2h!AB"gBx "CD"gBx "CD1gAw!BC!fq!f?@!fq!f@A!fq!f@A!fq!f@A	
 7! 7;4 [[!fq!fx(	
-- [[!fq"gbff.!fr1gbff.	
-- [[!fq!f@A#ha!#:;2hq	"$;<	
 [[]Y,?@
 A
r<   r  c                     a  ] tR tRt o RtRt]P                  P                  R^^.^^..R3^^.^
^
..R3^^.^^..R3^
^.^
^..R3^^ .^^..R3^ ^.^^..R3^^.^^..R3^^.^^..R3^
^.^^%..R3.	4      R 4       t	]P                  P                  R^+^(.^
^'..R3^^.^^..R3^^.^
^
..R3^^.^^..R3^^.^^..R3^^ .^^..R3^ ^.^^..R3^ ^.^^..R3^^.^^..R3^^.^^..R3^
^.^^%..R3.4      R 4       t
]P                  P                  R^+^(.^
^'..R3^^.^^..R 3^^.^
^
..R!3^^.^^..R"3^^ .^^..R#3^ ^.^^..R$3^^.^^..R 3^^.^^..R%3.4      R 4       tR t]P                  P                  R^ ^.^ ^
..]P                  ]P                  33^^ .^
^ ..]P                  ]P                  33.4      R	 4       tR
 t]P                  P                  RR&4      R 4       tRtV tR# )'TestBoschlooExacti@  z9Some tests to show that boschloo_exact() works correctly.r.  r  c                ~    \        VRR7      pVP                  VP                  rT\        WE.W P                  R7       R# )aA  The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-8 :
```R
library(Exact)
options(digits=10)
data <- matrix(c(43, 10, 40, 39), 2, 2, byrow=TRUE)
a = exact.test(data, method="Boschloo", alternative="less",
               tsmethod="central", np.interval=TRUE, beta=1e-8)
```
r   r   r'   Nr   r\   r^   r   ATOLr  s   &&&   r9   	test_lessTestBoschlooExact.test_lessE  s0    2 \v>MM3::6+XIIFr<   c                ~    \        VRR7      pVP                  VP                  rT\        WE.W P                  R7       R# )aD  The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-8 :
```R
library(Exact)
options(digits=10)
data <- matrix(c(43, 10, 40, 39), 2, 2, byrow=TRUE)
a = exact.test(data, method="Boschloo", alternative="greater",
               tsmethod="central", np.interval=TRUE, beta=1e-8)
```
r   r   r'   Nr:  r  s   &&&   r9   test_greaterTestBoschlooExact.test_greaterb  s0    6 \yAMM3::6+XIIFr<   c                    \        VR^@R7      pVP                  VP                  rT\        WE.W P                  R7       R# )aF  The expected values have been generated by R, using a resolution
for the nuisance parameter of 1e-8 :
```R
library(Exact)
options(digits=10)
data <- matrix(c(43, 10, 40, 39), 2, 2, byrow=TRUE)
a = exact.test(data, method="Boschloo", alternative="two.sided",
               tsmethod="central", np.interval=TRUE, beta=1e-8)
```
r   )r   r   r'   Nr:  r  s   &&&   r9   test_two_sided TestBoschlooExact.test_two_sided  s2    0 \{bIMM3::6+XIIFr<   c                   R p\        \        VR7      ;_uu_ 4        \        ^^.^^..^ R7       RRR4       Rp\        \        VR7      ;_uu_ 4        \        \        P                  ! ^4      P                  ^^4      4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        R^.^^..4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        ^^.^^..R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Ln; i  + '       g   i     R# ; i)	r  r   r  Nr  r  zK`alternative` should be one of \('two-sided', 'less', 'greater'\), found .*r  rk   )r   r   r   rL   rM   r  r  s   & r9   r!  TestBoschlooExact.test_raises  s     F 	 :Y77QFQF+q1 8 E	:Y77299Q<//156 8 A	:Y77RGaV,- 8
% 	 :Y77QFQF+]; 87% 87
 87
 87 877r#  c                    \        V4      pVP                  VP                  rT\        WR^ ,          4       \        WB^,          4       R# r%  )r   r\   r^   r   r  s   &&&   r9   r*  &TestBoschlooExact.test_row_or_col_zero  s5     \*MM3::6Va[)Y,r<   c                    ^^.^^..p\        VRR7      P                  p\        VRR7      P                  p^\        W#4      ,          ^8  g   Q h\        VRR7      P                  pVR8X  g   Q hR# )r?   r   r   r   r   r   N)r   r^   r^  )r3   tblplpgpts   &    r9   test_two_sided_gt_1%TestBoschlooExact.test_two_sided_gt_1  sn     1vBx CV4;;CY7>>R}q   C[9@@Syyr<   r   c                    ^^.^^..p\        W!R7      P                  p\        P                  ! W!R7      ^,          p\	        W44       R# )r@   r   N)r   r\   r   fisher_exactr   )r3   r   rI  boschloo_statfisher_ps   &&   r9   test_against_fisher_exact+TestBoschlooExact.test_against_fisher_exact  sC     1v1v&sDNN%%cCAF0r<   rw   N)<vB\?g/??)gM?gA>?)_VѶ?g֭?)u %?gc'?)r?   r?   )r   g      ?)+f?gXc}v?)gZыD?ggi]?)k\2?g0,%?)gKv?gN3?)rW  g'&5?)gw@_?g7?)gi{?gɑ)z?)օa?g1|?)gY<;?gND?)ge?gG`?)rY  gqQS,5?)rU  gG?/??)rW  gKE`?)rV  ghr1ֽ?)rZ  grfb?)r   g      ?)rX  gP:pRv?)r   r   )rz   r{   r|   r}   r6  r;  r/   r~   r   r<  r?  rB  r!  rL   r]   r*  rM  rS  r   r   r   s   @r9   r8  r8  @  s    CD[[!fq!f89!fr2h!78"gBx ":;1gAw!89!fq!fv&!fq!f~.!fq!f89"g1v 892hR!#9:
	
GG [[2hR!#?@!fq!f56!fr2h!89"gBx "89"gBx "78!fq!f89!fq!fv&!fq!fv&!fq!f56"g1v 672hR!#9:	
 G! G [[2hR!#?@!fq!f78!fr2h!78"gBx "89!fq!f78!fq!f}-!fq!f78"g1v 89		
GG <4 [[!fq"g 01!fr1g 01	
-- [[],?@1 A1r<   r8  c                     a  ] tR tRt o ]P
                  P                  R. ]P                  ! ^4      3]P                  ! ^4      ^.3.4      ]P
                  P                  RRR7      R 4       4       t
R tR t]P
                  P                  R	. RO4      R 4       t]P
                  P                  R. RO4      R 4       t]P
                  P                  R 4       tR tR tR tRtV tR
# )TestCvm_2sampi  r   r   zlazy -> no axis_nan_policyr   c                d  a V3R  lV 4       p\        \        \        SR7      ;_uu_ 4        \        V!  p\	        VP
                  SP                  SP                  4      4       \	        VP                  SP                  SP                  4      4       RRR4       R#   + '       g   i     R# ; i)c              3   \   <"   T F!  pSP                  V\        S4      R 7      x  K#  	  R# 5i)r&   N)r2   r   ).0argr4   s   & r9   	<genexpr>5TestCvm_2samp.test_too_small_input.<locals>.<genexpr>  s'     Lt

3&6r&:
;;ts   ),rY   N)	r   r   r   r   r   r\   r2   r]   r^   )r3   r   r4   r`   s   &&f r9   test_too_small_input"TestCvm_2samp.test_too_small_input  sq     MtL+3HRPP&-CCMM2::bff+=>CJJ

266(:; QPPPs   A(BB/	c                    VP                  ^4      pRp\        P                  ! \        VR7      ;_uu_ 4        \	        W"R4       RRR4       R#   + '       g   i     R# ; i)rC   z/method must be either auto, exact or asymptoticr   xyzN)rM   r/   r   r   r   )r3   r4   r6   msgs   &&  r9   r    TestCvm_2samp.test_invalid_input  s>    IIaL?]]:S11 u- 2111s   AA 	c                   . ROp. ROp\        W4      p\        \        P                  ! V4      \        P                  ! V4      4      p\        VP                  VP
                  3VP                  VP
                  34       R# )r@   N)r@   rA   rB   rF   rD   )r  r   ri   r  )r   rL   r  r   r\   r^   )r3   r5   r6   r1r2s   &    r9   test_list_inputTestCvm_2samp.test_list_input  sV    !!'!"((1+rxx{;bllBII.ryy0IJr<   r!   Nc                   \        V4      '       d/   VP                  R 8  d   VR8X  d   \        P                  ! R4       Vf   \	        V4      M
\        W!4      pVP                  . R
OVR7      pVP                  . ROVR7      p\        W44      p\        VP                  VP                  RVR7      RR7       \        VP                  VP                  RVR7      R	R7       R# )r#   r$   r%   Nr&   gS㥛?r>   r'   g
ףp=
?r   )	gffffff@g @r-   gffffff!@皙"@g#@g333333$@g333333%@gffffff&@)g@g@g@      @333333@gffffff @g333333"@g#@g%@g&@g      '@g(@g      )@g*@g333333-@)r   r.   r/   r0   r   r1   r2   r   r   r\   r^   )r3   r!   r4   r5   r6   rs   &&&   r9   test_example_conover"TestCvm_2samp.test_example_conover  s     B<<BNNU2u	7IKK;<(- $72;MJJGuJUJJ BIN  P &RZZUZ%C$O"**S*">TJr<   zstatistic, m, n, pvalc                2    \        \        WV4      V4       R # r   )r   r   )r3   r\   r  r   pvals   &&&&&r9   test_exact_pvalueTestCvm_2samp.test_exact_pvalue   s     	*9;TBr<   c                   \         P                  P                  R 4      p\        P                  P                  RVR7      p\        P                  P                  RVR7      pVP                  V4      VP                  V4      rC\        W44      p^ VP                  u;8  d	   ^8  g   Q h Q h\        W4R,           4      p^ VP                  u;8  d	   ^8  g   Q h Q hR# )i  r  )re   r  i r   N)	rL   rl   rm   r
   normr  r2   r   r^   )r3   r4   ro   r5   r6   rr  s   &&    r9   test_large_sampleTestCvm_2samp.test_large_sample  s     ii##D)""c"B""S"Azz!}bjjm1 &188a cE*188ar<   c                |   \         P                  P                  ^ 4      pVP                  VP                  ^4      4      pVP                  VP                  ^4      4      p\	        W4RR7      p\	        W4RR7      p\        VP                  VP                  4       \        VP                  VP                  RR7       R# )r   r   r   r   r   r'   N)	rL   rl   r  r2   r   r   r\   r   r^   )r3   r4   ro   r5   r6   rj  rk  s   &&     r9   test_exact_vs_asymptotic&TestCvm_2samp.test_exact_vs_asymptotic  s    ii##A&JJszz!}%JJszz!}%!!w7!!|<bll3		29948r<   c                X   VP                  R 4      pVP                  . RO4      p\        W#RR7      p\        W#RR7      p\        VP                  VP                  4       VP                  R4      p\        W#RR7      p\        W#RR7      p\        VP                  VP                  4       R# )r  r   r   r   g      5@r   N)r   g@g333333*@)rM   r2   r   r   r^   )r3   r4   r5   r6   rj  rk  s   &&    r9   test_method_autoTestCvm_2samp.test_method_auto!  s    IIcNJJ'(!!w7!!v6		299-IIcN!!|<!!v6		299-r<   c                   VP                  ^4      p\        W"4      p\        VP                  VP	                  R4      4       \        VP
                  VP	                  R4      4       \        VR,          VR,          4      p\        VP                  VP	                  R4      4       \        VP
                  VP	                  R4      4       R# )   r   r   :NrB   NN)rM   r   r   r\   r2   r^   )r3   r4   r5   r`   s   &&  r9   test_same_inputTestCvm_2samp.test_same_input-  s     IIbM"1(rzz"~6

BJJrN3"1R5!B%0rzz"~6

BJJrN3r<   rw   rx   ))i  rC   rD   gcj`?)ii  rF   rF   gtE]t?)i@  rB   rD   g88?)i  rD   rF   gXwS?)rz   r{   r|   r}   r/   r~   r   rL   rM   r   rc  r   rl  rs  rw  xslowr{  r~  r  r  r   r   r   s   @r9   r\  r\    s     [[Vr299Q<&8')yy|aS&9&; <[[!!+6R!S< T<<.K [[W&BCK DK [[456
C6
C [[
  
 9
.4 4r<   r\  c                     a  ] tR tRt o . RO. R O. R!O3t. R"O. R O. R!O3t. R#O. R$O. R!O3tRtRtRt	]
P                  P                  R]]R3]]R3]]	R33. R%OR	7      R
 4       tRtRt]
P                  P                  R]]R3]]R33RR.R	7      R 4       tR tR tR tR tR tR tR t]
P                  P                  RR&4      R 4       t]
P                  P                  R. R'O4      R 4       tR tRtV tR# )(TestTukeyHSDi;  aK  
    Comparison LowerCL Difference UpperCL Significance
    2 - 3	0.6908830568	4.34	7.989116943	    1
    2 - 1	0.9508830568	4.6 	8.249116943 	1
    3 - 2	-7.989116943	-4.34	-0.6908830568	1
    3 - 1	-3.389116943	0.26	3.909116943	    0
    1 - 2	-8.249116943	-4.6	-0.9508830568	1
    1 - 3	-3.909116943	-0.26	3.389116943	    0
    aS  
    Comparison LowerCL Difference UpperCL Significance
    2 - 1	0.2679292645	3.645	7.022070736	    1
    2 - 3	0.5934764007	4.34	8.086523599	    1
    1 - 2	-7.022070736	-3.645	-0.2679292645	1
    1 - 3	-2.682070736	0.695	4.072070736	    0
    3 - 2	-8.086523599	-4.34	-0.5934764007	1
    3 - 1	-4.072070736	-0.695	2.682070736	    0
    aS  
    Comparison LowerCL Difference UpperCL Significance
    2 - 3	1.561605075	    4.34	7.118394925	    1
    2 - 1	2.740784879	    6.08	9.419215121	    1
    3 - 2	-7.118394925	-4.34	-1.561605075	1
    3 - 1	-1.964526566	1.74	5.444526566	    0
    1 - 2	-9.419215121	-6.08	-2.740784879	1
    1 - 3	-5.444526566	-1.74	1.964526566	    0
    zdata,res_expect_str,atolr)   g|=equal size sampleidsc                P   \         P                  ! VP                  RR4      P                  4       R,          \        R7      P                  R4      p\        P                  ! V!  pVP                  4       pV F  w  rxrr\        V4      ^,
          \        V4      ^,
          r\        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          R8*  V^8H  4       K  	  R# )	a  
SAS code used to generate results for each sample:
DATA ACHE;
INPUT BRAND RELIEF;
CARDS;
1 24.5
...
3 27.8
;
ods graphics on;   ODS RTF;ODS LISTING CLOSE;
   PROC ANOVA DATA=ACHE;
   CLASS BRAND;
   MODEL RELIEF=BRAND;
   MEANS BRAND/TUKEY CLDIFF;
   TITLE 'COMPARE RELIEF ACROSS MEDICINES  - ANOVA EXAMPLE';
   ods output  CLDiffs =tc;
proc print data=tc;
    format LowerCL 17.16 UpperCL 17.16 Difference 17.16;
    title "Output with many digits";
RUN;
QUIT;
ODS RTF close;
ODS LISTING;
 -  rC   NNr&   r'   r   N)rD   rD   rL   r2   replacesplitfloatr  r   	tukey_hsdconfidence_intervalintr   lowr\   highr^   )r3   datares_expect_strr(   
res_expect	res_tukeyconfrp   jlr  hsigs   &&&&         r9   test_compare_sasTestTukeyHSD.test_compare_sasf  s    B ZZ 6 6uc B H H J2 N&+--4WV_ 	OOT*	,,.",A!q6A:s1vzqDHHQTNA9I//5qDDIIadOQ:Y--ad3s:SAXF #-r<   z
        1	2	-8.2491590248597	-4.6	-0.9508409751403	0.0144483269098
        1	3	-3.9091590248597	-0.26	3.3891590248597	0.9803107240900
        2	3	0.6908409751403	4.34	7.9891590248597	0.0203311368795
        z
        1	2	-7.02207069748501	-3.645	-0.26792930251500 0.03371498443080
        1	3	-2.68207069748500	0.695	4.07207069748500 0.85572267328807
        2	3	0.59347644287720	4.34	8.08652355712281 0.02259047020620
        rF  r.  zunequal size samplec                   \         P                  ! VP                  4       \        R7      P	                  R4      p\
        P                  ! V!  pVP                  4       pV F  w  rxrr\        V4      ^,
          \        V4      ^,
          r\        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       \        VP                  Wx3,          WR7       K  	  R# )a6  
vals = [24.5, 23.5,  26.4, 27.1, 29.9, 28.4, 34.2, 29.5, 32.2, 30.1,
 26.1, 28.3, 24.3, 26.2, 27.8]
names = {'zero', 'zero', 'zero', 'zero', 'zero', 'one', 'one', 'one',
 'one', 'one', 'two', 'two', 'two', 'two', 'two'}
[p,t,stats] = anova1(vals,names,"off");
[c,m,h,nms] = multcompare(stats, "CType","hsd");
r&   r'   NrA   rD   )rL   r2   r  r  r  r   r  r  r  r   r  r\   r  r^   )r3   r  r  r(   r  r  r  rp   r  r  r  r  r8   s   &&&&         r9   test_compare_matlab TestTukeyHSD.test_compare_matlab  s     ZZ 4 4 6&+--4WV_ 	OOT*	,,. *A!q6A:s1vzqDHHQTNA9I//5qDDIIadOQ:I,,QT2AA !+r<   c                h   Rp\         P                  ! VP                  RR4      P                  4       R,          \        R7      P                  R4      p. RO. RO. RO3p\        P                  ! V!  pVP                  4       pV F  w  rgrr\        V4      ^,
          \        V4      ^,
          rv\        VP                  Wg3,          V	RR7       \        VP                  Wg3,          VRR7       \        VP                  Wg3,          V
R	R7       \        VP                  Wg3,          VRR7       K  	  R
# )a  
Testing against results and p-values from R:
from: https://www.rdocumentation.org/packages/stats/versions/3.6.2/
topics/TukeyHSD
> require(graphics)
> summary(fm1 <- aov(breaks ~ tension, data = warpbreaks))
> TukeyHSD(fm1, "tension", ordered = TRUE)
> plot(TukeyHSD(fm1, "tension"))
Tukey multiple comparisons of means
95% family-wise confidence level
factor levels have been ordered
Fit: aov(formula = breaks ~ tension, data = warpbreaks)
$tension
z
                diff        lwr      upr     p adj
        2 - 3  4.722222 -4.8376022 14.28205 0.4630831
        1 - 3 14.722222  5.1623978 24.28205 0.0014315
        1 - 2 10.000000  0.4401756 19.55982 0.0384598
        r  r  r  r&   r.  r'   rU  h㈵>Nr  )   rK   6   r  F   4   3   r  C   r  r        r     )      ,   )r     r  r  ri   r  r  rK   $   *   r  r     '      r  r  r  )r  r     r  rE   +   r  r  r  r  r  r  r  r   r  r  r  r  r  )r3   str_resr  r  r  r  rp   r  r  r  r  r8   s   &           r9   test_compare_rTestTukeyHSD.test_compare_r  s     ZZs ; A A CB G&+--4WV_ 	555	6 OOT*	,,. *A!q6A:s1vzqDHHQTNAD9I//5qtDDIIadOQT:I,,QT2ADA !+r<   c                   . ROp. ROp. ROp. ROp\         P                  ! WW44      pVP                  4       p\        P                  ! . RO. R	O. R
O. RO.4      p\        P                  ! . RO. RO. RO. RO.4      pR FU  w  r\        VP                  W3,          WyV
3,          RR7       \        VP                  W3,          WV
3,          RR7       KW  	  R# )zX
Example sourced from:
https://www.itl.nist.gov/div898/handbook/prc/section4/prc471.htm
r   r'   N)皙@g@333333@gffffff@r   )g @rq  g333333@gffffff"@rp  )g       @g      %@g333333 @r  ro  )r  gffffff@gffffff@gffffff@g@)r   r   r   g      )g(\?r   gq=
ףpgp=
ף?)gGz?r   r   g
ףp=
?)r   r   r   r   )r   r   r   gzG?)gzG@r   g      ?g=
ףp=@)g=
ףp=@r   r   g@)r?   r   )r@   r   )r   rA   r#  r  )r   r  r  rL   r2   r   r  r  )r3   group1group2group3group4r`   r  lowerupperrp   r  s   &          r9   test_engineering_stat_handbook+TestTukeyHSD.test_engineering_stat_handbook  s    
 +*+*ooff=&&(

 	 
 

!	  ?FQDHHQTNEQ$KdCDIIadOUa4[tD ?r<   c                B   \         P                  P                  R 4      pVP                  R4      p\        P                  ! V!  pVP                  4       p\        VP                  VP                  P                  ) 4       \        \         P                  ! VP                  4      VP                  R,          4       \        \         P                  ! VP                  4      VP                  R,          4       \        VP                  VP                  P                  ) 4       \        \         P                  ! VP                  4      ^ 4       \        VP                  VP                  P                  4       \        \         P                  ! VP                  4      ^4       R# )l   ]A N)rA   r   )r   r   )rL   rl   rm   r   r  r  r   r  r  r  diagonalr\   r^   )r3   ro   r  r`   r  s   &    r9   test_rand_symmTestTukeyHSD.test_rand_symm  s    ii##J/zz(#oot$&&(TXX		|, 	R[[+TYYt_=R[[*DHHTN;S]]S]]__$45R[[/3SZZ.R[[,a0r<   c                    \        \        R R7      ;_uu_ 4        \        P                  ! . RO^\        P
                  .. RO4       RRR4       R#   + '       g   i     R# ; i)z...must be finite.r   Nr   )rD   rF   rA   )r   r   r   r  rL   rn   r(  s   &r9   test_no_infTestTukeyHSD.test_no_inf  s8    :-ABBOOI266{I> CBBBs   -AA"	c                    \        \        R R7      ;_uu_ 4        \        P                  ! ^^.^^..^^.. RO4       RRR4       R#   + '       g   i     R# ; i)z...must be one-dimensionalr   N)rC      rD   r   r   r   r  r(  s   &r9   
test_is_1dTestTukeyHSD.test_is_1d  sA    :-IJJOOaVaV,q!fjA KJJJs   #AA	c                    \        \        R R7      ;_uu_ 4        \        P                  ! . ^^.. RO4       RRR4       R#   + '       g   i     R# ; i)z...must be greater than oner   N)rB   rC   rD   r  r(  s   &r9   test_no_emptyTestTukeyHSD.test_no_empty  s4    :-JKKOOBA	2 LKKKs   AA	c           	         R p\        \        VR7      ;_uu_ 4        \        P                  ! . RO^^.^^.RR7       RRR4       R#   + '       g   i     R# ; i)z(Expected a boolean value for 'equal_var'r   False)	equal_varNr   )r   	TypeErrorr   r  )r3   rg  s   & r9   test_equal_var_input_validation,TestTukeyHSD.test_equal_var_input_validation  s=    89C00OOI1v1vI 1000s   !AA	nargsc                    \        \        R R7      ;_uu_ 4        \        P                  ! . RO.V,          !   RRR4       R#   + '       g   i     R# ; i)z...more than 1 treatment.r   Nr  rF   rA   r  )r3   r  s   &&r9   test_not_enough_treatments'TestTukeyHSD.test_not_enough_treatments   s3    :-HIIOOzlU24 JIIIs   AA	clc                    \        \        R R7      ;_uu_ 4        \        P                  ! . RO^^.^	^.4      pVP	                  V4       RRR4       R#   + '       g   i     R# ; i)zmust be between 0 and 1r   Nr  )r   r   r   r  r  )r3   r  rr  s   && r9   test_conf_level_invalid$TestTukeyHSD.test_conf_level_invalid%  sH    :-FGG
QFQF;A!!"% HGGGs   0AA%	c                6   \         P                  ! V P                  R ,          !  p\         P                  ! V P                  R ,          !  p\	        VP
                  VP
                  R,          4       \	        VP
                  VP
                  R,          4       R# ):Nr@   NNr  r  )r   r  data_diff_size	ttest_indr   r^   )r3   r  	res_ttests   &  r9   test_2_args_ttestTestTukeyHSD.test_2_args_ttest+  sj    OOT%8%8%<=	OOT%8%8%<=		(()*:*:4*@A	(()*:*:4*@Ar<   rw   N)rD       7@ffffff:@皙;@fffff=@)ffffff<@皙A@     =@皙@@皙>@)g:@gL<@gL8@g333333:@g;@)rD  r  gHzG:@r  r  r  r  r  )rD  r  r  )
r  r  r  r  r  r  r  r  r  r  )r  unequal sample sizezextreme sample size differencesr  )r  r   r?   r@   )rz   r{   r|   r}   data_same_sizer  extreme_sizesas_same_sizesas_diff_sizesas_extremer/   r~   r   r  matlab_sm_sizmatlab_diff_szr  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r9   r  r  ;  s    4446N H446N '24L
MMK [[7-}dC-}dC+[%@ "E  F#GF#GJMN [[7-}eD-~tDF"5"7"9  :
B:
B*'BRE41&?B3J
 [[Wf-5 .5 [[T>2& 3&
B Br<   r  c                   D  a  ] tR tRt o . RO. RO. RO3t. RO. RO. RO. RO3tRtRt]P                  P                  ]P                  P                  R]]3]]33RR.R7      R 4       4       tR	tR
t]P                  P                  R]]3]]33RR.R7      R 4       tRtV tR# )TestGamesHowelli3  aK  
            Mean Diff      Lower Bound         Upper Bound         Sig
    0 - 1   8.25000000    -16.5492749527311    33.0492749527311    0.558733632413559
    0 - 2  -5.50000000    -63.6702454316458    52.6702454316458    0.941147750599221
    1 - 2  -13.7500000    -74.3174374251372    46.8174374251372    0.682983914946841
    a+  
             Mean Diff       Lower Bound        Upper Bound         Sig
    0 - 1	 28.16666667    -141.985416377670   198.318749711003	0.8727542747886180
    0 - 2	 4.466666667	-37.2830676783904   46.2164010117237	0.9752628408671710
    0 - 3	 16.26666667	-35.0933112382470   67.6266445715803	0.4262506151302880
    1 - 2	-23.70000000	-195.315617201249   147.915617201249	0.9148950609000590
    1 - 3	-11.90000000	-188.105478728519   164.305478728519	0.9861432250093960
    2 - 3	 11.80000000	-16.2894857524254	39.8894857524254    0.4755344436335670
    zdata, res_expect_strr  r  r  c                8   \         P                  ! VP                  RR4      P                  4       R,          \        R7      P                  R^4      p\        P                  ! VRR/ pVP                  4       pV F  w  rgrr\        V4      \        V4      rv\        VP                  Wg3,          VRR7       \        VP                  Wg3,          VRR7       \        VP                  Wg3,          V	R	R7       \        VP                  Wg3,          V
R
R7       K  	  R# )z
DATA LIST LIST /Group (F1.0) Value (F8.2).
BEGIN DATA
0 24
0 23
0 31
0 51
1 34
1 18
1 18
1 26
2 17
2 68
2 59
2 7
END DATA.

ONEWAY Value BY Group
    /MISSING ANALYSIS
    /POSTHOC=GH ALPHA(0.05).
r  r  :rF   NNr&   r  Fg:0yE>r'   rU  r  Nrk   )rL   r2   r  r  r  r  r   r  r  r  r   r\   r^   r  r  )r3   r  r  r  	res_gamesr  rp   r  r  r  r  r8   s   &&&         r9   test_compare_spss!TestGamesHowell.test_compare_spssO  s    8 ZZ""5#.446r: Q 	 OOT;U;	,,. *A!q63q6qI//5qtDI,,QT2ADADHHQTNAD9DIIadOQT: !+r<   z
                  q value             Pr(>|q|)
    1 - 0 == 0   -1.5467805948856344  0.55873362851759
    2 - 0 == 0    0.4726721776628535  0.94114775035993
    2 - 1 == 0    1.246837541297872   0.68298393799782
    aw  
                 q value             Pr(>|q|)
    1 - 0 == 0  -1.0589317485313876  0.87275427357438
    2 - 0 == 0  -0.5716222106144833  0.97526284087419
    3 - 0 == 0  -2.6209678382077000  0.42625067714691
    2 - 1 == 0   0.8971899898179028  0.91489506061850
    3 - 1 == 0   0.4579447210555352  0.98614322544695
    3 - 2 == 0  -2.198800177874794   0.47553444364614
    c                x   \         P                  ! VP                  RR4      P                  RR4      P                  4       R,          \        R7      P                  R^4      p\        P                  ! VRR/ pV F<  w  rV rx\        V4      \        V4      rV\        VP                  We3,          VRR	7       K>  	  R
# )a  
games-howell is provided by PMCMRplus package
https://search.r-project.org/CRAN/refmans/PMCMRplus/html/gamesHowellTest.html
> library("PMCMRplus")
> options(digits=16)
> table = data.frame(
    values = c(24., 23., 31., 51., 34., 18., 18., 26., 17., 68., 59.,  7.),
    groups = c("0", "0", "0", "0", "1", "1", "1", "1", "2", "2", "2", "2")
  )
> table$groups = as.factor(table$groups)
> fit <-aov(values ~ groups, table)
> res = gamesHowellTest(fit)
> summary(res)
r  r  z == :rA   NNr&   r  Fr.  r'   Nrk   )rL   r2   r  r  r  r  r   r  r  r   r^   )	r3   r  r  r  r  r  rp   _r8   s	   &&&      r9   r  TestGamesHowell.test_compare_r  s    ( ZZ""5#.WVS!%%'". !Q 	 OOT;U;	 (MA!Qq63q6qI,,QT2ADA (r<   rw   N)g      8@r  g      ?@     I@)g      A@      2@r  g      :@)g      1@g      Q@g     M@g      @)g      >@r  r  )g     @Tg     Q@g      ;g     O@)g      E@g      &@g      =@g      3@g      I@)r  g      6@r  r  g      "@)rz   r{   r|   r}   r  r  spss_same_sizespss_diff_sizer/   r~   r  r   r  r_same_sizer_diff_sizer  r   r   r   s   @r9   r  r  3  s     ***,N &,/.0N
NN [[[[3,n=+^<>!4!6!8  9
!;9 !;FKK [[3,k:+[9;!4!6!8  9
B9
Br<   r  c                      a  ] tR tRt o ]P
                  P                  R. RO. RO34      R 4       t]P
                  P                  R. RO. RO. RO. RO. RO. RO. RO. RO34      R 4       tR t	R t
R tR	tV tR
# )TestPoissonMeansTesti  zc1, n1, c2, n2, p_expectc                d    \         P                  ! WW44      p\        VP                  VR R7       R# r   r   poisson_means_testr   r^   )r3   c1n1c2n2p_expectr`   s   &&&&&& r9   test_paper_examples(TestPoissonMeansTest.test_paper_examples  s&     &&rr6

H48r<   z c1, n1, c2, n2, p_expect, alt, dc           	     j    \         P                  ! WW4WgR 7      p\        VP                  VRRR7       R# ))r   diffg>r,  r(   rW  Nr  )	r3   r  r  r  r  r  altdr`   s	   &&&&&&&& r9   test_fortran_authors)TestPoissonMeansTest.test_fortran_authors  s*    $ &&rr3O

H4eDr<   c                l    R R r!R R rC\         P                  ! WW$4      p\        VP                  ^4       R# )r   Nr  r3   count1count2nobs1nobs2r`   s   &     r9   test_different_results+TestPoissonMeansTest.test_different_results  s2     eu&&vfD

A&r<   c                l    ^ ^ r!^^rC\         P                  ! WW$4      p\        VP                  ^4       R# r%  r  r&  s   &     r9   test_less_than_zero_lambda_hat24TestPoissonMeansTest.test_less_than_zero_lambda_hat2  s2     A!u&&vfD

A&r<   c           
     
   ^ ^ r!^^rCRp\        \        VR7      ;_uu_ 4        \        P                  ! RW2V4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! WRV4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! RW2V4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! WRV4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! VRW$4       RRR4       \        \        VR7      ;_uu_ 4        \        P                  ! WVR4       RRR4       Rp\        \        VR7      ;_uu_ 4        \        P                  ! WW$RR7       RRR4       R	p\        \        VR7      ;_uu_ 4        \        P                  ! ^^^^R
R7       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELg; i  + '       g   i     ELA; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   z`k1` and `k2` must be integers.r   r   Nz1`k1` and `k2` must be greater than or equal to 0.z%`n1` and `n2` must be greater than 0.z(diff must be greater than or equal to 0.)r  zAlternative must be one of ...errorr   rk   )r   r  r   r  r   )r3   r'  r(  r)  r*  r   s   &     r9   r   *TestPoissonMeansTest.test_input_validation  s   A!u 49G44$$R> 59G44$$VB> 5 F:W55$$R> 6:W55$$VB> 6 ::W55$$VR? 6:W55$$VFB? 6 =:W55$$VFK 6 3:W55$$Q1aWE 655 544444
 655555
 65555
 65
 655s_   G'G;HH#H7III1'G8	;H	H 	#H4	7I	I	I.	1J	rw   N)r   r   rA   r   gea?)r@   r   rD   r   g	c?)r  rE   r  rE   g{}?r   r   )rE   rE   rE   rE   goPF?r   r   )2   r  r?   r?   gae?r   r   )rA   r   r  r,  g/V-=?r   r   )rA   ri   rB   r  g")?r   r   )rB   r  rA   r   g_'Qm~?r   r   )rB   r  rA   rE   g|?r   r   )r?   r?   r3  r  g0ݷ?r   r   )rz   r{   r|   r}   r/   r~   r   r  r#  r+  r.  r   r   r   r   s   @r9   r  r    s     [[7  : 
9
9 [[?
 	=<=>9; 	66B "E#"E''!F !Fr<   r  c                      a  ] tR tRt o R tR t]P                  P                  R
. RO4      R 4       t	]P                  P                  R
. RO4      R 4       t
R tR tRtV tR	# )TestBWSTesti   c                   \         P                  P                  R 4      pVP                  RR7      w  r#Rp\        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! W".W3.4       RRR4       Rp\        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! \         P                  .V4       RRR4       Rp\        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! V. 4       RRR4       Rp\        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! W#RR	7       RRR4       R
p\        P                  ! \
        VR7      ;_uu_ 4        \        P                  ! W#^*R7       RRR4       R#   + '       g   i     EL<; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)   <ovT{ rd   z,`x` and `y` must be exactly one-dimensional.r   Nz"`x` and `y` must not contain NaNs.z$`x` and `y` must be of nonzero size.zalternative` must be one of...r  r   z!method` must be an instance of...r   r@   rF   )	rL   rl   rm   r/   r   r   r   bws_testr]   )r3   ro   r5   r6   r   s   &    r9   test_bws_input_validation%TestBWSTest.test_bws_input_validation  s>   ii##$78zzvz&@]]:W55NNA6A6* 6 7]]:W55NNBFF8Q' 6 9]]:W55NN1b! 6 3]]:W55NN1[9 6 6]]:W55NN1+ 65! 655 65 65 65 655s<   F'"'F;7G=G!G4'F8	;G	G	!G1	4H	c                    . ROp. ROp\         P                  ! WRR7      p\        VP                  RRR7       \	        VP
                  R	4       R# )
r?   r   r   gI+@r>   r'   N)r?   r@   rA   rB   rD   rF   rG   )rC   rj   rE   rh   ri   r   r  gf$/g?)r   r9  r   r\   r   r^   r  s   &   r9    test_against_published_reference,TestBWSTest.test_against_published_reference  s<     "&nnQ{;u48SZZ)r<   c                    \         P                  P                  R 4      pVP                  R	R7      w  rV\        P                  ! WVVR7      p\        VP                  VRR7       \        VP                  VRRR7       R# )
r7  rd   r   vIh%<=rV  r   r   r   Nr8  rL   rl   rm   r   r9  r   r\   r^   r3   r   r\   r^   ro   r5   r6   r`   s   &&&&    r9   test_against_RTestBWSTest.test_against_R&  s]     ii##$78zzvz&nnQ{;yu=

FDAr<   c                   \         P                  P                  R 4      pVP                  ^	R7      pVP                  ^R7      p\        P                  ! WVVR7      p\        VP                  VRR7       \        VP                  VRRR7       R# )	l   .sZ rd   r   r@  rV  r   r   r   NrA  rB  s   &&&&    r9   test_against_R_imbalanced%TestBWSTest.test_against_R_imbalanced7  sk     ii##$78JJAJJJAJnnQ{;yu=

FDAr<   c                $   \         P                  P                  R 4      pVP                  RR7      w  r#\         P                  P                  R 4      p\        P                  ! ^
VR7      p\        P
                  ! W#VR7      p\        VP                  4      ^
8X  g   Q h\         P                  P                  R 4      p\        P                  ! ^
VR7      p\        P
                  ! W#VR7      p\        VP                  VP                  4       \         P                  P                  R4      p\        P                  ! ^
VR7      p\        P
                  ! W#VR7      p\         P                  ! VP                  VP                  4      '       d   Q hR# )   /HN( rd   )n_resamplesro   r   l   VC	A N)r@   rE   )
rL   rl   rm   r   rc  r9  r	  null_distributionr   allclose)r3   ro   r5   r6   r   r  r  r@  s   &       r9   test_methodTestBWSTest.test_methodI  s#   ii##$78zzwz'ii##$78((RSA~~a624))*b000ii##$78((RSA~~a62..0F0FGii##$78((RSA~~a62;;t55t7M7MNNNNNr<   c                   \         P                  P                  R 4      pVP                  ^R7      pV^,
          p\        P                  ! W#RR7      pVP
                  ^ 8  g   Q h\        VP                  ^\        VP                  4      ,          4       \        P                  ! W#RR7      pVP
                  ^ 8  g   Q h\        VP                  ^4       \        P                  ! W2RR7      pVP
                  ^ 8  g   Q h\        VP                  ^\        VP                  4      ,          4       \        P                  ! W2RR7      pVP
                  ^ 8  g   Q h\        VP                  ^4       R# )rI  rd   r   r   r   N)
rL   rl   rm   r   r9  r\   r   r^   r	  rK  )r3   ro   r5   r6   r`   s   &    r9   test_directionsTestBWSTest.test_directions`  s   ii##$78JJAJEnnQy9}}q   SZZS)>)>%?!?@nnQv6}}q   SZZ#nnQv6}}q   SZZS)>)>%?!?@nnQy9}}q   SZZ#r<   rw   N)r   r\   r^   ))r   g
-?g4B/?)r   
-g0&v?)r   rR  g(?))r   gD5H?gdԕ?)r   `ч?gȲךX?)r   rS  g4)?)rz   r{   r|   r}   r:  r=  r/   r~   r   rC  rF  rM  rP  r   r   r   s   @r9   r5  r5     s     ,4* [[CNOB	OB [[CNOB	OBO.$ $r<   r5  )8	itertoolsr   numpyrL   r  r/   numpy.testingr   r   r   r   r   scipyr   r	   scipy.statsr
   scipy.stats._hypotestsr   r   r   r   r   r   r   scipy.stats._mannwhitneyur   r   r   scipy._lib._testutilsr   
scipy._libr   r   scipy._lib._array_apir   r   r   r   scipy._lib._array_api_no_0dr   r   scipy.stats._axis_nan_policyr   r   r    r   r   r  r  r8  r\  r  r  r  r5  rw   r<   r9   <module>r`     sJ       @ @ *   %4 4 4 E D 2 -0 0 H R '(?2 ?2 )?2D 5''(\O \O )\O~ 5%%&	C 	C '	CDl<" l<^P
 P
fV1 V1r '(^4 ^4 )^4BuB uBpsB sBrQF QFht$ t$r<   